From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751477AbdCOMDp (ORCPT ); Wed, 15 Mar 2017 08:03:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59344 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbdCOMDg (ORCPT ); Wed, 15 Mar 2017 08:03:36 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 574AD4E047 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 574AD4E047 Date: Wed, 15 Mar 2017 13:03:31 +0100 From: Jiri Olsa To: Ravi Bangoria Cc: mingo@redhat.com, acme@kernel.org, mhiramat@kernel.org, brendan.d.gregg@gmail.com, peterz@infradead.org, alexander.shishkin@linux.intel.com, wangnan0@huawei.com, jolsa@kernel.org, ak@linux.intel.com, treeze.taeung@gmail.com, mathieu.poirier@linaro.org, hekuang@huawei.com, sukadev@linux.vnet.ibm.com, ananth@in.ibm.com, naveen.n.rao@linux.vnet.ibm.com, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, hemant@linux.vnet.ibm.com Subject: Re: [PATCH v5 3/7] perf/sdt: Directly record SDT events with 'perf record' Message-ID: <20170315120331.GC18147@krava> References: <20170314150658.7065-1-ravi.bangoria@linux.vnet.ibm.com> <20170314150658.7065-4-ravi.bangoria@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170314150658.7065-4-ravi.bangoria@linux.vnet.ibm.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 15 Mar 2017 12:03:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 14, 2017 at 08:36:54PM +0530, Ravi Bangoria wrote: SNIP > --- > tools/perf/builtin-record.c | 27 ++++++- > tools/perf/util/parse-events.c | 60 +++++++++++++++ > tools/perf/util/parse-events.h | 3 + > tools/perf/util/probe-event.c | 165 ++++++++++++++++++++++++++++++++++++++++- > tools/perf/util/probe-event.h | 12 +++ > 5 files changed, 261 insertions(+), 6 deletions(-) > > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > index bc84a37..e8e1f73 100644 > --- a/tools/perf/builtin-record.c > +++ b/tools/perf/builtin-record.c > @@ -73,6 +73,7 @@ struct record { > bool timestamp_filename; > struct switch_output switch_output; > unsigned long long samples; > + struct list_head sdt_event_list; > }; > > static volatile int auxtrace_record__snapshot_started; > @@ -1503,6 +1504,23 @@ static struct record record = { > }, > }; > > +static int record__parse_events_option(const struct option *opt, > + const char *str, > + int unset) > +{ > + if (is_sdt_event((char *) str)) > + return parse_sdt_events_option(opt, str, unset); > + else > + return parse_events_option(opt, str, unset); so what happens if there're more than one event in 'str' like: -e cycles,std_... would it be better to plug this directly into parse-events.y parser.. and handle it like any other event type? thanks, jirka