From: tip-bot for Gleb Natapov <gleb@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, mingo@redhat.com,
hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl,
jolsa@redhat.com, gleb@redhat.com, tglx@linutronix.de,
avi@redhat.com
Subject: [tip:perf/urgent] perf tools: Add 'G' and 'H' modifiers to event parsing
Date: Wed, 25 Apr 2012 06:49:10 -0700 [thread overview]
Message-ID: <tip-e7c72d888dac2c81003401d663bd8abd68e7c5cd@git.kernel.org> (raw)
In-Reply-To: <20120417111345.GK11918@redhat.com>
Commit-ID: e7c72d888dac2c81003401d663bd8abd68e7c5cd
Gitweb: http://git.kernel.org/tip/e7c72d888dac2c81003401d663bd8abd68e7c5cd
Author: Gleb Natapov <gleb@redhat.com>
AuthorDate: Tue, 17 Apr 2012 14:13:45 +0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 17 Apr 2012 11:20:23 -0300
perf tools: Add 'G' and 'H' modifiers to event parsing
They were dropped during conversion of event parser. Add test case to
make sure this will not happen again.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20120417111345.GK11918@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-test.c | 30 ++++++++++++++++++++++++++++++
tools/perf/util/parse-events.l | 2 +-
2 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index 1c5b980..223ffdc 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -851,6 +851,28 @@ static int test__checkevent_symbolic_name_modifier(struct perf_evlist *evlist)
return test__checkevent_symbolic_name(evlist);
}
+static int test__checkevent_exclude_host_modifier(struct perf_evlist *evlist)
+{
+ struct perf_evsel *evsel = list_entry(evlist->entries.next,
+ struct perf_evsel, node);
+
+ TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest);
+ TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host);
+
+ return test__checkevent_symbolic_name(evlist);
+}
+
+static int test__checkevent_exclude_guest_modifier(struct perf_evlist *evlist)
+{
+ struct perf_evsel *evsel = list_entry(evlist->entries.next,
+ struct perf_evsel, node);
+
+ TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest);
+ TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host);
+
+ return test__checkevent_symbolic_name(evlist);
+}
+
static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist)
{
struct perf_evsel *evsel = list_entry(evlist->entries.next,
@@ -1091,6 +1113,14 @@ static struct test__event_st {
.name = "r1,syscalls:sys_enter_open:k,1:1:hp",
.check = test__checkevent_list,
},
+ {
+ .name = "instructions:G",
+ .check = test__checkevent_exclude_host_modifier,
+ },
+ {
+ .name = "instructions:H",
+ .check = test__checkevent_exclude_guest_modifier,
+ },
};
#define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st))
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index 05d766e..1fcf1bb 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -54,7 +54,7 @@ num_dec [0-9]+
num_hex 0x[a-fA-F0-9]+
num_raw_hex [a-fA-F0-9]+
name [a-zA-Z_*?][a-zA-Z0-9_*?]*
-modifier_event [ukhp]{1,5}
+modifier_event [ukhpGH]{1,8}
modifier_bp [rwx]
%%
prev parent reply other threads:[~2012-04-25 13:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 11:13 [PATCHv2] perf tools: Add 'G' and 'H' modifiers to event parsing Gleb Natapov
2012-04-17 11:25 ` Jiri Olsa
2012-04-17 14:35 ` Arnaldo Carvalho de Melo
2012-04-25 13:49 ` tip-bot for Gleb Natapov [this message]
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-e7c72d888dac2c81003401d663bd8abd68e7c5cd@git.kernel.org \
--to=gleb@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=avi@redhat.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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