tracing: Account for variables in named trigger compatibility
authorTom Zanussi <tom.zanussi@linux.intel.com>
Tue, 16 Jan 2018 02:51:50 +0000 (20:51 -0600)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Sat, 10 Mar 2018 21:05:55 +0000 (16:05 -0500)
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.

Link: http://lkml.kernel.org/r/a17eae6328a99917f9d5c66129c9fcd355279ee9.1516069914.git.tom.zanussi@linux.intel.com
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_hist.c

index 8f43f24bf49c35ead4826288ecb3df61ebb6c5c4..ba326260c034e785bc338872a1a6a28b60237032 100644 (file)
@@ -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++) {