diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-03-15 20:09:16 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-03-16 14:26:06 -0300 |
commit | 8f707d843c2f4023490a873dbc182f632a3a5906 (patch) | |
tree | e4c6d509756aa869314888de0d5873c4a20a7e92 /tools | |
parent | 89812fc81f8d62d70433a8ff63d26819f372e8ec (diff) |
perf tools: Add config options support for event parsing
Adding a new rule to the event grammar to be able to specify
values of additional attributes of symbolic event.
The new syntax for event symbolic definition is:
event_legacy_symbol: PE_NAME_SYM '/' event_config '/' |
PE_NAME_SYM sep_slash_dc
event_config: event_config ',' event_term | event_term
event_term: PE_NAME '=' PE_NAME |
PE_NAME '=' PE_VALUE
PE_NAME
sep_slash_dc: '/' | ':' |
At the moment the config options are hardcoded to be used for legacy
symbol events to define several perf_event_attr fields. It is:
'config' to define perf_event_attr::config
'config1' to define perf_event_attr::config1
'config2' to define perf_event_attr::config2
'period' to define perf_event_attr::sample_period
Legacy events could be now specified as:
cycles/period=100000/
If term is specified without the value assignment, then 1 is
assigned by default.
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-mgkavww9790jbt2jdkooyv4q@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-test.c | 22 | ||||
-rw-r--r-- | tools/perf/util/parse-events-bison.c | 310 | ||||
-rw-r--r-- | tools/perf/util/parse-events-bison.h | 23 | ||||
-rw-r--r-- | tools/perf/util/parse-events-flex.c | 713 | ||||
-rw-r--r-- | tools/perf/util/parse-events-flex.h | 2 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 99 | ||||
-rw-r--r-- | tools/perf/util/parse-events.h | 31 | ||||
-rw-r--r-- | tools/perf/util/parse-events.l | 19 | ||||
-rw-r--r-- | tools/perf/util/parse-events.y | 94 |
9 files changed, 866 insertions, 447 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c index 844c53a49a5a..8b5359506505 100644 --- a/tools/perf/builtin-test.c +++ b/tools/perf/builtin-test.c @@ -677,6 +677,24 @@ static int test__checkevent_symbolic_name(struct perf_evlist *evlist) return 0; } +static int test__checkevent_symbolic_name_config(struct perf_evlist *evlist) +{ + struct perf_evsel *evsel = list_entry(evlist->entries.next, + struct perf_evsel, node); + + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); + TEST_ASSERT_VAL("wrong config", + PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); + TEST_ASSERT_VAL("wrong period", + 100000 == evsel->attr.sample_period); + TEST_ASSERT_VAL("wrong config1", + 0 == evsel->attr.config1); + TEST_ASSERT_VAL("wrong config2", + 1 == evsel->attr.config2); + return 0; +} + static int test__checkevent_symbolic_alias(struct perf_evlist *evlist) { struct perf_evsel *evsel = list_entry(evlist->entries.next, @@ -884,6 +902,10 @@ static struct test__event_st { .check = test__checkevent_symbolic_name, }, { + .name = "cycles/period=100000,config2/", + .check = test__checkevent_symbolic_name_config, + }, + { .name = "faults", .check = test__checkevent_symbolic_alias, }, diff --git a/tools/perf/util/parse-events-bison.c b/tools/perf/util/parse-events-bison.c index 20fca2635664..ace593a25182 100644 --- a/tools/perf/util/parse-events-bison.c +++ b/tools/perf/util/parse-events-bison.c @@ -127,14 +127,15 @@ do { \ PE_VALUE = 258, PE_VALUE_SYM = 259, PE_RAW = 260, - PE_NAME = 261, - PE_MODIFIER_EVENT = 262, - PE_MODIFIER_BP = 263, - PE_NAME_CACHE_TYPE = 264, - PE_NAME_CACHE_OP_RESULT = 265, - PE_PREFIX_MEM = 266, - PE_PREFIX_RAW = 267, - PE_ERROR = 268 + PE_TERM = 261, + PE_NAME = 262, + PE_MODIFIER_EVENT = 263, + PE_MODIFIER_BP = 264, + PE_NAME_CACHE_TYPE = 265, + PE_NAME_CACHE_OP_RESULT = 266, + PE_PREFIX_MEM = 267, + PE_PREFIX_RAW = 268, + PE_ERROR = 269 }; #endif @@ -145,15 +146,17 @@ typedef union YYSTYPE { /* Line 214 of yacc.c */ -#line 42 "util/parse-events.y" +#line 45 "util/parse-events.y" char *str; unsigned long num; + struct list_head *head; + struct parse_events__term *term; /* Line 214 of yacc.c */ -#line 157 "util/parse-events-bison.c" +#line 160 "util/parse-events-bison.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -165,7 +168,7 @@ typedef union YYSTYPE /* Line 264 of yacc.c */ -#line 169 "util/parse-events-bison.c" +#line 172 "util/parse-events-bison.c" #ifdef short # undef short @@ -378,22 +381,22 @@ union yyalloc #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 20 +#define YYFINAL 23 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 27 +#define YYLAST 38 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 17 +#define YYNTOKENS 20 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 11 +#define YYNNTS 14 /* YYNRULES -- Number of rules. */ -#define YYNRULES 22 +#define YYNRULES 33 /* YYNRULES -- Number of states. */ -#define YYNSTATES 39 +#define YYNSTATES 53 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 268 +#define YYMAXUTOK 269 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -405,9 +408,9 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 14, 15, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 16, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 15, 17, 2, 16, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 18, 2, + 2, 19, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -427,7 +430,7 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13 + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; #if YYDEBUG @@ -435,29 +438,34 @@ static const yytype_uint8 yytranslate[] = YYRHS. */ static const yytype_uint8 yyprhs[] = { - 0, 0, 3, 7, 9, 12, 14, 17, 20, 22, - 25, 28, 31, 33, 39, 43, 45, 51, 55, 59, - 63, 65, 67 + 0, 0, 3, 7, 9, 12, 14, 16, 19, 21, + 24, 27, 30, 35, 38, 44, 48, 50, 56, 60, + 64, 68, 70, 74, 76, 80, 84, 86, 90, 92, + 94, 95, 97, 99 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 18, 0, -1, 18, 14, 19, -1, 19, -1, 20, - 7, -1, 20, -1, 21, 27, -1, 22, 27, -1, - 23, -1, 24, 27, -1, 25, 27, -1, 26, 27, - -1, 4, -1, 9, 15, 10, 15, 10, -1, 9, - 15, 10, -1, 9, -1, 11, 3, 16, 8, 27, - -1, 11, 3, 27, -1, 6, 16, 6, -1, 3, - 16, 3, -1, 5, -1, 16, -1, -1 + 21, 0, -1, 21, 15, 22, -1, 22, -1, 23, + 8, -1, 23, -1, 24, -1, 25, 32, -1, 26, + -1, 27, 32, -1, 28, 32, -1, 29, 32, -1, + 4, 16, 30, 16, -1, 4, 33, -1, 10, 17, + 11, 17, 11, -1, 10, 17, 11, -1, 10, -1, + 12, 3, 18, 9, 32, -1, 12, 3, 32, -1, + 7, 18, 7, -1, 3, 18, 3, -1, 5, -1, + 30, 15, 31, -1, 31, -1, 7, 19, 7, -1, + 7, 19, 3, -1, 7, -1, 6, 19, 3, -1, + 6, -1, 18, -1, -1, 16, -1, 18, -1, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 49, 49, 49, 52, 57, 59, 60, 61, 62, - 63, 64, 67, 76, 81, 86, 92, 97, 103, 109, - 115, 120, 120 + 0, 54, 54, 54, 57, 62, 64, 65, 66, 67, + 68, 69, 72, 81, 90, 95, 100, 106, 111, 117, + 123, 129, 135, 145, 157, 166, 175, 184, 192, 200, + 200, 202, 202, 202 }; #endif @@ -467,12 +475,13 @@ static const yytype_uint8 yyrline[] = static const char *const yytname[] = { "$end", "error", "$undefined", "PE_VALUE", "PE_VALUE_SYM", "PE_RAW", - "PE_NAME", "PE_MODIFIER_EVENT", "PE_MODIFIER_BP", "PE_NAME_CACHE_TYPE", - "PE_NAME_CACHE_OP_RESULT", "PE_PREFIX_MEM", "PE_PREFIX_RAW", "PE_ERROR", - "','", "'-'", "':'", "$accept", "events", "event", "event_def", - "event_legacy_symbol", "event_legacy_cache", "event_legacy_mem", - "event_legacy_tracepoint", "event_legacy_numeric", "event_legacy_raw", - "sep_dc", 0 + "PE_TERM", "PE_NAME", "PE_MODIFIER_EVENT", "PE_MODIFIER_BP", + "PE_NAME_CACHE_TYPE", "PE_NAME_CACHE_OP_RESULT", "PE_PREFIX_MEM", + "PE_PREFIX_RAW", "PE_ERROR", "','", "'/'", "'-'", "':'", "'='", + "$accept", "events", "event", "event_def", "event_legacy_symbol", + "event_legacy_cache", "event_legacy_mem", "event_legacy_tracepoint", + "event_legacy_numeric", "event_legacy_raw", "event_config", "event_term", + "sep_dc", "sep_slash_dc", 0 }; #endif @@ -482,24 +491,26 @@ static const char *const yytname[] = static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 44, 45, 58 + 265, 266, 267, 268, 269, 44, 47, 45, 58, 61 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 17, 18, 18, 19, 19, 20, 20, 20, 20, - 20, 20, 21, 22, 22, 22, 23, 23, 24, 25, - 26, 27, 27 + 0, 20, 21, 21, 22, 22, 23, 23, 23, 23, + 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, + 28, 29, 30, 30, 31, 31, 31, 31, 31, 32, + 32, 33, 33, 33 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 3, 1, 2, 1, 2, 2, 1, 2, - 2, 2, 1, 5, 3, 1, 5, 3, 3, 3, - 1, 1, 0 + 0, 2, 3, 1, 2, 1, 1, 2, 1, 2, + 2, 2, 4, 2, 5, 3, 1, 5, 3, 3, + 3, 1, 3, 1, 3, 3, 1, 3, 1, 1, + 0, 1, 1, 0 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -507,35 +518,39 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 12, 20, 0, 15, 0, 0, 3, 5, - 22, 22, 8, 22, 22, 22, 0, 0, 0, 22, - 1, 0, 4, 21, 6, 7, 9, 10, 11, 19, - 18, 14, 21, 17, 2, 0, 22, 13, 16 + 0, 0, 33, 21, 0, 16, 0, 0, 3, 5, + 6, 30, 8, 30, 30, 30, 0, 31, 32, 13, + 0, 0, 30, 1, 0, 4, 29, 7, 9, 10, + 11, 20, 28, 26, 0, 23, 19, 15, 29, 18, + 2, 0, 0, 0, 12, 0, 30, 27, 25, 24, + 22, 14, 17 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 24 + 34, 35, 27, 19 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -12 +#define YYPACT_NINF -14 static const yytype_int8 yypact[] = { - 7, -10, -12, -12, -9, -6, 2, 1, -12, 10, - -2, -2, -12, -2, -2, -2, 16, 14, 11, 6, - -12, 7, -12, -12, -12, -12, -12, -12, -12, -12, - -12, 8, 18, -12, -12, 17, -2, -12, -12 + 1, -11, -1, -14, -6, 8, 20, 3, -14, 16, + -14, -2, -14, -2, -2, -2, 23, 13, -14, -14, + 21, 18, 9, -14, 1, -14, -14, -14, -14, -14, + -14, -14, 11, 12, 6, -14, -14, 15, 25, -14, + -14, 32, 7, 13, -14, 26, -2, -14, -14, -14, + -14, -14, -14 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -12, -12, 3, -12, -12, -12, -12, -12, -12, -12, - -11 + -14, -14, 14, -14, -14, -14, -14, -14, -14, -14, + -14, -7, -13, -14 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -545,26 +560,30 @@ static const yytype_int8 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 25, 20, 26, 27, 28, 19, 16, 17, 33, 18, - 1, 2, 3, 4, 23, 21, 5, 22, 6, 29, - 30, 31, 32, 35, 34, 38, 36, 37 + 28, 29, 30, 23, 1, 2, 3, 16, 4, 39, + 48, 5, 20, 6, 49, 17, 26, 18, 24, 32, + 33, 43, 44, 22, 25, 21, 31, 38, 36, 37, + 41, 42, 45, 52, 46, 47, 50, 51, 40 }; static const yytype_uint8 yycheck[] = { - 11, 0, 13, 14, 15, 3, 16, 16, 19, 15, - 3, 4, 5, 6, 16, 14, 9, 7, 11, 3, - 6, 10, 16, 15, 21, 36, 8, 10 + 13, 14, 15, 0, 3, 4, 5, 18, 7, 22, + 3, 10, 18, 12, 7, 16, 18, 18, 15, 6, + 7, 15, 16, 3, 8, 17, 3, 18, 7, 11, + 19, 19, 17, 46, 9, 3, 43, 11, 24 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 3, 4, 5, 6, 9, 11, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 16, 16, 15, 3, - 0, 14, 7, 16, 27, 27, 27, 27, 27, 3, - 6, 10, 16, 27, 19, 15, 8, 10, 27 + 0, 3, 4, 5, 7, 10, 12, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 18, 16, 18, 33, + 18, 17, 3, 0, 15, 8, 18, 32, 32, 32, + 32, 3, 6, 7, 30, 31, 7, 11, 18, 32, + 22, 19, 19, 15, 16, 17, 9, 3, 3, 7, + 31, 11, 32 }; #define yyerrok (yyerrstatus = 0) @@ -1400,7 +1419,7 @@ yyreduce: case 4: /* Line 1464 of yacc.c */ -#line 53 "util/parse-events.y" +#line 58 "util/parse-events.y" { ABORT_ON(parse_events_modifier(list, (yyvsp[(2) - (2)].str))); ;} @@ -1409,91 +1428,196 @@ yyreduce: case 12: /* Line 1464 of yacc.c */ -#line 68 "util/parse-events.y" +#line 73 "util/parse-events.y" { - int type = (yyvsp[(1) - (1)].num) >> 16; - int config = (yyvsp[(1) - (1)].num) & 255; + int type = (yyvsp[(1) - (4)].num) >> 16; + int config = (yyvsp[(1) - (4)].num) & 255; - ABORT_ON(parse_events_add_numeric(list, idx, type, config)); + ABORT_ON(parse_events_add_numeric(list, idx, type, config, (yyvsp[(3) - (4)].head))); + parse_events__free_terms((yyvsp[(3) - (4)].head)); ;} break; case 13: /* Line 1464 of yacc.c */ -#line 77 "util/parse-events.y" +#line 82 "util/parse-events.y" { - ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (5)].str), (yyvsp[(3) - (5)].str), (yyvsp[(5) - (5)].str))); + int type = (yyvsp[(1) - (2)].num) >> 16; + int config = (yyvsp[(1) - (2)].num) & 255; + + ABORT_ON(parse_events_add_numeric(list, idx, type, config, NULL)); ;} break; case 14: /* Line 1464 of yacc.c */ -#line 82 "util/parse-events.y" +#line 91 "util/parse-events.y" { - ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str), NULL)); + ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (5)].str), (yyvsp[(3) - (5)].str), (yyvsp[(5) - (5)].str))); ;} break; case 15: /* Line 1464 of yacc.c */ -#line 87 "util/parse-events.y" +#line 96 "util/parse-events.y" { - ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (1)].str), NULL, NULL)); + ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str), NULL)); ;} break; case 16: /* Line 1464 of yacc.c */ -#line 93 "util/parse-events.y" +#line 101 "util/parse-events.y" { - ABORT_ON(parse_events_add_breakpoint(list, idx, (void *) (yyvsp[(2) - (5)].num), (yyvsp[(4) - (5)].str))); + ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (1)].str), NULL, NULL)); ;} break; case 17: /* Line 1464 of yacc.c */ -#line 98 "util/parse-events.y" +#line 107 "util/parse-events.y" { - ABORT_ON(parse_events_add_breakpoint(list, idx, (void *) (yyvsp[(2) - (3)].num), NULL)); + ABORT_ON(parse_events_add_breakpoint(list, idx, (void *) (yyvsp[(2) - (5)].num), (yyvsp[(4) - (5)].str))); ;} break; case 18: /* Line 1464 of yacc.c */ -#line 104 "util/parse-events.y" +#line 112 "util/parse-events.y" { - ABORT_ON(parse_events_add_tracepoint(list, idx, (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str))); + ABORT_ON(parse_events_add_breakpoint(list, idx, (void *) (yyvsp[(2) - (3)].num), NULL)); ;} break; case 19: /* Line 1464 of yacc.c */ -#line 110 "util/parse-events.y" +#line 118 "util/parse-events.y" { - ABORT_ON(parse_events_add_numeric(list, idx, (yyvsp[(1) - (3)].num), (yyvsp[(3) - (3)].num))); + ABORT_ON(parse_events_add_tracepoint(list, idx, (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str))); ;} break; case 20: /* Line 1464 of yacc.c */ -#line 116 "util/parse-events.y" +#line 124 "util/parse-events.y" + { + ABORT_ON(parse_events_add_numeric(list, idx, (yyvsp[(1) - (3)].num), (yyvsp[(3) - (3)].num), NULL)); +;} + break; + + case 21: + +/* Line 1464 of yacc.c */ +#line 130 "util/parse-events.y" + { + ABORT_ON(parse_events_add_numeric(list, idx, PERF_TYPE_RAW, (yyvsp[(1) - (1)].num), NULL)); +;} + break; + + case 22: + +/* Line 1464 of yacc.c */ +#line 136 "util/parse-events.y" { - ABORT_ON(parse_events_add_numeric(list, idx, PERF_TYPE_RAW, (yyvsp[(1) - (1)].num))); + struct list_head *head = (yyvsp[(1) - (3)].head); + struct parse_events__term *term = (yyvsp[(3) - (3)].term); + + ABORT_ON(!head); + list_add_tail(&term->list, head); + (yyval.head) = (yyvsp[(1) - (3)].head); +;} + break; + + case 23: + +/* Line 1464 of yacc.c */ +#line 146 "util/parse-events.y" + { + struct list_head *head = malloc(sizeof(*head)); + struct parse_events__term *term = (yyvsp[(1) - (1)].term); + + ABORT_ON(!head); + INIT_LIST_HEAD(head); + list_add_tail(&term->list, head); + (yyval.head) = head; +;} + break; + + case 24: + +/* Line 1464 of yacc.c */ +#line 158 "util/parse-events.y" + { + struct parse_events__term *term; + + ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_STR, + (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str), 0)); + (yyval.term) = term; +;} + break; + + case 25: + +/* Line 1464 of yacc.c */ +#line 167 "util/parse-events.y" + { + struct parse_events__term *term; + + ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_NUM, + (yyvsp[(1) - (3)].str), NULL, (yyvsp[(3) - (3)].num))); + (yyval.term) = term; +;} + break; + + case 26: + +/* Line 1464 of yacc.c */ +#line 176 "util/parse-events.y" + { + struct parse_events__term *term; + + ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_NUM, + (yyvsp[(1) - (1)].str), NULL, 1)); + (yyval.term) = term; +;} + break; + + case 27: + +/* Line 1464 of yacc.c */ +#line 185 "util/parse-events.y" + { + struct parse_events__term *term; + + ABORT_ON(parse_events__new_term(&term, (yyvsp[(1) - (3)].num), NULL, NULL, (yyvsp[(3) - (3)].num))); + (yyval.term) = term; +;} + break; + + case 28: + +/* Line 1464 of yacc.c */ +#line 193 "util/parse-events.y" + { + struct parse_events__term *term; + + ABORT_ON(parse_events__new_term(&term, (yyvsp[(1) - (1)].num), NULL, NULL, 1)); + (yyval.term) = term; ;} break; /* Line 1464 of yacc.c */ -#line 1497 "util/parse-events-bison.c" +#line 1621 "util/parse-events-bison.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -1705,7 +1829,7 @@ yyreturn: /* Line 1684 of yacc.c */ -#line 122 "util/parse-events.y" +#line 204 "util/parse-events.y" void parse_events_error(struct list_head *list __used, int *idx __used, diff --git a/tools/perf/util/parse-events-bison.h b/tools/perf/util/parse-events-bison.h index 097a6323e6a9..c58b76584f92 100644 --- a/tools/perf/util/parse-events-bison.h +++ b/tools/perf/util/parse-events-bison.h @@ -41,14 +41,15 @@ PE_VALUE = 258, PE_VALUE_SYM = 259, PE_RAW = 260, - PE_NAME = 261, - PE_MODIFIER_EVENT = 262, - PE_MODIFIER_BP = 263, - PE_NAME_CACHE_TYPE = 264, - PE_NAME_CACHE_OP_RESULT = 265, - PE_PREFIX_MEM = 266, - PE_PREFIX_RAW = 267, - PE_ERROR = 268 + PE_TERM = 261, + PE_NAME = 262, + PE_MODIFIER_EVENT = 263, + PE_MODIFIER_BP = 264, + PE_NAME_CACHE_TYPE = 265, + PE_NAME_CACHE_OP_RESULT = 266, + PE_PREFIX_MEM = 267, + PE_PREFIX_RAW = 268, + PE_ERROR = 269 }; #endif @@ -59,15 +60,17 @@ typedef union YYSTYPE { /* Line 1685 of yacc.c */ -#line 42 "util/parse-events.y" +#line 45 "util/parse-events.y" char *str; unsigned long num; + struct list_head *head; + struct parse_events__term *term; /* Line 1685 of yacc.c */ -#line 71 "util/parse-events-bison.h" +#line 74 "util/parse-events-bison.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/tools/perf/util/parse-events-flex.c b/tools/perf/util/parse-events-flex.c index 9e77ed6a0ecf..34cfc85c4f79 100644 --- a/tools/perf/util/parse-events-flex.c +++ b/tools/perf/util/parse-events-flex.c @@ -378,8 +378,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 44 -#define YY_END_OF_BUFFER 45 +#define YY_NUM_RULES 49 +#define YY_END_OF_BUFFER 50 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -387,55 +387,56 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[425] = +static yyconst flex_int16_t yy_accept[440] = { 0, - 0, 0, 45, 44, 38, 41, 40, 39, 34, 34, - 42, 43, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 36, 38, 38, 38, 38, 38, 36, 37, - 38, 38, 37, 37, 38, 34, 0, 38, 38, 38, - 21, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 15, 38, 0, 38, 38, 38, 36, 0, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 33, 33, 38, 38, 38, 38, 35, 38, - 38, 0, 38, 38, 38, 24, 38, 38, 38, 38, - 38, 38, 0, 38, 38, 38, 36, 0, 38, 38, - - 38, 0, 19, 20, 38, 38, 38, 38, 38, 38, - 38, 30, 38, 38, 33, 33, 38, 38, 38, 38, - 38, 38, 38, 0, 0, 38, 38, 38, 38, 0, - 38, 38, 0, 38, 0, 22, 38, 38, 36, 0, - 23, 38, 38, 19, 20, 26, 38, 32, 38, 38, - 31, 25, 38, 38, 26, 38, 38, 38, 38, 38, - 0, 38, 0, 0, 0, 0, 38, 38, 38, 38, - 0, 38, 38, 0, 0, 38, 22, 38, 38, 36, - 23, 0, 38, 26, 38, 38, 38, 38, 0, 38, - 38, 38, 27, 0, 27, 0, 38, 0, 0, 0, - - 0, 38, 38, 24, 0, 0, 38, 0, 0, 0, - 1, 38, 12, 0, 38, 0, 38, 0, 31, 0, - 38, 38, 38, 0, 0, 38, 0, 0, 0, 38, - 38, 0, 38, 0, 0, 0, 38, 0, 0, 0, - 38, 0, 38, 0, 38, 0, 0, 38, 38, 38, - 0, 38, 0, 0, 0, 38, 38, 0, 0, 7, - 0, 0, 0, 0, 0, 0, 0, 38, 0, 38, - 0, 38, 0, 0, 28, 38, 0, 0, 38, 0, - 38, 0, 0, 0, 0, 0, 0, 10, 0, 0, - 38, 0, 38, 0, 38, 0, 0, 38, 38, 0, - - 0, 38, 0, 0, 0, 0, 9, 0, 0, 0, - 1, 0, 0, 0, 38, 0, 16, 0, 0, 28, - 38, 0, 11, 38, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 38, 0, 0, 12, 38, 0, - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 4, 14, 13, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 50, 49, 43, 46, 45, 44, 39, 39, + 47, 48, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 41, 43, 43, 43, 43, 43, 41, 42, + 43, 43, 42, 42, 43, 39, 0, 43, 43, 43, + 21, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 15, 43, 0, 43, 43, 43, 41, 0, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 38, 38, 43, 43, 43, 43, 40, + 43, 43, 0, 43, 43, 43, 24, 43, 43, 43, + 43, 43, 43, 0, 43, 43, 43, 41, 0, 43, + + 43, 43, 0, 19, 20, 43, 43, 43, 43, 43, + 43, 43, 30, 43, 43, 43, 38, 38, 43, 43, + 43, 43, 43, 43, 43, 0, 0, 43, 43, 43, + 43, 0, 43, 43, 43, 0, 43, 0, 22, 43, + 43, 41, 0, 23, 43, 43, 19, 20, 26, 43, + 37, 43, 43, 31, 25, 43, 43, 43, 26, 43, + 43, 43, 43, 43, 0, 43, 0, 0, 0, 0, + 43, 43, 43, 43, 0, 43, 43, 43, 0, 0, + 43, 22, 43, 43, 41, 23, 0, 43, 26, 43, + 43, 43, 43, 0, 43, 43, 43, 43, 27, 0, + + 27, 0, 43, 0, 0, 0, 0, 43, 43, 24, + 0, 0, 32, 43, 0, 0, 0, 1, 43, 12, + 0, 43, 0, 43, 0, 31, 0, 35, 43, 43, + 43, 0, 0, 43, 0, 0, 0, 43, 43, 0, + 43, 43, 0, 0, 0, 33, 34, 43, 0, 0, + 0, 43, 0, 43, 0, 43, 0, 0, 43, 43, + 43, 0, 43, 0, 0, 0, 43, 43, 0, 0, + 43, 7, 0, 0, 0, 0, 0, 0, 0, 43, + 0, 43, 0, 43, 0, 0, 28, 43, 0, 0, + 43, 0, 43, 0, 0, 43, 0, 0, 0, 0, + + 10, 0, 0, 43, 0, 43, 0, 43, 0, 0, + 43, 43, 0, 0, 43, 0, 0, 0, 0, 43, + 9, 0, 0, 0, 1, 0, 0, 0, 43, 0, + 16, 0, 0, 28, 43, 0, 11, 43, 0, 0, + 0, 0, 36, 0, 0, 0, 0, 0, 0, 43, + 0, 0, 12, 43, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 4, 14, 13, 0, + 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 5, 15, 18, 0, 0, 29, + 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 7, 3, 0, 0, 0, 2, 0, 0, - 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 17, 0, 5, + 15, 18, 0, 0, 29, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7, 3, 0, + 0, 0, 2, 0, 0, 0, 0, 0, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -449,11 +450,11 @@ static yyconst flex_int32_t yy_ec[256] = 11, 1, 2, 1, 12, 13, 14, 15, 12, 12, 2, 2, 16, 2, 2, 17, 2, 2, 2, 2, 2, 18, 2, 19, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 2, 1, 20, 21, 22, 23, + 1, 1, 1, 1, 20, 1, 21, 22, 23, 24, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 2, 36, 37, 38, 39, 40, 41, 42, - 43, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 2, 37, 38, 39, 40, 41, 42, 43, + 44, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -470,241 +471,249 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[44] = +static yyconst flex_int32_t yy_meta[45] = { 0, 1, 2, 1, 1, 1, 3, 3, 3, 3, 1, - 1, 3, 3, 3, 3, 2, 2, 2, 2, 3, - 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, + 1, 3, 3, 3, 3, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2 + 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[427] = +static yyconst flex_int16_t yy_base[442] = { 0, - 0, 0, 494, 495, 0, 495, 495, 495, 38, 42, - 495, 495, 473, 459, 45, 467, 32, 20, 40, 53, - 458, 469, 34, 62, 58, 58, 454, 452, 64, 98, - 32, 466, 449, 0, 0, 81, 0, 446, 446, 478, - 0, 467, 455, 457, 450, 54, 457, 455, 438, 452, - 440, 433, 0, 449, 432, 452, 429, 428, 97, 428, - 448, 433, 426, 105, 442, 432, 428, 104, 436, 421, - 431, 432, 431, 77, 430, 95, 416, 424, 0, 431, - 412, 103, 425, 424, 421, 0, 413, 441, 417, 405, - 438, 410, 409, 426, 407, 406, 108, 405, 422, 410, - - 395, 111, 0, 0, 409, 397, 420, 393, 394, 390, - 402, 0, 401, 399, 93, 116, 401, 391, 385, 390, - 381, 414, 381, 76, 46, 380, 378, 381, 391, 390, - 387, 386, 120, 385, 387, 0, 387, 368, 119, 384, - 0, 400, 367, 495, 495, 365, 365, 495, 380, 363, - 374, 0, 393, 372, 371, 355, 362, 368, 387, 366, - 370, 349, 349, 366, 365, 347, 359, 345, 349, 353, - 336, 374, 335, 113, 348, 338, 495, 336, 336, 0, - 495, 350, 332, 0, 366, 331, 364, 330, 341, 327, - 333, 339, 325, 339, 0, 343, 337, 338, 335, 334, - - 317, 321, 329, 121, 330, 119, 313, 316, 327, 322, - 0, 319, 0, 303, 323, 319, 315, 317, 0, 321, - 318, 319, 315, 306, 323, 297, 307, 306, 296, 309, - 297, 129, 292, 297, 299, 302, 321, 302, 292, 286, - 287, 298, 281, 298, 283, 296, 276, 287, 275, 308, - 277, 282, 285, 284, 268, 282, 267, 271, 275, 0, - 278, 264, 275, 262, 268, 273, 276, 262, 263, 265, - 253, 258, 251, 258, 264, 259, 264, 263, 250, 261, - 278, 244, 243, 242, 241, 253, 235, 495, 238, 236, - 269, 248, 237, 239, 232, 237, 229, 229, 225, 221, - - 233, 229, 223, 235, 221, 221, 495, 233, 220, 227, - 495, 226, 228, 215, 218, 212, 0, 211, 211, 0, - 223, 224, 495, 241, 216, 223, 206, 217, 203, 215, - 200, 203, 216, 231, 197, 196, 195, 495, 227, 199, - 210, 194, 188, 187, 188, 495, 191, 201, 189, 182, - 138, 0, 495, 495, 129, 196, 202, 185, 186, 194, - 495, 193, 187, 176, 181, 191, 174, 175, 184, 170, - 193, 167, 166, 179, 178, 495, 163, 178, 165, 178, - 177, 192, 158, 166, 156, 155, 154, 160, 156, 165, - 164, 141, 495, 152, 495, 495, 495, 161, 146, 495, - - 163, 146, 148, 147, 155, 156, 143, 139, 152, 141, - 143, 139, 495, 495, 148, 146, 131, 495, 131, 126, - 125, 81, 85, 495, 165, 68 + 0, 0, 510, 511, 0, 511, 511, 511, 39, 43, + 511, 511, 488, 474, 46, 482, 32, 20, 37, 57, + 473, 484, 34, 64, 59, 64, 469, 467, 78, 113, + 41, 481, 464, 0, 0, 104, 0, 461, 461, 494, + 0, 483, 470, 472, 465, 44, 472, 470, 453, 467, + 455, 448, 0, 464, 447, 468, 444, 443, 64, 443, + 464, 448, 441, 67, 457, 447, 443, 52, 451, 436, + 446, 435, 446, 445, 76, 444, 95, 430, 438, 0, + 445, 426, 100, 439, 438, 435, 0, 427, 456, 431, + 105, 454, 425, 424, 442, 422, 421, 112, 420, 438, + + 425, 410, 117, 0, 0, 424, 412, 436, 408, 409, + 405, 417, 0, 416, 411, 413, 83, 107, 415, 405, + 399, 404, 395, 429, 395, 126, 119, 394, 392, 395, + 405, 404, 401, 396, 399, 100, 398, 400, 0, 400, + 381, 123, 397, 0, 414, 380, 511, 511, 378, 378, + 511, 393, 376, 387, 0, 407, 375, 384, 383, 367, + 374, 380, 400, 378, 383, 361, 361, 378, 377, 359, + 371, 357, 361, 365, 348, 387, 363, 346, 73, 359, + 349, 511, 347, 347, 0, 511, 361, 343, 0, 378, + 342, 376, 341, 352, 353, 337, 343, 349, 335, 349, + + 0, 354, 347, 348, 345, 344, 327, 331, 339, 146, + 340, 123, 150, 323, 326, 337, 332, 0, 329, 0, + 313, 333, 329, 325, 327, 0, 331, 0, 328, 329, + 325, 316, 334, 307, 317, 316, 306, 319, 307, 132, + 301, 301, 306, 308, 311, 0, 0, 331, 311, 301, + 295, 296, 307, 290, 307, 292, 305, 285, 296, 284, + 318, 286, 291, 294, 293, 277, 291, 276, 280, 284, + 268, 0, 286, 272, 283, 270, 276, 281, 284, 270, + 271, 273, 261, 266, 259, 266, 272, 267, 272, 271, + 258, 269, 287, 252, 251, 252, 249, 248, 260, 242, + + 511, 245, 243, 277, 255, 244, 246, 239, 244, 236, + 236, 232, 228, 240, 236, 230, 242, 228, 228, 240, + 511, 239, 226, 233, 511, 232, 234, 221, 224, 218, + 0, 217, 217, 0, 229, 230, 511, 248, 222, 229, + 212, 223, 0, 209, 221, 206, 209, 222, 238, 203, + 202, 201, 511, 234, 205, 217, 200, 194, 193, 194, + 511, 197, 207, 195, 188, 142, 0, 511, 511, 130, + 202, 209, 191, |