From: Jiri Olsa <jolsa@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: acme@ghostprotocols.net, a.p.zijlstra@chello.nl,
mingo@redhat.com, linux-kernel@vger.kernel.org, avi@redhat.com
Subject: Re: [PATCHv2] perf tools: Add 'G' and 'H' modifiers to event parsing
Date: Tue, 17 Apr 2012 13:25:00 +0200 [thread overview]
Message-ID: <20120417112500.GC1650@m.brq.redhat.com> (raw)
In-Reply-To: <20120417111345.GK11918@redhat.com>
On Tue, Apr 17, 2012 at 02:13:45PM +0300, Gleb Natapov wrote:
> 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>
thanks,
jirka
> 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]
>
> %%
> --
> Gleb.
next prev parent reply other threads:[~2012-04-17 11:25 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 [this message]
2012-04-17 14:35 ` Arnaldo Carvalho de Melo
2012-04-25 13:49 ` [tip:perf/urgent] " tip-bot for Gleb Natapov
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=20120417112500.GC1650@m.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.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.