All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <jolsa@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org,
	eranian@google.com, paulus@samba.org, hpa@zytor.com,
	mingo@kernel.org, a.p.zijlstra@chello.nl, jolsa@redhat.com,
	fweisbec@gmail.com, tglx@linutronix.de,
	cjashfor@linux.vnet.ibm.com, mingo@elte.hu
Subject: [tip:perf/core] perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens
Date: Fri, 6 Jul 2012 04:24:33 -0700	[thread overview]
Message-ID: <tip-cf3506dcc4a855d11af20bcb271ac921033ba0de@git.kernel.org> (raw)
In-Reply-To: <1341352848-11833-6-git-send-email-jolsa@redhat.com>

Commit-ID:  cf3506dcc4a855d11af20bcb271ac921033ba0de
Gitweb:     http://git.kernel.org/tip/cf3506dcc4a855d11af20bcb271ac921033ba0de
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Wed, 4 Jul 2012 00:00:43 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 5 Jul 2012 11:29:56 -0300

perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens

Spliting PE_VALUE_SYM token to PE_VALUE_SYM_HW and PE_VALUE_SYM_SW
tokens to separate hardware and software symbols.

This will be useful in upcomming patch where we want to be able to parse
out only hardware events.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1341352848-11833-6-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.l |    2 +-
 tools/perf/util/parse-events.y |   15 +++++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index 6cbe092..384ca74 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -56,7 +56,7 @@ static int sym(yyscan_t scanner, int type, int config)
 	YYSTYPE *yylval = parse_events_get_lval(scanner);
 
 	yylval->num = (type << 16) + config;
-	return PE_VALUE_SYM;
+	return type == PERF_TYPE_HARDWARE ? PE_VALUE_SYM_HW : PE_VALUE_SYM_SW;
 }
 
 static int term(yyscan_t scanner, int type)
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 9525c45..2bc5fbf 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -26,14 +26,15 @@ do { \
 %}
 
 %token PE_START_EVENTS PE_START_TERMS
-%token PE_VALUE PE_VALUE_SYM PE_RAW PE_TERM
+%token PE_VALUE PE_VALUE_SYM_HW PE_VALUE_SYM_SW PE_RAW PE_TERM
 %token PE_NAME
 %token PE_MODIFIER_EVENT PE_MODIFIER_BP
 %token PE_NAME_CACHE_TYPE PE_NAME_CACHE_OP_RESULT
 %token PE_PREFIX_MEM PE_PREFIX_RAW
 %token PE_ERROR
 %type <num> PE_VALUE
-%type <num> PE_VALUE_SYM
+%type <num> PE_VALUE_SYM_HW
+%type <num> PE_VALUE_SYM_SW
 %type <num> PE_RAW
 %type <num> PE_TERM
 %type <str> PE_NAME
@@ -41,6 +42,7 @@ do { \
 %type <str> PE_NAME_CACHE_OP_RESULT
 %type <str> PE_MODIFIER_EVENT
 %type <str> PE_MODIFIER_BP
+%type <num> value_sym
 %type <head> event_config
 %type <term> event_term
 %type <head> event_pmu
@@ -109,8 +111,13 @@ PE_NAME '/' event_config '/'
 	$$ = list;
 }
 
+value_sym:
+PE_VALUE_SYM_HW
+|
+PE_VALUE_SYM_SW
+
 event_legacy_symbol:
-PE_VALUE_SYM '/' event_config '/'
+value_sym '/' event_config '/'
 {
 	struct parse_events_data__events *data = _data;
 	struct list_head *list = NULL;
@@ -123,7 +130,7 @@ PE_VALUE_SYM '/' event_config '/'
 	$$ = list;
 }
 |
-PE_VALUE_SYM sep_slash_dc
+value_sym sep_slash_dc
 {
 	struct parse_events_data__events *data = _data;
 	struct list_head *list = NULL;

  reply	other threads:[~2012-07-06 11:24 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03 22:00 [RFCv2 0/10] perf, tool: Allow to use hw events in PMU syntax Jiri Olsa
2012-07-03 22:00 ` [PATCH 01/10] perf, tool: Add empty rule for new line in event syntax parsing Jiri Olsa
2012-07-06 11:23   ` [tip:perf/core] perf tools: " tip-bot for Jiri Olsa
2012-07-03 22:00 ` [PATCH 02/10] perf, tool: Fix pmu object initialization Jiri Olsa
2012-07-04 10:30   ` Peter Zijlstra
2012-07-04 11:40     ` Jiri Olsa
2012-07-04 11:50       ` Peter Zijlstra
2012-07-05 14:28   ` Arnaldo Carvalho de Melo
2012-07-03 22:00 ` [PATCH 03/10] perf, tool: Properly free format data Jiri Olsa
2012-07-03 22:00 ` [PATCH 04/10] perf, x86: Making hardware events translations available in sysfs Jiri Olsa
2012-07-04 10:22   ` Peter Zijlstra
2012-07-04 10:38     ` Peter Zijlstra
2012-07-04 12:01       ` Jiri Olsa
2012-07-04 12:14         ` Peter Zijlstra
2012-07-04 16:35           ` Arnaldo Carvalho de Melo
2012-07-04 10:22   ` Peter Zijlstra
2012-07-04 10:24   ` Peter Zijlstra
2012-07-04 10:28     ` Peter Zijlstra
2012-07-04 12:00       ` Jiri Olsa
2012-07-03 22:00 ` [PATCH 05/10] perf, tool: Split out PE_VALUE_SYM parsing token to SW and HW tokens Jiri Olsa
2012-07-06 11:24   ` tip-bot for Jiri Olsa [this message]
2012-07-03 22:00 ` [PATCH 06/10] perf, tool: Split event symbols arrays to hw and sw parts Jiri Olsa
2012-07-06 11:25   ` [tip:perf/core] perf tools: " tip-bot for Jiri Olsa
2012-07-03 22:00 ` [PATCH 07/10] perf, tool: Add support to specify hw event as pmu event term Jiri Olsa
2012-07-04 10:39   ` Peter Zijlstra
2012-07-04 12:00     ` Jiri Olsa
2012-07-04 12:13       ` Peter Zijlstra
2012-07-06  1:08         ` Stephane Eranian
2012-07-09 13:03           ` Peter Zijlstra
2012-07-03 22:00 ` [PATCH 08/10] perf, tool: Add sysfs read file interface Jiri Olsa
2012-07-04 10:40   ` Peter Zijlstra
2012-07-03 22:00 ` [PATCH 09/10] perf, test: Use ARRAY_SIZE in parse events tests Jiri Olsa
2012-07-06 11:22   ` [tip:perf/core] perf " tip-bot for Jiri Olsa
2012-07-03 22:00 ` [PATCH 10/10] perf, test: Add automated tests for pmu sysfs translated events Jiri Olsa

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-cf3506dcc4a855d11af20bcb271ac921033ba0de@git.kernel.org \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --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 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.