Perf: Add legacy support for userspace tools
Perf used the "rs" and "rm" modifiers to access the L2CC and busmon PMU's on legacy systems. This modifies the parser to keep the backward compatibility alive till all tools progress to the new named PMU interfaces. Change-Id: I50dde4252ac949e9cbab7c62536c5fd49177896c Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
This commit is contained in:
parent
e9fa666b62
commit
6ac49fb976
|
@ -42,6 +42,22 @@ static int raw(yyscan_t scanner)
|
|||
return __value(yylval, text + 1, 16, PE_RAW);
|
||||
}
|
||||
|
||||
static int sh_raw(yyscan_t scanner)
|
||||
{
|
||||
YYSTYPE *yylval = parse_events_get_lval(scanner);
|
||||
char *text = parse_events_get_text(scanner);
|
||||
|
||||
return __value(yylval, text + 2, 16, PE_SH_RAW);
|
||||
}
|
||||
|
||||
static int fab_raw(yyscan_t scanner)
|
||||
{
|
||||
YYSTYPE *yylval = parse_events_get_lval(scanner);
|
||||
char *text = parse_events_get_text(scanner);
|
||||
|
||||
return __value(yylval, text + 2, 16, PE_FAB_RAW);
|
||||
}
|
||||
|
||||
static int str(yyscan_t scanner, int token)
|
||||
{
|
||||
YYSTYPE *yylval = parse_events_get_lval(scanner);
|
||||
|
@ -174,6 +190,8 @@ branch_type { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE
|
|||
|
||||
mem: { BEGIN(mem); return PE_PREFIX_MEM; }
|
||||
r{num_raw_hex} { return raw(yyscanner); }
|
||||
rs{num_raw_hex} { return sh_raw(yyscanner); }
|
||||
rm{num_raw_hex} { return fab_raw(yyscanner); }
|
||||
{num_dec} { return value(yyscanner, 10); }
|
||||
{num_hex} { return value(yyscanner, 16); }
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ static inc_group_count(struct list_head *list,
|
|||
|
||||
%token PE_START_EVENTS PE_START_TERMS
|
||||
%token PE_VALUE PE_VALUE_SYM_HW PE_VALUE_SYM_SW PE_RAW PE_TERM
|
||||
%token PE_SH_RAW PE_FAB_RAW
|
||||
%token PE_EVENT_NAME
|
||||
%token PE_NAME
|
||||
%token PE_MODIFIER_EVENT PE_MODIFIER_BP
|
||||
|
@ -44,6 +45,8 @@ static inc_group_count(struct list_head *list,
|
|||
%type <num> PE_VALUE_SYM_HW
|
||||
%type <num> PE_VALUE_SYM_SW
|
||||
%type <num> PE_RAW
|
||||
%type <num> PE_SH_RAW
|
||||
%type <num> PE_FAB_RAW
|
||||
%type <num> PE_TERM
|
||||
%type <str> PE_NAME
|
||||
%type <str> PE_NAME_CACHE_TYPE
|
||||
|
@ -61,6 +64,8 @@ static inc_group_count(struct list_head *list,
|
|||
%type <head> event_legacy_tracepoint
|
||||
%type <head> event_legacy_numeric
|
||||
%type <head> event_legacy_raw
|
||||
%type <head> event_legacy_shared_raw
|
||||
%type <head> event_legacy_fabric_raw
|
||||
%type <head> event_def
|
||||
%type <head> event_mod
|
||||
%type <head> event_name
|
||||
|
@ -190,7 +195,9 @@ event_def: event_pmu |
|
|||
event_legacy_mem |
|
||||
event_legacy_tracepoint sep_dc |
|
||||
event_legacy_numeric sep_dc |
|
||||
event_legacy_raw sep_dc
|
||||
event_legacy_raw sep_dc |
|
||||
event_legacy_shared_raw sep_dc |
|
||||
event_legacy_fabric_raw sep_dc
|
||||
|
||||
event_pmu:
|
||||
PE_NAME '/' event_config '/'
|
||||
|
@ -314,6 +321,28 @@ PE_RAW
|
|||
$$ = list;
|
||||
}
|
||||
|
||||
event_legacy_shared_raw:
|
||||
PE_SH_RAW
|
||||
{
|
||||
struct parse_events_evlist *data = _data;
|
||||
struct list_head *list = NULL;
|
||||
|
||||
ABORT_ON(parse_events_add_numeric(&list, &data->idx,
|
||||
6, $1, NULL));
|
||||
$$ = list;
|
||||
}
|
||||
|
||||
event_legacy_fabric_raw:
|
||||
PE_FAB_RAW
|
||||
{
|
||||
struct parse_events_evlist *data = _data;
|
||||
struct list_head *list = NULL;
|
||||
|
||||
ABORT_ON(parse_events_add_numeric(&list, &data->idx,
|
||||
7, $1, NULL));
|
||||
$$ = list;
|
||||
}
|
||||
|
||||
start_terms: event_config
|
||||
{
|
||||
struct parse_events_terms *data = _data;
|
||||
|
|
Loading…
Reference in New Issue