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>] [day] [month] [year] [list]
Message-ID: <tip-e3xzpx9cqsmwnaguaxyw6r42@git.kernel.org>
Date:	Sat, 20 Feb 2016 03:37:57 -0800
From:	tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	mingo@...nel.org, adrian.hunter@...el.com,
	linux-kernel@...r.kernel.org, jeremie.galarneau@...icios.com,
	dev@...yps.com, brendan.d.gregg@...il.com, acme@...hat.com,
	ast@...nel.org, masami.hiramatsu.pt@...achi.com,
	namhyung@...nel.org, peterz@...radead.org, hpa@...or.com,
	lizefan@...wei.com, tglx@...utronix.de, hekuang@...wei.com,
	kirr@...edi.com, jolsa@...nel.org
Subject: [tip:perf/core] perf tools:
  Introduce opt_event_config nonterminal

Commit-ID:  1d55e8ef340dad1ccd5aaf53071de41fc3d8dba4
Gitweb:     http://git.kernel.org/tip/1d55e8ef340dad1ccd5aaf53071de41fc3d8dba4
Author:     Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Fri, 19 Feb 2016 18:45:12 -0300
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 19 Feb 2016 19:12:50 -0300

perf tools: Introduce opt_event_config nonterminal

To remove duplicated code that differs only in using the matching
'/a,b,c/' part or NULL if no event configuration is done ('//' or no
pair of slashes at all).

Will be used by some new targets allowing the configuration of hardware
events, etc.

Lifted part of the 'opt_event_config' nonterminal from a patch by Wang
Nan.

Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Alexei Starovoitov <ast@...nel.org>
Cc: Brendan Gregg <brendan.d.gregg@...il.com>
Cc: Cody P Schafer <dev@...yps.com>
Cc: He Kuang <hekuang@...wei.com>
Cc: Jeremie Galarneau <jeremie.galarneau@...icios.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Kirill Smelkov <kirr@...edi.com>
Cc: Li Zefan <lizefan@...wei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Zefan Li <lizefan@...wei.com>
Cc: pi3orama@....com
Link: http://lkml.kernel.org/n/tip-e3xzpx9cqsmwnaguaxyw6r42@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/parse-events.y | 47 ++++++++++++++++--------------------------
 1 file changed, 18 insertions(+), 29 deletions(-)

diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index c0eac88..ce68746 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -64,6 +64,7 @@ static inc_group_count(struct list_head *list,
 %type <str> PE_PMU_EVENT_PRE PE_PMU_EVENT_SUF PE_KERNEL_PMU_EVENT
 %type <num> value_sym
 %type <head> event_config
+%type <head> opt_event_config
 %type <term> event_term
 %type <head> event_pmu
 %type <head> event_legacy_symbol
@@ -222,16 +223,6 @@ PE_NAME '/' event_config '/'
 	$$ = list;
 }
 |
-PE_NAME '/' '/'
-{
-	struct parse_events_evlist *data = _data;
-	struct list_head *list;
-
-	ALLOC_LIST(list);
-	ABORT_ON(parse_events_add_pmu(data, list, $1, NULL));
-	$$ = list;
-}
-|
 PE_KERNEL_PMU_EVENT sep_dc
 {
 	struct parse_events_evlist *data = _data;
@@ -378,7 +369,7 @@ PE_PREFIX_MEM PE_VALUE sep_dc
 }
 
 event_legacy_tracepoint:
-tracepoint_name
+tracepoint_name opt_event_config
 {
 	struct parse_events_evlist *data = _data;
 	struct parse_events_error *error = data->error;
@@ -389,24 +380,7 @@ tracepoint_name
 		error->idx = @1.first_column;
 
 	if (parse_events_add_tracepoint(list, &data->idx, $1.sys, $1.event,
-					error, NULL))
-		return -1;
-
-	$$ = list;
-}
-|
-tracepoint_name '/' event_config '/'
-{
-	struct parse_events_evlist *data = _data;
-	struct parse_events_error *error = data->error;
-	struct list_head *list;
-
-	ALLOC_LIST(list);
-	if (error)
-		error->idx = @1.first_column;
-
-	if (parse_events_add_tracepoint(list, &data->idx, $1.sys, $1.event,
-					error, $3))
+					error, $2))
 		return -1;
 
 	$$ = list;
@@ -476,6 +450,21 @@ PE_BPF_SOURCE
 	$$ = list;
 }
 
+opt_event_config:
+'/' event_config '/'
+{
+	$$ = $2;
+}
+|
+'/' '/'
+{
+	$$ = NULL;
+}
+|
+{
+	$$ = NULL;
+}
+
 start_terms: event_config
 {
 	struct parse_events_terms *data = _data;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ