Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305503
b: refs/heads/master
c: 08d2f76
h: refs/heads/master
i:
  305501: e3e31a1
  305499: 087bacd
  305495: 1300ecd
  305487: c72f232
  305471: 9d7e205
v: v3
  • Loading branch information
Jiri Olsa authored and Arnaldo Carvalho de Melo committed May 22, 2012
1 parent 66928f2 commit 844480a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b847cbdc6750bdea248ace75c1868f8ef57dcdf0
refs/heads/master: 08d2f762ac4af861b962e543fceab341f05c8886
1 change: 1 addition & 0 deletions trunk/tools/perf/util/parse-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ int parse_events(struct perf_evlist *evlist, const char *str, int unset __used)

parse_events__flush_buffer(buffer);
parse_events__delete_buffer(buffer);
parse_events_lex_destroy();

if (!ret) {
int entries = idx - evlist->nr_entries;
Expand Down
25 changes: 23 additions & 2 deletions trunk/tools/perf/util/parse-events.l
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

%option prefix="parse_events_"
%option stack

%{
#include <errno.h>
Expand Down Expand Up @@ -50,6 +51,8 @@ static int term(int type)

%}

%x mem

num_dec [0-9]+
num_hex 0x[a-fA-F0-9]+
num_raw_hex [a-fA-F0-9]+
Expand Down Expand Up @@ -105,20 +108,38 @@ config2 { return term(PARSE_EVENTS__TERM_TYPE_CONFIG2); }
period { return term(PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD); }
branch_type { return term(PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE); }

mem: { return PE_PREFIX_MEM; }
mem: { BEGIN(mem); return PE_PREFIX_MEM; }
r{num_raw_hex} { return raw(); }
{num_dec} { return value(10); }
{num_hex} { return value(16); }

{modifier_event} { return str(PE_MODIFIER_EVENT); }
{modifier_bp} { return str(PE_MODIFIER_BP); }
{name} { return str(PE_NAME); }
"/" { return '/'; }
- { return '-'; }
, { return ','; }
: { return ':'; }
= { return '='; }

<mem>{
{modifier_bp} { return str(PE_MODIFIER_BP); }
: { return ':'; }
{num_dec} { return value(10); }
{num_hex} { return value(16); }
/*
* We need to separate 'mem:' scanner part, in order to get specific
* modifier bits parsed out. Otherwise we would need to handle PE_NAME
* and we'd need to parse it manually. During the escape from <mem>
* state we need to put the escaping char back, so we dont miss it.
*/
. { unput(*parse_events_text); BEGIN(INITIAL); }
/*
* We destroy the scanner after reaching EOF,
* but anyway just to be sure get back to INIT state.
*/
<<EOF>> { BEGIN(INITIAL); }
}

%%

int parse_events_wrap(void)
Expand Down

0 comments on commit 844480a

Please sign in to comment.