Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp524469pxa; Fri, 14 Aug 2020 10:18:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzG+374nnGru/Ra15KDhEecrHXIB6RCixkihZQcNKR7FRhMthcu36rd6MAAUFOISMVElEje X-Received: by 2002:a05:6402:22b3:: with SMTP id cx19mr3232599edb.248.1597425529300; Fri, 14 Aug 2020 10:18:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597425529; cv=none; d=google.com; s=arc-20160816; b=ws9Xw/VqAMOOkWP5cg2+0zp3vfmasaTT0GsTuoeUQOPn5anY3lbvf6Qj9EAAAyvKvE cboksciZmgIM0rtOY/TU3Hp+VDav5i3zqdXitJU0V799iRfdSitODPAtxTg39ceiGoYY F6a8U49dQDREhdM1ldlhfQ8iHwEX5aKC9thyp0+U/u+cXPVAveutx5h0fGIXHgEcbJgS d+Na/yfxx16TBebs3oYzI1KrJ43ABnqrUDRhdwe9zd9JK7IhAltX22TmymsWu+e6spAA Ko0kFic6w5E8oPUg1jyA6M3L6jlLdw8HlTACIrYuIOSNoe6YbWaZ1wW4Y0jGHTNo7TGH RgSw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=jBqv7XoF15D2AZW+fVg/SImKp8YtZFqYUJfdg/5w+4g=; b=irWIJVhNxurxuHYHB81ateppL5xvTxj78QmnomVAr5kqUBfVoZiemUAr1bGBI/CG18 P0/+W/RbXape7psBmZzqpKy2HhgywrPsEo0Z3IeKWctOO2Ro5EOfkgwqPr+FQgxDMywz u31rV8pwtdiBTvrFCQ2E2EOKpx2mZyAaucZbuPeKA0qhSCXsQJaTy6zMmfUxvR4ifAar uphcv+5JkzycFf59hgPvBNDjol/s9UZ7xDV9Jq8UWR8oVDyudhFlzmd6OykYvVGmD/yG 6jCJgfwMtDd34Yd22S37AUWb5FP1v1ELYw2rZCkTGfflEVceY3EIOj+anoz2cBsk/yBA /YgA== 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 g8si6210150ejm.100.2020.08.14.10.18.26; Fri, 14 Aug 2020 10:18:49 -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 S1728350AbgHNRPf (ORCPT + 99 others); Fri, 14 Aug 2020 13:15:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:45768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727894AbgHNRPe (ORCPT ); Fri, 14 Aug 2020 13:15:34 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 20253206B6; Fri, 14 Aug 2020 17:15:33 +0000 (UTC) Date: Fri, 14 Aug 2020 13:15:31 -0400 From: Steven Rostedt To: Vincent Whitchurch Cc: , , , , , , , Subject: Re: [PATCH v2] dynamic debug: allow printing to trace event Message-ID: <20200814131531.01b43c91@oasis.local.home> In-Reply-To: <20200814133151.7759-1-vincent.whitchurch@axis.com> References: <20200814133151.7759-1-vincent.whitchurch@axis.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Aug 2020 15:31:51 +0200 Vincent Whitchurch wrote: > index aa9ff9e1c0b3..f599ed21ecc5 100644 > --- a/include/linux/dynamic_debug.h > +++ b/include/linux/dynamic_debug.h > @@ -27,13 +27,16 @@ 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 */ The above looks like a cleanup unrelated to this patch, and probably should be on its own. > #define _DPRINTK_FLAGS_INCL_MODNAME (1<<1) > #define _DPRINTK_FLAGS_INCL_FUNCNAME (1<<2) > #define _DPRINTK_FLAGS_INCL_LINENO (1<<3) > #define _DPRINTK_FLAGS_INCL_TID (1<<4) > +#define _DPRINTK_FLAGS_TRACE (1<<5) > +#define _DPRINTK_FLAGS_PRINT (_DPRINTK_FLAGS_PRINTK | \ > + _DPRINTK_FLAGS_TRACE) > #if defined DEBUG > -#define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT > +#define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINTK > #else > #define _DPRINTK_FLAGS_DEFAULT 0 > #endif > diff --git a/include/trace/events/printk.h b/include/trace/events/printk.h > index 13d405b2fd8b..6c89121a1669 100644 > --- a/include/trace/events/printk.h > +++ b/include/trace/events/printk.h > @@ -7,7 +7,7 @@ > > #include > > -TRACE_EVENT(console, > +DECLARE_EVENT_CLASS(printk, > TP_PROTO(const char *text, size_t len), > > TP_ARGS(text, len), > @@ -31,6 +31,16 @@ TRACE_EVENT(console, > > TP_printk("%s", __get_str(msg)) > ); > + > +DEFINE_EVENT(printk, console, > + TP_PROTO(const char *text, size_t len), > + TP_ARGS(text, len) > +); > + > +DEFINE_EVENT(printk, dynamic, Can we call this "dynamic_printk" or "printk_dynamic", as trace_dynamic() is too generic. > + TP_PROTO(const char *text, size_t len), > + TP_ARGS(text, len) > +); > #endif /* _TRACE_PRINTK_H */ > > /* This part must be outside protection */ > diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c > index 1d012e597cc3..76fc3e33fe41 100644 > --- a/lib/dynamic_debug.c > +++ b/lib/dynamic_debug.c > @@ -36,6 +36,7 @@ > #include > #include > #include > +#include > > #include > > @@ -84,11 +85,12 @@ 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' }, Again, this looks unrelated, and shouldn't be part of this patch. > { _DPRINTK_FLAGS_INCL_MODNAME, 'm' }, > { _DPRINTK_FLAGS_INCL_FUNCNAME, 'f' }, > { _DPRINTK_FLAGS_INCL_LINENO, 'l' }, > { _DPRINTK_FLAGS_INCL_TID, 't' }, > + { _DPRINTK_FLAGS_TRACE, 'x' }, > { _DPRINTK_FLAGS_NONE, '_' }, > }; > Other then the two comments above, I'm fine with this change. Reviewed-by: Steven Rostedt (VMware) -- Steve