mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Zanussi <tom.zanussi@linux.intel.com>
To: rostedt@goodmis.org
Cc: tglx@linutronix.de, mhiramat@kernel.org, namhyung@kernel.org,
	vedang.patel@intel.com, bigeasy@linutronix.de,
	joel.opensrc@gmail.com, joelaf@google.com,
	mathieu.desnoyers@efficios.com, baohong.liu@intel.com,
	rajvi.jingar@intel.com, julia@ni.com, fengguang.wu@intel.com,
	linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
	Tom Zanussi <tom.zanussi@linux.intel.com>
Subject: [PATCH v8 16/37] tracing: Account for variables in named trigger compatibility
Date: Thu, 21 Dec 2017 10:02:38 -0600	[thread overview]
Message-ID: <ba85f951ef65441e00444c9794601cdb53b045d3.1513802700.git.tom.zanussi@linux.intel.com> (raw)
In-Reply-To: <cover.1513802700.git.tom.zanussi@linux.intel.com>
In-Reply-To: <cover.1513802700.git.tom.zanussi@linux.intel.com>

Named triggers must also have the same set of variables in order to be
considered compatible - update the trigger match test to account for
that.

The reason for this requirement is that named triggers with variables
are meant to allow one or more events to set the same variable.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 kernel/trace/trace_events_hist.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 8f43f24..ba32626 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -1610,7 +1610,7 @@ static int event_hist_trigger_print(struct seq_file *m,
 		sort_key = &hist_data->sort_keys[i];
 		idx = sort_key->field_idx;
 
-		if (WARN_ON(idx >= TRACING_MAP_FIELDS_MAX))
+		if (WARN_ON(idx >= HIST_FIELDS_MAX))
 			return -EINVAL;
 
 		if (i > 0)
@@ -1798,6 +1798,11 @@ static bool hist_trigger_match(struct event_trigger_data *data,
 			return false;
 		if (key_field->is_signed != key_field_test->is_signed)
 			return false;
+		if (!!key_field->var.name != !!key_field_test->var.name)
+			return false;
+		if (key_field->var.name &&
+		    strcmp(key_field->var.name, key_field_test->var.name) != 0)
+			return false;
 	}
 
 	for (i = 0; i < hist_data->n_sort_keys; i++) {
-- 
1.9.3

  parent reply	other threads:[~2017-12-21 16:04 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21 16:02 [PATCH v8 00/37] tracing: Inter-event (e.g. latency) support Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 01/37] tracing: Move hist trigger Documentation to histogram.txt Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 02/37] tracing: Add Documentation for log2 modifier Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 03/37] tracing: Add support to detect and avoid duplicates Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 04/37] tracing: Remove code which merges duplicates Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 05/37] ring-buffer: Add interface for setting absolute time stamps Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 06/37] ring-buffer: Redefine the unimplemented RINGBUF_TYPE_TIME_STAMP Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 07/37] tracing: Add timestamp_mode trace file Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 08/37] tracing: Give event triggers access to ring_buffer_event Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 09/37] tracing: Add ring buffer event param to hist field functions Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 10/37] tracing: Break out hist trigger assignment parsing Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 11/37] tracing: Add hist trigger timestamp support Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 12/37] tracing: Add per-element variable support to tracing_map Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 13/37] tracing: Add hist_data member to hist_field Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 14/37] tracing: Add usecs modifier for hist trigger timestamps Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 15/37] tracing: Add variable support to hist triggers Tom Zanussi
2017-12-21 16:02 ` Tom Zanussi [this message]
2017-12-21 16:02 ` [PATCH v8 17/37] tracing: Move get_hist_field_flags() Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 18/37] tracing: Add simple expression support to hist triggers Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 19/37] tracing: Generalize per-element hist trigger data Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 20/37] tracing: Pass tracing_map_elt to hist_field accessor functions Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 21/37] tracing: Add hist_field 'type' field Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 22/37] tracing: Add variable reference handling to hist triggers Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 23/37] tracing: Add hist trigger action hook Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 24/37] tracing: Add support for 'synthetic' events Tom Zanussi
2018-01-10  5:41   ` Namhyung Kim
2017-12-21 16:02 ` [PATCH v8 25/37] tracing: Add support for 'field variables' Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 26/37] tracing: Add 'onmatch' hist trigger action support Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 27/37] tracing: Add 'onmax' " Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 28/37] tracing: Allow whitespace to surround hist trigger filter Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 29/37] tracing: Add cpu field for hist triggers Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 30/37] tracing: Add hist trigger support for variable reference aliases Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 31/37] tracing: Add 'last error' error facility for hist triggers Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 32/37] tracing: Add inter-event hist trigger Documentation Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 33/37] tracing: Make tracing_set_clock() non-static Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 34/37] tracing: Add a clock attribute for hist triggers Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 35/37] tracing: Increase trace_recursive_lock() limit for synthetic events Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 36/37] tracing: Add inter-event blurb to HIST_TRIGGERS config option Tom Zanussi
2017-12-21 16:02 ` [PATCH v8 37/37] selftests: ftrace: Add inter-event hist triggers testcases Tom Zanussi
2018-01-10  5:45 ` [PATCH v8 00/37] tracing: Inter-event (e.g. latency) support Namhyung Kim
2018-01-10  7:20   ` Steven Rostedt
2018-01-10  8:16     ` Namhyung Kim
2018-01-10 15:18       ` Tom Zanussi
2018-01-15 22:43         ` Steven Rostedt
2018-01-16  2:43           ` Tom Zanussi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba85f951ef65441e00444c9794601cdb53b045d3.1513802700.git.tom.zanussi@linux.intel.com \
    --to=tom.zanussi@linux.intel.com \
    --cc=baohong.liu@intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=fengguang.wu@intel.com \
    --cc=joel.opensrc@gmail.com \
    --cc=joelaf@google.com \
    --cc=julia@ni.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rajvi.jingar@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=vedang.patel@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®