Received: by 10.213.65.68 with SMTP id h4csp2474581imn; Mon, 2 Apr 2018 08:12:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+SLgsM4Gw+hRs6YGvGYl3iU0UyGk7x3Gv1GqqD01QMx7jtB+hSM0gxnRIb5FAQOkHT4I2t X-Received: by 10.98.89.200 with SMTP id k69mr7756497pfj.100.1522681934531; Mon, 02 Apr 2018 08:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522681934; cv=none; d=google.com; s=arc-20160816; b=Vvk5wUEDTnPt+TNEeYJnyUbopXB3vUlc65oUoEdQTTeLlfeSymOrq9qGRPwzfSDxf9 gyj1GA4SzFb2CvrcB7jiHZt/YHhIuzdls2WXGSIBBsbZK7LN06Q06wnasrol7b0Olbvy 7d6sOtAkp7v1ulPWN+LFomH1aFQ/rTdLsSdKQsIIOeCJEOt4DfOtHlgWj/t9hcjr2Pua BwIrjgHALJq6wXvCXl2chjAYHtdjlmZRohJXRXGfoJYwn5OCusgECo9BkOxpxfsCszU8 YTHzznfyhTxIXONVPaDOhqegH0WQMTWRAbtUFQmVtp2ieqYtSGuHXERcd30uaT9H3KpE /zVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=aYmI8eSvimkeVn9ONFjoGNoKoiz0SptdoDq9jXeLi2I=; b=z6c1m8rwnQplq9LMRbCTWzWOjoImfUppg1rHngDP3o2T6p22PzotzG3vuebT3/EBM5 hlmIRkYPjcHbV5FrR5dKSRy31zowRF63WjXZE6t245iOZHAVGnyqzZcg8aw5+0GY3nGQ F9Xu4l0t+NFRlmnySZh+bLcCVl8gKLt4cG8BhenzAORzLVnc1smZd0+YgQ8Ryzi1U2CG DDyyz1qIT1PfALD5e2okRmkvXiJ7cthFGvdnJJNXC8qFGP+XQcLxNeNl5rBHdJDOsJ2B T6HCmrVpnMXGx7uxAz47daAxd68dMaQ6L7+XTEOTqWsK0v9ymwpmsacHxFTb+vpSFq3e CTHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k80si393469pfh.137.2018.04.02.08.12.00; Mon, 02 Apr 2018 08:12:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752753AbeDBPKd (ORCPT + 99 others); Mon, 2 Apr 2018 11:10:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:60716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281AbeDBPKa (ORCPT ); Mon, 2 Apr 2018 11:10:30 -0400 Received: from devbox (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7837720838; Mon, 2 Apr 2018 15:10:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7837720838 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mhiramat@kernel.org Date: Tue, 3 Apr 2018 00:10:25 +0900 From: Masami Hiramatsu To: Tom Zanussi Cc: rostedt@goodmis.org, 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 Subject: Re: [PATCH 3/4] tracing: Add action comparisons when testing matching hist triggers Message-Id: <20180403001025.6dfed9403d50d20104e54458@kernel.org> In-Reply-To: References: X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Mar 2018 15:10:55 -0500 Tom Zanussi wrote: > Actions also need to be considered when checking for matching triggers > - triggers differing only by action should be allowed, but currently > aren't because the matching check ignores the action and erroneously > returns -EEXIST. Hi Tom, Could you show us the bad/good examples (maybe different onmatch() actions)? And if it is real bugfix, I would like to add a ftracetest testcase for this fix. Thank you, > > Add and call an actions_match() function to address that. > > Signed-off-by: Tom Zanussi > --- > kernel/trace/trace_events_hist.c | 50 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 50 insertions(+) > > diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c > index 468e43f..ae84470 100644 > --- a/kernel/trace/trace_events_hist.c > +++ b/kernel/trace/trace_events_hist.c > @@ -4363,6 +4363,53 @@ static void print_onmatch_spec(struct seq_file *m, > seq_puts(m, ")"); > } > > +static bool actions_match(struct hist_trigger_data *hist_data, > + struct hist_trigger_data *hist_data_test) > +{ > + unsigned int i, j; > + > + if (hist_data->n_actions != hist_data_test->n_actions) > + return false; > + > + for (i = 0; i < hist_data->n_actions; i++) { > + struct action_data *data = hist_data->actions[i]; > + struct action_data *data_test = hist_data_test->actions[i]; > + > + if (data->fn != data_test->fn) > + return false; > + > + if (data->n_params != data_test->n_params) > + return false; > + > + for (j = 0; j < data->n_params; j++) { > + if (strcmp(data->params[j], data_test->params[j]) != 0) > + return false; > + } > + > + if (data->fn == action_trace) { > + if (strcmp(data->onmatch.synth_event_name, > + data_test->onmatch.synth_event_name) != 0) > + return false; > + if (strcmp(data->onmatch.match_event_system, > + data_test->onmatch.match_event_system) != 0) > + return false; > + if (strcmp(data->onmatch.match_event, > + data_test->onmatch.match_event) != 0) > + return false; > + } else if (data->fn == onmax_save) { > + if (strcmp(data->onmax.var_str, > + data_test->onmax.var_str) != 0) > + return false; > + if (strcmp(data->onmax.fn_name, > + data_test->onmax.fn_name) != 0) > + return false; > + } > + } > + > + return true; > +} > + > + > static void print_actions_spec(struct seq_file *m, > struct hist_trigger_data *hist_data) > { > @@ -5173,6 +5220,9 @@ static bool hist_trigger_match(struct event_trigger_data *data, > (strcmp(data->filter_str, data_test->filter_str) != 0)) > return false; > > + if (!actions_match(hist_data, hist_data_test)) > + return false; > + > return true; > } > > -- > 1.9.3 > -- Masami Hiramatsu