From: tip-bot for He Kuang <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, acme@redhat.com, hekuang@huawei.com,
kan.liang@intel.com, linux-kernel@vger.kernel.org,
mingo@kernel.org, a.p.zijlstra@chello.nl,
adrian.hunter@intel.com, jolsa@kernel.org, hpa@zytor.com,
wangnan0@huawei.com
Subject: [tip:perf/core] perf tools: Adds the tracepoint name parsing support
Date: Tue, 29 Sep 2015 01:50:26 -0700 [thread overview]
Message-ID: <tip-865582c3f48e12b7ab9e260161868313e4a37f44@git.kernel.org> (raw)
In-Reply-To: <1443412336-120050-3-git-send-email-hekuang@huawei.com>
Commit-ID: 865582c3f48e12b7ab9e260161868313e4a37f44
Gitweb: http://git.kernel.org/tip/865582c3f48e12b7ab9e260161868313e4a37f44
Author: He Kuang <hekuang@huawei.com>
AuthorDate: Mon, 28 Sep 2015 03:52:15 +0000
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 28 Sep 2015 17:29:38 -0300
perf tools: Adds the tracepoint name parsing support
Adds rules for parsing tracepoint names. Change rules of tracepoint which
derives from PE_NAMEs into tracepoint names directly, so adding more rules
based on tracepoint names will be easier.
Changes v2-v3:
- Change __event_legacy_tracepoint label in bison file to tracepoint_name
- Fix formats error.
Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1443412336-120050-3-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/parse-events.y | 37 +++++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 8bcc458..1c598c2 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> tracepoint_name
%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,40 @@ PE_PREFIX_MEM PE_VALUE sep_dc
}
event_legacy_tracepoint:
-PE_NAME '-' PE_NAME ':' PE_NAME
+tracepoint_name
{
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;
}
+
+tracepoint_name:
+PE_NAME '-' PE_NAME ':' PE_NAME
+{
+ char sys_name[128];
+ struct tracepoint_name tracepoint;
+
+ snprintf(&sys_name, 128, "%s-%s", $1, $3);
+ tracepoint.sys = &sys_name;
+ tracepoint.event = $5;
+
+ $$ = tracepoint;
+}
|
PE_NAME ':' PE_NAME
{
- struct parse_events_evlist *data = _data;
- struct parse_events_error *error = data->error;
- struct list_head *list;
+ struct tracepoint_name tracepoint = {$1, $3};
- ALLOC_LIST(list);
- if (parse_events_add_tracepoint(list, &data->idx, $1, $3, error)) {
- if (error)
- error->idx = @1.first_column;
- return -1;
- }
- $$ = list;
+ $$ = tracepoint;
}
event_legacy_numeric:
next prev parent reply other threads:[~2015-09-29 8:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 3:52 [PATCH v3 1/4] perf tools: Adds the config_term callback for different type events He Kuang
2015-09-28 3:52 ` [PATCH v3 2/4] perf tools: Prompt proper error message for wrong terms of hw/sw events He Kuang
2015-09-28 19:39 ` Jiri Olsa
2015-09-29 8:50 ` [tip:perf/core] perf tools: Show " tip-bot for He Kuang
2015-09-28 3:52 ` [PATCH v3 3/4] perf tools: Adds the tracepoint name parsing support He Kuang
2015-09-28 19:39 ` Jiri Olsa
2015-09-29 8:50 ` tip-bot for He Kuang [this message]
2015-09-28 3:52 ` [PATCH v3 4/4] perf tools: Enable event_config terms to tracepoint events He Kuang
2015-09-28 19:40 ` Jiri Olsa
2015-09-29 8:50 ` [tip:perf/core] " tip-bot for He Kuang
2015-09-28 19:39 ` [PATCH v3 1/4] perf tools: Adds the config_term callback for different type events Jiri Olsa
2015-09-28 20:32 ` Arnaldo Carvalho de Melo
2015-09-29 8:49 ` [tip:perf/core] " tip-bot for He Kuang
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=tip-865582c3f48e12b7ab9e260161868313e4a37f44@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=hekuang@huawei.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox