Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338883
b: refs/heads/master
c: 1d33d6d
h: refs/heads/master
i:
  338881: cfafc34
  338879: e7b0dad
v: v3
  • Loading branch information
Jiri Olsa authored and Ingo Molnar committed Oct 24, 2012
1 parent 9c62d48 commit 545136e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3fded963cdae12ff891a55efc866437506c3f912
refs/heads/master: 1d33d6dce11e2c900daeca8110d56b95f1174188
18 changes: 18 additions & 0 deletions trunk/tools/perf/util/parse-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,24 @@ int parse_events__term_str(struct parse_events__term **term,
config, str, 0);
}

int parse_events__term_sym_hw(struct parse_events__term **term,
char *config, unsigned idx)
{
struct event_symbol *sym;

BUG_ON(idx >= PERF_COUNT_HW_MAX);
sym = &event_symbols_hw[idx];

if (config)
return new_term(term, PARSE_EVENTS__TERM_TYPE_STR,
PARSE_EVENTS__TERM_TYPE_USER, config,
(char *) sym->symbol, 0);
else
return new_term(term, PARSE_EVENTS__TERM_TYPE_STR,
PARSE_EVENTS__TERM_TYPE_USER,
(char *) "event", (char *) sym->symbol, 0);
}

int parse_events__term_clone(struct parse_events__term **new,
struct parse_events__term *term)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/tools/perf/util/parse-events.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ int parse_events__term_num(struct parse_events__term **_term,
int type_term, char *config, u64 num);
int parse_events__term_str(struct parse_events__term **_term,
int type_term, char *config, char *str);
int parse_events__term_sym_hw(struct parse_events__term **term,
char *config, unsigned idx);
int parse_events__term_clone(struct parse_events__term **new,
struct parse_events__term *term);
void parse_events__free_terms(struct list_head *terms);
Expand Down
18 changes: 18 additions & 0 deletions trunk/tools/perf/util/parse-events.y
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,15 @@ PE_NAME '=' PE_VALUE
$$ = term;
}
|
PE_NAME '=' PE_VALUE_SYM_HW
{
struct parse_events__term *term;
int config = $3 & 255;

ABORT_ON(parse_events__term_sym_hw(&term, $1, config));
$$ = term;
}
|
PE_NAME
{
struct parse_events__term *term;
Expand All @@ -361,6 +370,15 @@ PE_NAME
$$ = term;
}
|
PE_VALUE_SYM_HW
{
struct parse_events__term *term;
int config = $1 & 255;

ABORT_ON(parse_events__term_sym_hw(&term, NULL, config));
$$ = term;
}
|
PE_TERM '=' PE_NAME
{
struct parse_events__term *term;
Expand Down

0 comments on commit 545136e

Please sign in to comment.