From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2993260AbcBSTa0 (ORCPT ); Fri, 19 Feb 2016 14:30:26 -0500 Received: from smtprelay0107.hostedemail.com ([216.40.44.107]:49609 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2993245AbcBSTaR (ORCPT ); Fri, 19 Feb 2016 14:30:17 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2194:2198:2199:2200:2393:2553:2559:2562:2692:2731:2895:2901:2907:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:4605:5007:6119:6261:7875:7903:9010:9108:10004:10400:10848:10967:11026:11232:11658:11914:12043:12295:12296:12438:12517:12519:12555:12663:12740:13138:13180:13229:13231:14096:14097:14659:21060:21063:21080:30029:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: girls12_1f368b714392e X-Filterd-Recvd-Size: 3962 Date: Fri, 19 Feb 2016 14:30:13 -0500 From: Steven Rostedt To: Tom Zanussi Cc: masami.hiramatsu.pt@hitachi.com, namhyung@kernel.org, josh@joshtriplett.org, andi@firstfloor.org, mathieu.desnoyers@efficios.com, peterz@infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v13 06/29] tracing: Add needs_rec flag to event triggers Message-ID: <20160219143013.57c81933@gandalf.local.home> In-Reply-To: <7be8fa38f9b90fdb6c47ca0f98d20a07b9fd512b.1449767187.git.tom.zanussi@linux.intel.com> References: <7be8fa38f9b90fdb6c47ca0f98d20a07b9fd512b.1449767187.git.tom.zanussi@linux.intel.com> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Dec 2015 12:50:48 -0600 Tom Zanussi wrote: > Add a new needs_rec flag for triggers that require unconditional > access to trace records in order to function. > > Normally a trigger requires access to the contents of a trace record > only if it has a filter associated with it (since filters need the > contents of a record in order to make a filtering decision). Some > types of triggers, such as 'hist' triggers, require access to trace > record contents independent of the presence of filters, so add a new > flag for those triggers. > > Signed-off-by: Tom Zanussi > Tested-by: Masami Hiramatsu > Reviewed-by: Namhyung Kim > --- > kernel/trace/trace.h | 7 +++++++ > kernel/trace/trace_events_trigger.c | 3 ++- > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h > index 5e23a97..300add5 100644 > --- a/kernel/trace/trace.h > +++ b/kernel/trace/trace.h > @@ -1293,6 +1293,12 @@ struct event_trigger_ops { > * itself logs to the trace buffer, this flag should be set, > * otherwise it can be left unspecified. > * > + * @needs_rec: A flag that says whether or not this command needs > + * access to the trace record in order to perform its function, > + * regardless of whether or not it has a filter associated with > + * it (filters make a trigger require access to the trace record > + * but are not always present). > + * > * All the methods below, except for @set_filter(), must be > * implemented. > * > @@ -1333,6 +1339,7 @@ struct event_command { > char *name; > enum event_trigger_type trigger_type; > bool post_trigger; > + bool needs_rec; Note, from what I understand, gcc sucks with bool in structures. Best thing to do here is to create a "int flags" field, and check the result with masks. You don't need to update this patch (I'm still working on the series), but a patch on top of these may be necessary. I could add the patch too. -- Steve > int (*func)(struct event_command *cmd_ops, > struct trace_event_file *file, > char *glob, char *cmd, char *params); > diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c > index 8375d29..2f881e9 100644 > --- a/kernel/trace/trace_events_trigger.c > +++ b/kernel/trace/trace_events_trigger.c > @@ -498,7 +498,8 @@ void update_cond_flag(struct trace_event_file *file) > bool set_cond = false; > > list_for_each_entry_rcu(data, &file->triggers, list) { > - if (data->filter || data->cmd_ops->post_trigger) { > + if (data->filter || data->cmd_ops->post_trigger || > + data->cmd_ops->needs_rec) { > set_cond = true; > break; > }