Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753220AbbLJSwt (ORCPT ); Thu, 10 Dec 2015 13:52:49 -0500 Received: from mga14.intel.com ([192.55.52.115]:24645 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753089AbbLJSwo (ORCPT ); Thu, 10 Dec 2015 13:52:44 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,409,1444719600"; d="scan'208";a="615998002" From: Tom Zanussi To: rostedt@goodmis.org 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, Tom Zanussi Subject: [PATCH v13 06/29] tracing: Add needs_rec flag to event triggers Date: Thu, 10 Dec 2015 12:50:48 -0600 Message-Id: <7be8fa38f9b90fdb6c47ca0f98d20a07b9fd512b.1449767187.git.tom.zanussi@linux.intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2540 Lines: 65 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; 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; } -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/