From: Jiri Olsa <jolsa@redhat.com>
To: He Kuang <hekuang@huawei.com>
Cc: a.p.zijlstra@chello.nl, mingo@redhat.com, acme@kernel.org,
jolsa@kernel.org, kan.liang@intel.com, adrian.hunter@intel.com,
wangnan0@huawei.com, pi3orama@163.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/4] perf tools: Adds the tracepoint name parsing support
Date: Sun, 27 Sep 2015 22:33:34 +0200 [thread overview]
Message-ID: <20150927203334.GH24007@krava.redhat.com> (raw)
In-Reply-To: <1443179511-59238-3-git-send-email-hekuang@huawei.com>
On Fri, Sep 25, 2015 at 11:11:50AM +0000, He Kuang wrote:
> Adds rules for parsing tracepoint names. Change rules of tracepoint
> which derives of PE_NAMEs into tracepoint names directly, so adding
> more rules based on tracepoint names will be easier.
>
> Signed-off-by: He Kuang <hekuang@huawei.com>
> ---
> tools/perf/util/parse-events.y | 38 +++++++++++++++++++++++---------------
> 1 file changed, 23 insertions(+), 15 deletions(-)
>
> diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
> index 8bcc458..279c01c 100644
> --- a/tools/perf/util/parse-events.y
> +++ b/tools/perf/util/parse-events.y
> @@ -67,6 +67,7 @@ static inc_group_count(struct list_head *list,
> %type <head> event_legacy_cache
> %type <head> event_legacy_mem
> %type <head> event_legacy_tracepoint
> +%type <tracepoint_name> __event_legacy_tracepoint
> %type <head> event_legacy_numeric
> %type <head> event_legacy_raw
> %type <head> event_def
> @@ -84,6 +85,10 @@ static inc_group_count(struct list_head *list,
> u64 num;
> struct list_head *head;
> struct parse_events_term *term;
> + struct tracepoint_name{
> + char *sys;
> + char *event;
> + } tracepoint_name;
> }
> %%
>
> @@ -368,36 +373,39 @@ PE_PREFIX_MEM PE_VALUE sep_dc
> }
>
> event_legacy_tracepoint:
> -PE_NAME '-' PE_NAME ':' PE_NAME
> +__event_legacy_tracepoint
> {
> struct parse_events_evlist *data = _data;
> struct parse_events_error *error = data->error;
> struct list_head *list;
> - char sys_name[128];
> - snprintf(&sys_name, 128, "%s-%s", $1, $3);
>
> ALLOC_LIST(list);
> - if (parse_events_add_tracepoint(list, &data->idx, &sys_name, $5, error)) {
> + if (parse_events_add_tracepoint(list, &data->idx, $1.sys, $1.event,
> + error)) {
> if (error)
> error->idx = @1.first_column;
> return -1;
> }
> $$ = list;
> }
> +
> +__event_legacy_tracepoint:
how about the tracepoint_name label change?
thanks,
jirka
next prev parent reply other threads:[~2015-09-27 20:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-25 11:11 [PATCH v2 1/4] perf tools: Adds the config_term callback for different type events He Kuang
2015-09-25 11:11 ` [PATCH v2 2/4] perf tools: Prompt error message for wrong terms of hw/sw events He Kuang
2015-09-27 20:27 ` Jiri Olsa
2015-09-27 20:28 ` Jiri Olsa
2015-09-27 20:30 ` Jiri Olsa
2015-09-25 11:11 ` [PATCH v2 3/4] perf tools: Adds the tracepoint name parsing support He Kuang
2015-09-27 20:33 ` Jiri Olsa [this message]
2015-09-27 20:34 ` Jiri Olsa
2015-09-25 11:11 ` [PATCH v2 4/4] perf tools: Enable event_config terms to tracepoint events He Kuang
2015-09-27 20:41 ` Jiri Olsa
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=20150927203334.GH24007@krava.redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=hekuang@huawei.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pi3orama@163.com \
--cc=wangnan0@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.