From patchwork Fri Jan 7 05:29:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 12706216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A46E7C433EF for ; Fri, 7 Jan 2022 05:31:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SKZv7/ho0JJWAJ65HWtLtI8wJvcTW6nKjtgC/G4JSoE=; b=bU+g9bGyyQCGfU aC23T3xkAlJyZ8MkNzppfm7fL50HXzPA2hTdX9ui2psIz23gtqyQ586kJK/wtug4Nhx3adGTqF71A 8txrs8eiSjoqFN52ua6gPHL+LM/Z9G3kCZFRZVkRvbep/wBEtPJR36rZPWz2fp+DrF7h42SE6c6t+ jLl6BkvzYmh7w6J5cSY3qCxYBBKB7vc1w0TutRrqJwOr/513B6gjGeMZhxo8aJ+uAre6sNwwAxEV2 0i+RdGGsFAbuVqfjB8sq7CyE74Y0OhyDCa6LFFUa+If0UvuUflqwR3fzyxT0GOx7PuZ/YsHzaqMn7 fjlhDJvOOC+sjgu7eUpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5hpG-002NN6-Cu; Fri, 07 Jan 2022 05:30:06 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5hp1-002NGA-UV for linux-arm-kernel@lists.infradead.org; Fri, 07 Jan 2022 05:29:53 +0000 Received: by mail-il1-x133.google.com with SMTP id r16so2097799ile.8 for ; Thu, 06 Jan 2022 21:29:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lpR+Wzjsd8/n8K/fL3FJZojKGtiDXaXpVwmgPUkzxkk=; b=kcdk3FaUVivat78Z34FqwhxWMsSOmhYYOZs8AddqrFD6uYNmMpus66TSk2xpzFxtrV BntfkHVOpBKu5HtkucweUsJ41cdONGyAsGe7l+QkQZiX4qxlyanuiwUSfnTGu7p9DCj1 yGdeIKcBH2R4dcLa7lUtyEBbv9/F3a1T3PVKKHODTp76KhbNeksGua5ZOSkuIUNTGLHr AmSO2L2nfE3g5Ct/RfDrCrBBCA7RQrIoOi3/tAej9GHaMaw2VASYGCAsMZ56CUeqQIuc T3IyHODCHXrsGFuNsQiTrsGqQUoUeHFsmMvn7QDiMQKUznwB3go5VNeQfo/JIEI4ez5s KcbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lpR+Wzjsd8/n8K/fL3FJZojKGtiDXaXpVwmgPUkzxkk=; b=upCEDs65Vv9J1AXUz4J5boUTfqEJia2L1J/ErAXjjqhOiBc8lHLUJV09RgBXkXa3PO USafCksknL1Fx2DLVHeVelcrfXV7egnuCTCo6dBbZ6km7F2SS9PrV0R3Ah/52pM7n6if rQsX1WRYIQjhWUPrQ6NdhJQ4RfzJ+O6tdecG87I4wCSySvmp3ZkJB5x8z3mvQvOnCdxx 03bCJ5HicQ7kT6SOWtwjUB2S61oa+PhgameukDM5dh3VBCE0WPmZGozGX1N/ilig0oXE 22ZId3BE8TLRCiUE/4xFQu++ySGoahXc64Afk4oFgWQrcAGMtK4QB8Ve9mVLhwIC5Ic5 Vdlw== X-Gm-Message-State: AOAM533U+TFqIr/Ff033BqoHD8TbRRX6WAuYvTgVuphNS3h5iFzefRBp zjp47g5G0+zjtgdWMSXatKE= X-Google-Smtp-Source: ABdhPJwJw2VOt3cs2Z4BotAI96BncuuqFpweYCpjRMmtvlP3qpc+7bG6DCXhRkMcKsekCrQJu3i+gQ== X-Received: by 2002:a05:6e02:1348:: with SMTP id k8mr25875405ilr.297.1641533391036; Thu, 06 Jan 2022 21:29:51 -0800 (PST) Received: from frodo.. (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id c18sm1843446iod.18.2022.01.06.21.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 21:29:50 -0800 (PST) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux@rasmusvillemoes.dk, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, daniel.vetter@ffwll.ch, seanpaul@chromium.org, robdclark@gmail.com, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com, vincent.whitchurch@axis.com Subject: [PATCH v11 01/19] dyndbg: add _DPRINTK_FLAGS_ENABLED Date: Thu, 6 Jan 2022 22:29:24 -0700 Message-Id: <20220107052942.1349447-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220107052942.1349447-1-jim.cromie@gmail.com> References: <20220107052942.1349447-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220106_212952_005130_52029D50 X-CRM114-Status: GOOD ( 15.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Distinguish the condition: _DPRINTK_FLAGS_ENABLED from the bit: _DPRINTK_FLAGS_PRINT, in preparation to add _DPRINTK_FLAGS_TRACE next. Also add a 'K' to get _DPRINTK_FLAGS_PRINTK, to insure is not used elsewhere with a stale meaning. CC: vincent.whitchurch@axis.com Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 10 ++++++---- lib/dynamic_debug.c | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index dce631e678dd..257a7bcbbe36 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -27,7 +27,7 @@ struct _ddebug { * writes commands to /dynamic_debug/control */ #define _DPRINTK_FLAGS_NONE 0 -#define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */ +#define _DPRINTK_FLAGS_PRINTK (1<<0) /* printk() a message using the format */ #define _DPRINTK_FLAGS_INCL_MODNAME (1<<1) #define _DPRINTK_FLAGS_INCL_FUNCNAME (1<<2) #define _DPRINTK_FLAGS_INCL_LINENO (1<<3) @@ -37,8 +37,10 @@ struct _ddebug { (_DPRINTK_FLAGS_INCL_MODNAME | _DPRINTK_FLAGS_INCL_FUNCNAME |\ _DPRINTK_FLAGS_INCL_LINENO | _DPRINTK_FLAGS_INCL_TID) +#define _DPRINTK_FLAGS_ENABLED _DPRINTK_FLAGS_PRINTK + #if defined DEBUG -#define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT +#define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINTK #else #define _DPRINTK_FLAGS_DEFAULT 0 #endif @@ -120,10 +122,10 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, #ifdef DEBUG #define DYNAMIC_DEBUG_BRANCH(descriptor) \ - likely(descriptor.flags & _DPRINTK_FLAGS_PRINT) + likely(descriptor.flags & _DPRINTK_FLAGS_ENABLED) #else #define DYNAMIC_DEBUG_BRANCH(descriptor) \ - unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) + unlikely(descriptor.flags & _DPRINTK_FLAGS_ENABLED) #endif #endif /* CONFIG_JUMP_LABEL */ diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index dd7f56af9aed..78a2912976c1 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -86,7 +86,7 @@ static inline const char *trim_prefix(const char *path) } static struct { unsigned flag:8; char opt_char; } opt_array[] = { - { _DPRINTK_FLAGS_PRINT, 'p' }, + { _DPRINTK_FLAGS_PRINTK, 'p' }, { _DPRINTK_FLAGS_INCL_MODNAME, 'm' }, { _DPRINTK_FLAGS_INCL_FUNCNAME, 'f' }, { _DPRINTK_FLAGS_INCL_LINENO, 'l' }, @@ -210,10 +210,10 @@ static int ddebug_change(const struct ddebug_query *query, if (newflags == dp->flags) continue; #ifdef CONFIG_JUMP_LABEL - if (dp->flags & _DPRINTK_FLAGS_PRINT) { - if (!(modifiers->flags & _DPRINTK_FLAGS_PRINT)) + if (dp->flags & _DPRINTK_FLAGS_ENABLED) { + if (!(modifiers->flags & _DPRINTK_FLAGS_ENABLED)) static_branch_disable(&dp->key.dd_key_true); - } else if (modifiers->flags & _DPRINTK_FLAGS_PRINT) + } else if (modifiers->flags & _DPRINTK_FLAGS_ENABLED) static_branch_enable(&dp->key.dd_key_true); #endif dp->flags = newflags;