Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1275808

[PATCH v12 07/30] tracing: Add needs_rec flag to event triggers

From Tom Zanussi <tom.zanussi@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH v12 07/30] tracing: Add needs_rec flag to event triggers
Date 2015-11-23 21:00 +0100
Message-ID <qy5rm-6jA-69@gated-at.bofh.it> (permalink)
References <qy5rk-6jA-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <tom.zanussi@linux.intel.com>
Tested-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---
 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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/30] tracing: 'hist' triggers Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:00 +0100
  [PATCH v12 02/30] tracing: Make ftrace_event_field checking functions available Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:00 +0100
  [PATCH v12 26/30] tracing: Add support for named triggers Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:00 +0100
  [PATCH v12 04/30] tracing: Add event record param to trigger_ops.func() Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:00 +0100
  [PATCH v12 23/30] tracing: Add enable_hist/disable_hist triggers Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:00 +0100
  [PATCH v12 07/30] tracing: Add needs_rec flag to event triggers Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:00 +0100
  [PATCH v12 11/30] tracing: Add hist trigger support for multiple values ('vals=' param) Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:10 +0100
  [PATCH v12 08/30] tracing: Add an unreg_all() callback to trigger commands Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:10 +0100
  [PATCH v12 06/30] tracing: Add a per-event-trigger 'paused' field Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:10 +0100
  [PATCH v12 03/30] tracing: Make event trigger functions available Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:10 +0100
  [PATCH v12 01/30] tracing: Update cond flag when enabling or disabling a trigger Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:10 +0100
    Re: [PATCH v12 01/30] tracing: Update cond flag when enabling or  disabling a trigger Steven Rostedt <rostedt@goodmis.org> - 2015-11-23 22:30 +0100
      Re: [PATCH v12 01/30] tracing: Update cond flag when enabling or  disabling a trigger Namhyung Kim <namhyung@kernel.org> - 2015-11-25 02:30 +0100
  [PATCH v12 10/30] tracing: Add 'hist' event trigger command Tom Zanussi <tom.zanussi@linux.intel.com> - 2015-11-23 21:10 +0100
    Re: [PATCH v12 10/30] tracing: Add 'hist' event trigger command Namhyung Kim <namhyung@kernel.org> - 2015-11-29 16:00 +0100
  Re: [PATCH 00/30] tracing: 'hist' triggers Namhyung Kim <namhyung@kernel.org> - 2015-11-29 16:30 +0100

csiph-web