Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1701832ybk; Thu, 21 May 2020 13:08:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGWqWZWkYV7EdWBUiof2uwfsepaTKh2jxNfmkb4mPb1GBn8Trn9VHPdiSseb+4Ct2ays95 X-Received: by 2002:a50:a412:: with SMTP id u18mr393844edb.192.1590091694018; Thu, 21 May 2020 13:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590091694; cv=none; d=google.com; s=arc-20160816; b=HKuQyHg92J6k84q5/pu0/+pKCnJc9L0pgZCq7QHqT8KWRMzj7Yi5hmeSrWntL/bqDw wDgr9WCQI19fyiFXVCwnYoPsJGFoqyomjLLzUKGE/qu5CgoYvUd1m7PFsc5e/pSQcpAy kqiAnJx0g+IBk990o/bOuccsUBSZks5LfuNYdTgfQhqUPxm9bRLwRx1AmPeNYYZcn8M/ hKBFgaRuJZuy1Kmkl0HAYH8Nb4beeMdaSLQgq8qbB4NuMeslm7UcAoMSq12hIh3w9ls/ WaPRSM4lyCAp/ucWB505qgkQgkwku97p8df265+/pUcoHv+x1KCn4H8KzCjvQRsoeuXZ gngA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=F0stEOCZFjDD6oIPJ8RwOerK9SQt7/b5Q0YCnonloHE=; b=iV6QbK93bBQQzwUJE1z7N7Z9FMEfjVA1Q14tORegfkDjcS2ZvGbe1dX382dC7qiEo7 cqiz2+iZ9zAj0HGbtoCYbtGGXPqnNHAKUohaZld51FVtTUe5mOs5sRUX7c2HDmmB4fvD vIbKZ3nCo5YbKaP5QqVgpg2+s4KPPtYZzNtfwa4/DC2A41WLM59goXGj9Z2x92mTTdVx jrtErfaR11rjQ7YvHndNBfzW88g+b2zW8ltZkqG+5wGI9p0HP+FTSVcvjc2T+j79d82y xNZk0rGCXRCa8I3Lo8FuHQbV2ThtmpPsChkl4+EElEJW3A3IOO1Sz7kNpqfFLOEfDchp lD4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p6si3661781edh.66.2020.05.21.13.07.50; Thu, 21 May 2020 13:08:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728554AbgEUUGO (ORCPT + 99 others); Thu, 21 May 2020 16:06:14 -0400 Received: from smtprelay0152.hostedemail.com ([216.40.44.152]:59316 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728368AbgEUUGO (ORCPT ); Thu, 21 May 2020 16:06:14 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 08A8E837F24C; Thu, 21 May 2020 20:06:13 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:146:355:379:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1719:1730:1747:1777:1792:1981:2194:2199:2282:2393:2525:2560:2563:2682:2685:2691:2693:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:5007:7903:8784:8957:9025:10004:10400:10848:11026:11218:11232:11473:11658:11914:12043:12296:12297:12438:12555:12740:12760:12895:12986:13069:13311:13357:13439:14096:14097:14180:14181:14659:14721:21080:21451:21627:30012:30034:30054: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:9,LUA_SUMMARY:none X-HE-Tag: steel94_4f05fa326d21 X-Filterd-Recvd-Size: 2688 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf07.hostedemail.com (Postfix) with ESMTPA; Thu, 21 May 2020 20:06:11 +0000 (UTC) Message-ID: <5bb4b918aec3c77038122588ee642ae4aa2a09b0.camel@perches.com> Subject: [RFC] Make dynamic debug infrastructure more flexible From: Joe Perches To: Jason Baron Cc: Vikash Garodia , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 21 May 2020 13:06:10 -0700 In-Reply-To: References: <20200521132816.31111-1-stanimir.varbanov@linaro.org> <20200521132816.31111-3-stanimir.varbanov@linaro.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-05-21 at 09:08 -0700, Joe Perches wrote: > On Thu, 2020-05-21 at 16:28 +0300, Stanimir Varbanov wrote: > > Here we introduce few debug macros with levels (low, medium and > > high) and debug macro for firmware. Enabling the particular level > > will be done by dynamic debug. > > I'd rather make the logging level facility generic in > dynamic debug than prefix all formats with what could > be non-specific content. > > From a long time ago: > > https://groups.google.com/forum/#!msg/linux.kernel/VlWbno-ZAFw/k_fFadhNHXcJ Hey Jason. I believe there are 6 bits left in the unsigned int use for the line number and flags in struct _ddebug Assuming the use of a mechanism like pr_debug_level(level, fmt, ...) would you be OK with something like this to enable a level or bitmask test of dynamic debug logging output? where the output is controlled by something like echo 'file level +p' > /dynamic_debug/control to enable dynamic debug output only at level or higher or maybe match a bitmap of (modulo all the rest of the code necessary to use it?) --- include/linux/dynamic_debug.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index abcd5fde30eb..616dbb2b5921 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -38,6 +38,8 @@ struct _ddebug { #define _DPRINTK_FLAGS_DEFAULT 0 #endif unsigned int flags:8; + unsigned int level:5; + unsigned int level_is_bitmask:1; #ifdef CONFIG_JUMP_LABEL union { struct static_key_true dd_key_true;