Message ID | 1496139572.2618.19.camel@perches.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Hans Verkuil |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from <linux-media-owner@vger.kernel.org>) id 1dFeFv-0001Od-22; Tue, 30 May 2017 10:20:03 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.89/mailfrontend-7) with esmtp id 1dFeFs-0008Iw-2l; Tue, 30 May 2017 12:20:02 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751322AbdE3KTo (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Tue, 30 May 2017 06:19:44 -0400 Received: from smtprelay0236.hostedemail.com ([216.40.44.236]:53557 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751004AbdE3KTm (ORCPT <rfc822;linux-media@vger.kernel.org>); Tue, 30 May 2017 06:19:42 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 980099EDF0; Tue, 30 May 2017 10:19:35 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2, 0, 0, , d41d8cd98f00b204, joe@perches.com, :::::::::::::, RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3871:3872:4321:5007:10004:10400:10848:11026:11232:11473:11658:11783:11914:12043:12048:12295:12296:12438:12555:12740:12895:12986:13069:13311:13357:13439:13894:14659:14721:21080:21220:21324:21433:21451:21627:30054:30070:30091, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:, MSBL:0, DNSBL:none, Custom_rules:0:0:0, LFtime:2, LUA_SUMMARY:none X-HE-Tag: alley23_537f1905d3462 X-Filterd-Recvd-Size: 2250 Received: from XPS-9350 (unknown [47.151.132.55]) (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA; Tue, 30 May 2017 10:19:33 +0000 (UTC) Message-ID: <1496139572.2618.19.camel@perches.com> Subject: Re: [PATCH v2] [media] vb2: core: Lower the log level of debug outputs From: Joe Perches <joe@perches.com> To: Hirokazu Honda <hiroh@chromium.org>, Pawel Osciak <pawel@osciak.com>, Marek Szyprowski <m.szyprowski@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, Mauro Carvalho Chehab <mchehab@kernel.org> Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 30 May 2017 03:19:32 -0700 In-Reply-To: <20170530094901.1807-1-hiroh@chromium.org> References: <20170530094901.1807-1-hiroh@chromium.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.5.30.101217 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, MIME_LOWER_CASE 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1200_1299 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, MULTIPLE_REAL_RCPTS 0, NO_CTA_URI_FOUND 0, NO_URI_FOUND 0, NO_URI_HTTPS 0, REFERENCES 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FROM_DOMAIN_IN_ANY_CC1 0, __FROM_DOMAIN_IN_RCPT 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_LIST_ID 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __MULTIPLE_RCPTS_TO_X5 0, __NO_HTML_TAG_RAW 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __SUBJ_ALPHA_NEGATE 0, __TO_MALFORMED_2 0, __TO_NAME 0, __TO_NAME_DIFF_FROM_ACC 0, __TO_REAL_NAMES 0' |
Commit Message
Joe Perches
May 30, 2017, 10:19 a.m. UTC
On Tue, 2017-05-30 at 18:49 +0900, Hirokazu Honda wrote: > Some debug output whose log level is set 1 flooded the log. > Their log level is lowered to find the important log easily. Maybe use pr_debug instead? Perhaps it would be better to change the level to a bitmap so these can be more individually controlled. Maybe add MODULE_PARM_DESC too. Perhaps something like below (without the pr_debug conversion) --- drivers/media/v4l2-core/videobuf2-core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
Comments
On Wed, 2017-05-31 at 11:05 +0900, Hirokazu Honda wrote: > Although bitmap is useful, there is need to change the log level for each > log. > Because it will take a longer time, it should be done in another patch. I have no idea what you mean. A bit & comparison is typically an identical instruction cycle count to a >= comparison.
On Wed, 2017-05-31 at 12:28 +0900, Hirokazu Honda wrote: > If I understand a bitmap correctly, it is necessary to change the log level > for each message. > I didn't mean a bitmap will take a long CPU time. > I mean the work to change so takes a long time. No, none of the messages or levels need change, only the >= test changes to & so that for instance, level 1 and level 3 messages could be emitted without also emitting level 2 messages. The patch suggested is all that would be required.
On 31/05/17 06:06, Joe Perches wrote: > On Wed, 2017-05-31 at 12:28 +0900, Hirokazu Honda wrote: >> If I understand a bitmap correctly, it is necessary to change the log level >> for each message. >> I didn't mean a bitmap will take a long CPU time. >> I mean the work to change so takes a long time. > > No, none of the messages or levels need change, > only the >= test changes to & so that for instance, > level 1 and level 3 messages could be emitted > without also emitting level 2 messages. > > The patch suggested is all that would be required. > I prefer the solution that Joe proposed as well. It's more useful, esp. with a complex beast like vb2. Regards, Hans
Hi, I completely understand bitmask method now. I agree to the idea, but it is necessary to change the specification of a debug parameter. (We probably need to change a document about that?) For example, there is maybe a user who set a debug parameter 3. The user assume that logs whose levels are less than 4 are shown. However, after the bitmask method is adopted, someday the logs whose level is 1 or 2 are only shown, not 3 level logs are not shown. This will be confusing to users. The function that users can select a log method is necessary (e.g. implement dprintk_bitmask and dprintk_level) The main purpose of my patch is to not output much log messages. I think the current patch is enough to accomplish the purpose. Changing the method is a related but different task from my patch. Therefore, I think it should be done in another patch. Best, Hirokazu Honda On Wed, Jun 7, 2017 at 6:01 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote: > On 31/05/17 06:06, Joe Perches wrote: >> On Wed, 2017-05-31 at 12:28 +0900, Hirokazu Honda wrote: >>> If I understand a bitmap correctly, it is necessary to change the log level >>> for each message. >>> I didn't mean a bitmap will take a long CPU time. >>> I mean the work to change so takes a long time. >> >> No, none of the messages or levels need change, >> only the >= test changes to & so that for instance, >> level 1 and level 3 messages could be emitted >> without also emitting level 2 messages. >> >> The patch suggested is all that would be required. >> > > I prefer the solution that Joe proposed as well. > > It's more useful, esp. with a complex beast like vb2. > > Regards, > > Hans
On Thu, Jun 8, 2017 at 12:24 PM, Hirokazu Honda <hiroh@chromium.org> wrote: > Hi, > > I completely understand bitmask method now. > I agree to the idea, but it is necessary to change the specification of > a debug parameter. > (We probably need to change a document about that?) > For example, there is maybe a user who set a debug parameter 3. > The user assume that logs whose levels are less than 4 are shown. > However, after the bitmask method is adopted, someday the logs whose > level is 1 or 2 are only shown, not 3 level logs are not shown. > This will be confusing to users. I think I have to agree with Hirokazu here. Even though it's only about debugging, there might be some automatic testing systems that actually rely on certain values here. It probably shouldn't be considered hard ABI, but that still could be a significant annoyance for everyone. However, one could add this in an incremental way, i.e. add a new debug_mask parameter that would be used by dprinkt(), while making the original debug parameter simply update the debug_mask whenever it's changed. I still think that it should be made with a separate patch, though, as adjusting the levels and changing the filtering method are orthogonal. Best regards, Tomasz
On Thu, 2017-06-08 at 13:39 +0900, Tomasz Figa wrote: > On Thu, Jun 8, 2017 at 12:24 PM, Hirokazu Honda <hiroh@chromium.org> wrote: > > Hi, > > > > I completely understand bitmask method now. > > I agree to the idea, but it is necessary to change the specification of > > a debug parameter. > > (We probably need to change a document about that?) > > For example, there is maybe a user who set a debug parameter 3. > > The user assume that logs whose levels are less than 4 are shown. > > However, after the bitmask method is adopted, someday the logs whose > > level is 1 or 2 are only shown, not 3 level logs are not shown. > > This will be confusing to users. > > I think I have to agree with Hirokazu here. Even though it's only > about debugging, there might be some automatic testing systems that > actually rely on certain values here. I think it's a non-argument. If there automated systems that rely on specific levels, then changing the levels of individual messages could also cause those automated systems to fail.
On Thu, Jun 8, 2017 at 2:16 PM, Joe Perches <joe@perches.com> wrote: > On Thu, 2017-06-08 at 13:39 +0900, Tomasz Figa wrote: >> On Thu, Jun 8, 2017 at 12:24 PM, Hirokazu Honda <hiroh@chromium.org> wrote: >> > Hi, >> > >> > I completely understand bitmask method now. >> > I agree to the idea, but it is necessary to change the specification of >> > a debug parameter. >> > (We probably need to change a document about that?) >> > For example, there is maybe a user who set a debug parameter 3. >> > The user assume that logs whose levels are less than 4 are shown. >> > However, after the bitmask method is adopted, someday the logs whose >> > level is 1 or 2 are only shown, not 3 level logs are not shown. >> > This will be confusing to users. >> >> I think I have to agree with Hirokazu here. Even though it's only >> about debugging, there might be some automatic testing systems that >> actually rely on certain values here. > > I think it's a non-argument. > > If there automated systems that rely on specific levels, then > changing the levels of individual messages could also cause > those automated systems to fail. Well, that might be true for some of them indeed. I was thinking about our use case, which relies on particular numbers to get expected verbosity levels not caring about particular messages. I guess the break all or none rule is going to apply here, so we should do the bitmap conversion indeed. :) On the other hand, I think it would be still preferable to do the conversion in a separate patch. Best regards, Tomasz
On Thu, 2017-06-08 at 14:24 +0900, Tomasz Figa wrote: > On Thu, Jun 8, 2017 at 2:16 PM, Joe Perches <joe@perches.com> wrote: [] > > If there automated systems that rely on specific levels, then > > changing the levels of individual messages could also cause > > those automated systems to fail. > > Well, that might be true for some of them indeed. I was thinking about > our use case, which relies on particular numbers to get expected > verbosity levels not caring about particular messages. I guess the > break all or none rule is going to apply here, so we should do the > bitmap conversion indeed. :) > > On the other hand, I think it would be still preferable to do the > conversion in a separate patch. Right. No worries.
Hi, According to patch work, this patch are not approved yet and its status are "Changes Requested." What changes are necessary actually? If there is no necessary change, can you approve this patch? Best, Hirokazu Honda On Thu, Jun 8, 2017 at 2:33 PM, Joe Perches <joe@perches.com> wrote: > On Thu, 2017-06-08 at 14:24 +0900, Tomasz Figa wrote: >> On Thu, Jun 8, 2017 at 2:16 PM, Joe Perches <joe@perches.com> wrote: > [] >> > If there automated systems that rely on specific levels, then >> > changing the levels of individual messages could also cause >> > those automated systems to fail. >> >> Well, that might be true for some of them indeed. I was thinking about >> our use case, which relies on particular numbers to get expected >> verbosity levels not caring about particular messages. I guess the >> break all or none rule is going to apply here, so we should do the >> bitmap conversion indeed. :) >> >> On the other hand, I think it would be still preferable to do the >> conversion in a separate patch. > > Right. No worries. >
On 06/28/2017 12:57 AM, Hirokazu Honda wrote: > Hi, > > According to patch work, this patch are not approved yet and its > status are "Changes Requested." > What changes are necessary actually? > If there is no necessary change, can you approve this patch? I was considering to have more fine grained control by changing the debug parameter to a bitmask. But after thinking about it a bit more I decided that this patch is OK after all. I'll pick it up the next time I prepare a pull request. Regards, Hans > > Best, > Hirokazu Honda > > On Thu, Jun 8, 2017 at 2:33 PM, Joe Perches <joe@perches.com> wrote: >> On Thu, 2017-06-08 at 14:24 +0900, Tomasz Figa wrote: >>> On Thu, Jun 8, 2017 at 2:16 PM, Joe Perches <joe@perches.com> wrote: >> [] >>>> If there automated systems that rely on specific levels, then >>>> changing the levels of individual messages could also cause >>>> those automated systems to fail. >>> >>> Well, that might be true for some of them indeed. I was thinking about >>> our use case, which relies on particular numbers to get expected >>> verbosity levels not caring about particular messages. I guess the >>> break all or none rule is going to apply here, so we should do the >>> bitmap conversion indeed. :) >>> >>> On the other hand, I think it would be still preferable to do the >>> conversion in a separate patch. >> >> Right. No worries. >>
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 94afbbf92807..88ae2b238115 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -31,12 +31,13 @@ static int debug; module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "debugging output control bitmap (values from 0-31)") -#define dprintk(level, fmt, arg...) \ - do { \ - if (debug >= level) \ - pr_info("vb2-core: %s: " fmt, __func__, ## arg); \ - } while (0) +#define dprintk(level, fmt, ...) \ +do { \ + if (debug & BIT(level)) \ + pr_info("vb2-core: %s: " fmt, __func__, ##__VA_ARGS__); \ +} while (0) #ifdef CONFIG_VIDEO_ADV_DEBUG