From: Tom Zanussi Date: Mon, 26 Jun 2017 17:49:18 -0500 Subject: [PATCH 17/32] tracing: Account for variables in named trigger compatibility 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 Signed-off-by: Sebastian Andrzej Siewior --- kernel/trace/trace_events_hist.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -1545,7 +1545,7 @@ static int event_hist_trigger_print(stru 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) @@ -1733,6 +1733,12 @@ static bool hist_trigger_match(struct ev return false; if (key_field->is_signed != key_field_test->is_signed) return false; + if ((key_field->var.name && !key_field_test->var.name) || + (!key_field->var.name && key_field_test->var.name)) + return false; + if ((key_field->var.name && key_field_test->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++) {