lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120417112500.GC1650@m.brq.redhat.com>
Date:	Tue, 17 Apr 2012 13:25:00 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Gleb Natapov <gleb@...hat.com>
Cc:	acme@...stprotocols.net, a.p.zijlstra@...llo.nl, mingo@...hat.com,
	linux-kernel@...r.kernel.org, avi@...hat.com
Subject: Re: [PATCHv2] perf tools: Add 'G' and 'H' modifiers to event parsing

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@...hat.com>
Acked-by: Jiri Olsa <jolsa@...hat.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ