Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
8f707d84 89812fc8

+845 -426
+22
tools/perf/builtin-test.c
··· 677 677 return 0; 678 678 } 679 679 680 + static int test__checkevent_symbolic_name_config(struct perf_evlist *evlist) 681 + { 682 + struct perf_evsel *evsel = list_entry(evlist->entries.next, 683 + struct perf_evsel, node); 684 + 685 + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); 686 + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); 687 + TEST_ASSERT_VAL("wrong config", 688 + PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); 689 + TEST_ASSERT_VAL("wrong period", 690 + 100000 == evsel->attr.sample_period); 691 + TEST_ASSERT_VAL("wrong config1", 692 + 0 == evsel->attr.config1); 693 + TEST_ASSERT_VAL("wrong config2", 694 + 1 == evsel->attr.config2); 695 + return 0; 696 + } 697 + 680 698 static int test__checkevent_symbolic_alias(struct perf_evlist *evlist) 681 699 { 682 700 struct perf_evsel *evsel = list_entry(evlist->entries.next, ··· 900 882 { 901 883 .name = "instructions", 902 884 .check = test__checkevent_symbolic_name, 885 + }, 886 + { 887 + .name = "cycles/period=100000,config2/", 888 + .check = test__checkevent_symbolic_name_config, 903 889 }, 904 890 { 905 891 .name = "faults",
+217 -93
tools/perf/util/parse-events-bison.c
··· 127 127 PE_VALUE = 258, 128 128 PE_VALUE_SYM = 259, 129 129 PE_RAW = 260, 130 - PE_NAME = 261, 131 - PE_MODIFIER_EVENT = 262, 132 - PE_MODIFIER_BP = 263, 133 - PE_NAME_CACHE_TYPE = 264, 134 - PE_NAME_CACHE_OP_RESULT = 265, 135 - PE_PREFIX_MEM = 266, 136 - PE_PREFIX_RAW = 267, 137 - PE_ERROR = 268 130 + PE_TERM = 261, 131 + PE_NAME = 262, 132 + PE_MODIFIER_EVENT = 263, 133 + PE_MODIFIER_BP = 264, 134 + PE_NAME_CACHE_TYPE = 265, 135 + PE_NAME_CACHE_OP_RESULT = 266, 136 + PE_PREFIX_MEM = 267, 137 + PE_PREFIX_RAW = 268, 138 + PE_ERROR = 269 138 139 }; 139 140 #endif 140 141 ··· 146 145 { 147 146 148 147 /* Line 214 of yacc.c */ 149 - #line 42 "util/parse-events.y" 148 + #line 45 "util/parse-events.y" 150 149 151 150 char *str; 152 151 unsigned long num; 152 + struct list_head *head; 153 + struct parse_events__term *term; 153 154 154 155 155 156 156 157 /* Line 214 of yacc.c */ 157 - #line 157 "util/parse-events-bison.c" 158 + #line 160 "util/parse-events-bison.c" 158 159 } YYSTYPE; 159 160 # define YYSTYPE_IS_TRIVIAL 1 160 161 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ ··· 168 165 169 166 170 167 /* Line 264 of yacc.c */ 171 - #line 169 "util/parse-events-bison.c" 168 + #line 172 "util/parse-events-bison.c" 172 169 173 170 #ifdef short 174 171 # undef short ··· 381 378 #endif 382 379 383 380 /* YYFINAL -- State number of the termination state. */ 384 - #define YYFINAL 20 381 + #define YYFINAL 23 385 382 /* YYLAST -- Last index in YYTABLE. */ 386 - #define YYLAST 27 383 + #define YYLAST 38 387 384 388 385 /* YYNTOKENS -- Number of terminals. */ 389 - #define YYNTOKENS 17 386 + #define YYNTOKENS 20 390 387 /* YYNNTS -- Number of nonterminals. */ 391 - #define YYNNTS 11 388 + #define YYNNTS 14 392 389 /* YYNRULES -- Number of rules. */ 393 - #define YYNRULES 22 390 + #define YYNRULES 33 394 391 /* YYNRULES -- Number of states. */ 395 - #define YYNSTATES 39 392 + #define YYNSTATES 53 396 393 397 394 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 398 395 #define YYUNDEFTOK 2 399 - #define YYMAXUTOK 268 396 + #define YYMAXUTOK 269 400 397 401 398 #define YYTRANSLATE(YYX) \ 402 399 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) ··· 408 405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 409 406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 410 407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 411 - 2, 2, 2, 2, 14, 15, 2, 2, 2, 2, 412 - 2, 2, 2, 2, 2, 2, 2, 2, 16, 2, 413 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 408 + 2, 2, 2, 2, 15, 17, 2, 16, 2, 2, 409 + 2, 2, 2, 2, 2, 2, 2, 2, 18, 2, 410 + 2, 19, 2, 2, 2, 2, 2, 2, 2, 2, 414 411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 415 412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 416 413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ··· 430 427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 431 428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 432 429 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 433 - 5, 6, 7, 8, 9, 10, 11, 12, 13 430 + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 434 431 }; 435 432 436 433 #if YYDEBUG ··· 438 435 YYRHS. */ 439 436 static const yytype_uint8 yyprhs[] = 440 437 { 441 - 0, 0, 3, 7, 9, 12, 14, 17, 20, 22, 442 - 25, 28, 31, 33, 39, 43, 45, 51, 55, 59, 443 - 63, 65, 67 438 + 0, 0, 3, 7, 9, 12, 14, 16, 19, 21, 439 + 24, 27, 30, 35, 38, 44, 48, 50, 56, 60, 440 + 64, 68, 70, 74, 76, 80, 84, 86, 90, 92, 441 + 94, 95, 97, 99 444 442 }; 445 443 446 444 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 447 445 static const yytype_int8 yyrhs[] = 448 446 { 449 - 18, 0, -1, 18, 14, 19, -1, 19, -1, 20, 450 - 7, -1, 20, -1, 21, 27, -1, 22, 27, -1, 451 - 23, -1, 24, 27, -1, 25, 27, -1, 26, 27, 452 - -1, 4, -1, 9, 15, 10, 15, 10, -1, 9, 453 - 15, 10, -1, 9, -1, 11, 3, 16, 8, 27, 454 - -1, 11, 3, 27, -1, 6, 16, 6, -1, 3, 455 - 16, 3, -1, 5, -1, 16, -1, -1 447 + 21, 0, -1, 21, 15, 22, -1, 22, -1, 23, 448 + 8, -1, 23, -1, 24, -1, 25, 32, -1, 26, 449 + -1, 27, 32, -1, 28, 32, -1, 29, 32, -1, 450 + 4, 16, 30, 16, -1, 4, 33, -1, 10, 17, 451 + 11, 17, 11, -1, 10, 17, 11, -1, 10, -1, 452 + 12, 3, 18, 9, 32, -1, 12, 3, 32, -1, 453 + 7, 18, 7, -1, 3, 18, 3, -1, 5, -1, 454 + 30, 15, 31, -1, 31, -1, 7, 19, 7, -1, 455 + 7, 19, 3, -1, 7, -1, 6, 19, 3, -1, 456 + 6, -1, 18, -1, -1, 16, -1, 18, -1, -1 456 457 }; 457 458 458 459 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 459 460 static const yytype_uint8 yyrline[] = 460 461 { 461 - 0, 49, 49, 49, 52, 57, 59, 60, 61, 62, 462 - 63, 64, 67, 76, 81, 86, 92, 97, 103, 109, 463 - 115, 120, 120 462 + 0, 54, 54, 54, 57, 62, 64, 65, 66, 67, 463 + 68, 69, 72, 81, 90, 95, 100, 106, 111, 117, 464 + 123, 129, 135, 145, 157, 166, 175, 184, 192, 200, 465 + 200, 202, 202, 202 464 466 }; 465 467 #endif 466 468 ··· 475 467 static const char *const yytname[] = 476 468 { 477 469 "$end", "error", "$undefined", "PE_VALUE", "PE_VALUE_SYM", "PE_RAW", 478 - "PE_NAME", "PE_MODIFIER_EVENT", "PE_MODIFIER_BP", "PE_NAME_CACHE_TYPE", 479 - "PE_NAME_CACHE_OP_RESULT", "PE_PREFIX_MEM", "PE_PREFIX_RAW", "PE_ERROR", 480 - "','", "'-'", "':'", "$accept", "events", "event", "event_def", 481 - "event_legacy_symbol", "event_legacy_cache", "event_legacy_mem", 482 - "event_legacy_tracepoint", "event_legacy_numeric", "event_legacy_raw", 483 - "sep_dc", 0 470 + "PE_TERM", "PE_NAME", "PE_MODIFIER_EVENT", "PE_MODIFIER_BP", 471 + "PE_NAME_CACHE_TYPE", "PE_NAME_CACHE_OP_RESULT", "PE_PREFIX_MEM", 472 + "PE_PREFIX_RAW", "PE_ERROR", "','", "'/'", "'-'", "':'", "'='", 473 + "$accept", "events", "event", "event_def", "event_legacy_symbol", 474 + "event_legacy_cache", "event_legacy_mem", "event_legacy_tracepoint", 475 + "event_legacy_numeric", "event_legacy_raw", "event_config", "event_term", 476 + "sep_dc", "sep_slash_dc", 0 484 477 }; 485 478 #endif 486 479 ··· 491 482 static const yytype_uint16 yytoknum[] = 492 483 { 493 484 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 494 - 265, 266, 267, 268, 44, 45, 58 485 + 265, 266, 267, 268, 269, 44, 47, 45, 58, 61 495 486 }; 496 487 # endif 497 488 498 489 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 499 490 static const yytype_uint8 yyr1[] = 500 491 { 501 - 0, 17, 18, 18, 19, 19, 20, 20, 20, 20, 502 - 20, 20, 21, 22, 22, 22, 23, 23, 24, 25, 503 - 26, 27, 27 492 + 0, 20, 21, 21, 22, 22, 23, 23, 23, 23, 493 + 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 494 + 28, 29, 30, 30, 31, 31, 31, 31, 31, 32, 495 + 32, 33, 33, 33 504 496 }; 505 497 506 498 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 507 499 static const yytype_uint8 yyr2[] = 508 500 { 509 - 0, 2, 3, 1, 2, 1, 2, 2, 1, 2, 510 - 2, 2, 1, 5, 3, 1, 5, 3, 3, 3, 511 - 1, 1, 0 501 + 0, 2, 3, 1, 2, 1, 1, 2, 1, 2, 502 + 2, 2, 4, 2, 5, 3, 1, 5, 3, 3, 503 + 3, 1, 3, 1, 3, 3, 1, 3, 1, 1, 504 + 0, 1, 1, 0 512 505 }; 513 506 514 507 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state ··· 518 507 means the default is an error. */ 519 508 static const yytype_uint8 yydefact[] = 520 509 { 521 - 0, 0, 12, 20, 0, 15, 0, 0, 3, 5, 522 - 22, 22, 8, 22, 22, 22, 0, 0, 0, 22, 523 - 1, 0, 4, 21, 6, 7, 9, 10, 11, 19, 524 - 18, 14, 21, 17, 2, 0, 22, 13, 16 510 + 0, 0, 33, 21, 0, 16, 0, 0, 3, 5, 511 + 6, 30, 8, 30, 30, 30, 0, 31, 32, 13, 512 + 0, 0, 30, 1, 0, 4, 29, 7, 9, 10, 513 + 11, 20, 28, 26, 0, 23, 19, 15, 29, 18, 514 + 2, 0, 0, 0, 12, 0, 30, 27, 25, 24, 515 + 22, 14, 17 525 516 }; 526 517 527 518 /* YYDEFGOTO[NTERM-NUM]. */ 528 519 static const yytype_int8 yydefgoto[] = 529 520 { 530 521 -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 531 - 24 522 + 34, 35, 27, 19 532 523 }; 533 524 534 525 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 535 526 STATE-NUM. */ 536 - #define YYPACT_NINF -12 527 + #define YYPACT_NINF -14 537 528 static const yytype_int8 yypact[] = 538 529 { 539 - 7, -10, -12, -12, -9, -6, 2, 1, -12, 10, 540 - -2, -2, -12, -2, -2, -2, 16, 14, 11, 6, 541 - -12, 7, -12, -12, -12, -12, -12, -12, -12, -12, 542 - -12, 8, 18, -12, -12, 17, -2, -12, -12 530 + 1, -11, -1, -14, -6, 8, 20, 3, -14, 16, 531 + -14, -2, -14, -2, -2, -2, 23, 13, -14, -14, 532 + 21, 18, 9, -14, 1, -14, -14, -14, -14, -14, 533 + -14, -14, 11, 12, 6, -14, -14, 15, 25, -14, 534 + -14, 32, 7, 13, -14, 26, -2, -14, -14, -14, 535 + -14, -14, -14 543 536 }; 544 537 545 538 /* YYPGOTO[NTERM-NUM]. */ 546 539 static const yytype_int8 yypgoto[] = 547 540 { 548 - -12, -12, 3, -12, -12, -12, -12, -12, -12, -12, 549 - -11 541 + -14, -14, 14, -14, -14, -14, -14, -14, -14, -14, 542 + -14, -7, -13, -14 550 543 }; 551 544 552 545 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If ··· 560 545 #define YYTABLE_NINF -1 561 546 static const yytype_uint8 yytable[] = 562 547 { 563 - 25, 20, 26, 27, 28, 19, 16, 17, 33, 18, 564 - 1, 2, 3, 4, 23, 21, 5, 22, 6, 29, 565 - 30, 31, 32, 35, 34, 38, 36, 37 548 + 28, 29, 30, 23, 1, 2, 3, 16, 4, 39, 549 + 48, 5, 20, 6, 49, 17, 26, 18, 24, 32, 550 + 33, 43, 44, 22, 25, 21, 31, 38, 36, 37, 551 + 41, 42, 45, 52, 46, 47, 50, 51, 40 566 552 }; 567 553 568 554 static const yytype_uint8 yycheck[] = 569 555 { 570 - 11, 0, 13, 14, 15, 3, 16, 16, 19, 15, 571 - 3, 4, 5, 6, 16, 14, 9, 7, 11, 3, 572 - 6, 10, 16, 15, 21, 36, 8, 10 556 + 13, 14, 15, 0, 3, 4, 5, 18, 7, 22, 557 + 3, 10, 18, 12, 7, 16, 18, 18, 15, 6, 558 + 7, 15, 16, 3, 8, 17, 3, 18, 7, 11, 559 + 19, 19, 17, 46, 9, 3, 43, 11, 24 573 560 }; 574 561 575 562 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 576 563 symbol of state STATE-NUM. */ 577 564 static const yytype_uint8 yystos[] = 578 565 { 579 - 0, 3, 4, 5, 6, 9, 11, 18, 19, 20, 580 - 21, 22, 23, 24, 25, 26, 16, 16, 15, 3, 581 - 0, 14, 7, 16, 27, 27, 27, 27, 27, 3, 582 - 6, 10, 16, 27, 19, 15, 8, 10, 27 566 + 0, 3, 4, 5, 7, 10, 12, 21, 22, 23, 567 + 24, 25, 26, 27, 28, 29, 18, 16, 18, 33, 568 + 18, 17, 3, 0, 15, 8, 18, 32, 32, 32, 569 + 32, 3, 6, 7, 30, 31, 7, 11, 18, 32, 570 + 22, 19, 19, 15, 16, 17, 9, 3, 3, 7, 571 + 31, 11, 32 583 572 }; 584 573 585 574 #define yyerrok (yyerrstatus = 0) ··· 1419 1400 case 4: 1420 1401 1421 1402 /* Line 1464 of yacc.c */ 1422 - #line 53 "util/parse-events.y" 1403 + #line 58 "util/parse-events.y" 1423 1404 { 1424 1405 ABORT_ON(parse_events_modifier(list, (yyvsp[(2) - (2)].str))); 1425 1406 ;} ··· 1428 1409 case 12: 1429 1410 1430 1411 /* Line 1464 of yacc.c */ 1431 - #line 68 "util/parse-events.y" 1412 + #line 73 "util/parse-events.y" 1432 1413 { 1433 - int type = (yyvsp[(1) - (1)].num) >> 16; 1434 - int config = (yyvsp[(1) - (1)].num) & 255; 1414 + int type = (yyvsp[(1) - (4)].num) >> 16; 1415 + int config = (yyvsp[(1) - (4)].num) & 255; 1435 1416 1436 - ABORT_ON(parse_events_add_numeric(list, idx, type, config)); 1417 + ABORT_ON(parse_events_add_numeric(list, idx, type, config, (yyvsp[(3) - (4)].head))); 1418 + parse_events__free_terms((yyvsp[(3) - (4)].head)); 1437 1419 ;} 1438 1420 break; 1439 1421 1440 1422 case 13: 1441 1423 1442 1424 /* Line 1464 of yacc.c */ 1443 - #line 77 "util/parse-events.y" 1425 + #line 82 "util/parse-events.y" 1444 1426 { 1445 - ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (5)].str), (yyvsp[(3) - (5)].str), (yyvsp[(5) - (5)].str))); 1427 + int type = (yyvsp[(1) - (2)].num) >> 16; 1428 + int config = (yyvsp[(1) - (2)].num) & 255; 1429 + 1430 + ABORT_ON(parse_events_add_numeric(list, idx, type, config, NULL)); 1446 1431 ;} 1447 1432 break; 1448 1433 1449 1434 case 14: 1450 1435 1451 1436 /* Line 1464 of yacc.c */ 1452 - #line 82 "util/parse-events.y" 1437 + #line 91 "util/parse-events.y" 1453 1438 { 1454 - ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str), NULL)); 1439 + ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (5)].str), (yyvsp[(3) - (5)].str), (yyvsp[(5) - (5)].str))); 1455 1440 ;} 1456 1441 break; 1457 1442 1458 1443 case 15: 1459 1444 1460 1445 /* Line 1464 of yacc.c */ 1461 - #line 87 "util/parse-events.y" 1446 + #line 96 "util/parse-events.y" 1462 1447 { 1463 - ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (1)].str), NULL, NULL)); 1448 + ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str), NULL)); 1464 1449 ;} 1465 1450 break; 1466 1451 1467 1452 case 16: 1468 1453 1469 1454 /* Line 1464 of yacc.c */ 1470 - #line 93 "util/parse-events.y" 1455 + #line 101 "util/parse-events.y" 1471 1456 { 1472 - ABORT_ON(parse_events_add_breakpoint(list, idx, (void *) (yyvsp[(2) - (5)].num), (yyvsp[(4) - (5)].str))); 1457 + ABORT_ON(parse_events_add_cache(list, idx, (yyvsp[(1) - (1)].str), NULL, NULL)); 1473 1458 ;} 1474 1459 break; 1475 1460 1476 1461 case 17: 1477 1462 1478 1463 /* Line 1464 of yacc.c */ 1479 - #line 98 "util/parse-events.y" 1464 + #line 107 "util/parse-events.y" 1480 1465 { 1481 - ABORT_ON(parse_events_add_breakpoint(list, idx, (void *) (yyvsp[(2) - (3)].num), NULL)); 1466 + ABORT_ON(parse_events_add_breakpoint(list, idx, (void *) (yyvsp[(2) - (5)].num), (yyvsp[(4) - (5)].str))); 1482 1467 ;} 1483 1468 break; 1484 1469 1485 1470 case 18: 1486 1471 1487 1472 /* Line 1464 of yacc.c */ 1488 - #line 104 "util/parse-events.y" 1473 + #line 112 "util/parse-events.y" 1489 1474 { 1490 - ABORT_ON(parse_events_add_tracepoint(list, idx, (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str))); 1475 + ABORT_ON(parse_events_add_breakpoint(list, idx, (void *) (yyvsp[(2) - (3)].num), NULL)); 1491 1476 ;} 1492 1477 break; 1493 1478 1494 1479 case 19: 1495 1480 1496 1481 /* Line 1464 of yacc.c */ 1497 - #line 110 "util/parse-events.y" 1482 + #line 118 "util/parse-events.y" 1498 1483 { 1499 - ABORT_ON(parse_events_add_numeric(list, idx, (yyvsp[(1) - (3)].num), (yyvsp[(3) - (3)].num))); 1484 + ABORT_ON(parse_events_add_tracepoint(list, idx, (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str))); 1500 1485 ;} 1501 1486 break; 1502 1487 1503 1488 case 20: 1504 1489 1505 1490 /* Line 1464 of yacc.c */ 1506 - #line 116 "util/parse-events.y" 1491 + #line 124 "util/parse-events.y" 1507 1492 { 1508 - ABORT_ON(parse_events_add_numeric(list, idx, PERF_TYPE_RAW, (yyvsp[(1) - (1)].num))); 1493 + ABORT_ON(parse_events_add_numeric(list, idx, (yyvsp[(1) - (3)].num), (yyvsp[(3) - (3)].num), NULL)); 1494 + ;} 1495 + break; 1496 + 1497 + case 21: 1498 + 1499 + /* Line 1464 of yacc.c */ 1500 + #line 130 "util/parse-events.y" 1501 + { 1502 + ABORT_ON(parse_events_add_numeric(list, idx, PERF_TYPE_RAW, (yyvsp[(1) - (1)].num), NULL)); 1503 + ;} 1504 + break; 1505 + 1506 + case 22: 1507 + 1508 + /* Line 1464 of yacc.c */ 1509 + #line 136 "util/parse-events.y" 1510 + { 1511 + struct list_head *head = (yyvsp[(1) - (3)].head); 1512 + struct parse_events__term *term = (yyvsp[(3) - (3)].term); 1513 + 1514 + ABORT_ON(!head); 1515 + list_add_tail(&term->list, head); 1516 + (yyval.head) = (yyvsp[(1) - (3)].head); 1517 + ;} 1518 + break; 1519 + 1520 + case 23: 1521 + 1522 + /* Line 1464 of yacc.c */ 1523 + #line 146 "util/parse-events.y" 1524 + { 1525 + struct list_head *head = malloc(sizeof(*head)); 1526 + struct parse_events__term *term = (yyvsp[(1) - (1)].term); 1527 + 1528 + ABORT_ON(!head); 1529 + INIT_LIST_HEAD(head); 1530 + list_add_tail(&term->list, head); 1531 + (yyval.head) = head; 1532 + ;} 1533 + break; 1534 + 1535 + case 24: 1536 + 1537 + /* Line 1464 of yacc.c */ 1538 + #line 158 "util/parse-events.y" 1539 + { 1540 + struct parse_events__term *term; 1541 + 1542 + ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_STR, 1543 + (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str), 0)); 1544 + (yyval.term) = term; 1545 + ;} 1546 + break; 1547 + 1548 + case 25: 1549 + 1550 + /* Line 1464 of yacc.c */ 1551 + #line 167 "util/parse-events.y" 1552 + { 1553 + struct parse_events__term *term; 1554 + 1555 + ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_NUM, 1556 + (yyvsp[(1) - (3)].str), NULL, (yyvsp[(3) - (3)].num))); 1557 + (yyval.term) = term; 1558 + ;} 1559 + break; 1560 + 1561 + case 26: 1562 + 1563 + /* Line 1464 of yacc.c */ 1564 + #line 176 "util/parse-events.y" 1565 + { 1566 + struct parse_events__term *term; 1567 + 1568 + ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_NUM, 1569 + (yyvsp[(1) - (1)].str), NULL, 1)); 1570 + (yyval.term) = term; 1571 + ;} 1572 + break; 1573 + 1574 + case 27: 1575 + 1576 + /* Line 1464 of yacc.c */ 1577 + #line 185 "util/parse-events.y" 1578 + { 1579 + struct parse_events__term *term; 1580 + 1581 + ABORT_ON(parse_events__new_term(&term, (yyvsp[(1) - (3)].num), NULL, NULL, (yyvsp[(3) - (3)].num))); 1582 + (yyval.term) = term; 1583 + ;} 1584 + break; 1585 + 1586 + case 28: 1587 + 1588 + /* Line 1464 of yacc.c */ 1589 + #line 193 "util/parse-events.y" 1590 + { 1591 + struct parse_events__term *term; 1592 + 1593 + ABORT_ON(parse_events__new_term(&term, (yyvsp[(1) - (1)].num), NULL, NULL, 1)); 1594 + (yyval.term) = term; 1509 1595 ;} 1510 1596 break; 1511 1597 1512 1598 1513 1599 1514 1600 /* Line 1464 of yacc.c */ 1515 - #line 1497 "util/parse-events-bison.c" 1601 + #line 1621 "util/parse-events-bison.c" 1516 1602 default: break; 1517 1603 } 1518 1604 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); ··· 1829 1705 1830 1706 1831 1707 /* Line 1684 of yacc.c */ 1832 - #line 122 "util/parse-events.y" 1708 + #line 204 "util/parse-events.y" 1833 1709 1834 1710 1835 1711 void parse_events_error(struct list_head *list __used, int *idx __used,
+13 -10
tools/perf/util/parse-events-bison.h
··· 41 41 PE_VALUE = 258, 42 42 PE_VALUE_SYM = 259, 43 43 PE_RAW = 260, 44 - PE_NAME = 261, 45 - PE_MODIFIER_EVENT = 262, 46 - PE_MODIFIER_BP = 263, 47 - PE_NAME_CACHE_TYPE = 264, 48 - PE_NAME_CACHE_OP_RESULT = 265, 49 - PE_PREFIX_MEM = 266, 50 - PE_PREFIX_RAW = 267, 51 - PE_ERROR = 268 44 + PE_TERM = 261, 45 + PE_NAME = 262, 46 + PE_MODIFIER_EVENT = 263, 47 + PE_MODIFIER_BP = 264, 48 + PE_NAME_CACHE_TYPE = 265, 49 + PE_NAME_CACHE_OP_RESULT = 266, 50 + PE_PREFIX_MEM = 267, 51 + PE_PREFIX_RAW = 268, 52 + PE_ERROR = 269 52 53 }; 53 54 #endif 54 55 ··· 60 59 { 61 60 62 61 /* Line 1685 of yacc.c */ 63 - #line 42 "util/parse-events.y" 62 + #line 45 "util/parse-events.y" 64 63 65 64 char *str; 66 65 unsigned long num; 66 + struct list_head *head; 67 + struct parse_events__term *term; 67 68 68 69 69 70 70 71 /* Line 1685 of yacc.c */ 71 - #line 71 "util/parse-events-bison.h" 72 + #line 74 "util/parse-events-bison.h" 72 73 } YYSTYPE; 73 74 # define YYSTYPE_IS_TRIVIAL 1 74 75 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
+359 -312
tools/perf/util/parse-events-flex.c
··· 378 378 *yy_cp = '\0'; \ 379 379 (yy_c_buf_p) = yy_cp; 380 380 381 - #define YY_NUM_RULES 44 382 - #define YY_END_OF_BUFFER 45 381 + #define YY_NUM_RULES 49 382 + #define YY_END_OF_BUFFER 50 383 383 /* This struct is not used in this scanner, 384 384 but its presence is necessary. */ 385 385 struct yy_trans_info ··· 387 387 flex_int32_t yy_verify; 388 388 flex_int32_t yy_nxt; 389 389 }; 390 - static yyconst flex_int16_t yy_accept[425] = 390 + static yyconst flex_int16_t yy_accept[440] = 391 391 { 0, 392 - 0, 0, 45, 44, 38, 41, 40, 39, 34, 34, 393 - 42, 43, 38, 38, 38, 38, 38, 38, 38, 38, 394 - 38, 38, 36, 38, 38, 38, 38, 38, 36, 37, 395 - 38, 38, 37, 37, 38, 34, 0, 38, 38, 38, 396 - 21, 38, 38, 38, 38, 38, 38, 38, 38, 38, 397 - 38, 38, 15, 38, 0, 38, 38, 38, 36, 0, 398 - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 399 - 38, 38, 33, 33, 38, 38, 38, 38, 35, 38, 400 - 38, 0, 38, 38, 38, 24, 38, 38, 38, 38, 401 - 38, 38, 0, 38, 38, 38, 36, 0, 38, 38, 392 + 0, 0, 50, 49, 43, 46, 45, 44, 39, 39, 393 + 47, 48, 43, 43, 43, 43, 43, 43, 43, 43, 394 + 43, 43, 41, 43, 43, 43, 43, 43, 41, 42, 395 + 43, 43, 42, 42, 43, 39, 0, 43, 43, 43, 396 + 21, 43, 43, 43, 43, 43, 43, 43, 43, 43, 397 + 43, 43, 15, 43, 0, 43, 43, 43, 41, 0, 398 + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 399 + 43, 43, 43, 38, 38, 43, 43, 43, 43, 40, 400 + 43, 43, 0, 43, 43, 43, 24, 43, 43, 43, 401 + 43, 43, 43, 0, 43, 43, 43, 41, 0, 43, 402 402 403 - 38, 0, 19, 20, 38, 38, 38, 38, 38, 38, 404 - 38, 30, 38, 38, 33, 33, 38, 38, 38, 38, 405 - 38, 38, 38, 0, 0, 38, 38, 38, 38, 0, 406 - 38, 38, 0, 38, 0, 22, 38, 38, 36, 0, 407 - 23, 38, 38, 19, 20, 26, 38, 32, 38, 38, 408 - 31, 25, 38, 38, 26, 38, 38, 38, 38, 38, 409 - 0, 38, 0, 0, 0, 0, 38, 38, 38, 38, 410 - 0, 38, 38, 0, 0, 38, 22, 38, 38, 36, 411 - 23, 0, 38, 26, 38, 38, 38, 38, 0, 38, 412 - 38, 38, 27, 0, 27, 0, 38, 0, 0, 0, 403 + 43, 43, 0, 19, 20, 43, 43, 43, 43, 43, 404 + 43, 43, 30, 43, 43, 43, 38, 38, 43, 43, 405 + 43, 43, 43, 43, 43, 0, 0, 43, 43, 43, 406 + 43, 0, 43, 43, 43, 0, 43, 0, 22, 43, 407 + 43, 41, 0, 23, 43, 43, 19, 20, 26, 43, 408 + 37, 43, 43, 31, 25, 43, 43, 43, 26, 43, 409 + 43, 43, 43, 43, 0, 43, 0, 0, 0, 0, 410 + 43, 43, 43, 43, 0, 43, 43, 43, 0, 0, 411 + 43, 22, 43, 43, 41, 23, 0, 43, 26, 43, 412 + 43, 43, 43, 0, 43, 43, 43, 43, 27, 0, 413 413 414 - 0, 38, 38, 24, 0, 0, 38, 0, 0, 0, 415 - 1, 38, 12, 0, 38, 0, 38, 0, 31, 0, 416 - 38, 38, 38, 0, 0, 38, 0, 0, 0, 38, 417 - 38, 0, 38, 0, 0, 0, 38, 0, 0, 0, 418 - 38, 0, 38, 0, 38, 0, 0, 38, 38, 38, 419 - 0, 38, 0, 0, 0, 38, 38, 0, 0, 7, 420 - 0, 0, 0, 0, 0, 0, 0, 38, 0, 38, 421 - 0, 38, 0, 0, 28, 38, 0, 0, 38, 0, 422 - 38, 0, 0, 0, 0, 0, 0, 10, 0, 0, 423 - 38, 0, 38, 0, 38, 0, 0, 38, 38, 0, 414 + 27, 0, 43, 0, 0, 0, 0, 43, 43, 24, 415 + 0, 0, 32, 43, 0, 0, 0, 1, 43, 12, 416 + 0, 43, 0, 43, 0, 31, 0, 35, 43, 43, 417 + 43, 0, 0, 43, 0, 0, 0, 43, 43, 0, 418 + 43, 43, 0, 0, 0, 33, 34, 43, 0, 0, 419 + 0, 43, 0, 43, 0, 43, 0, 0, 43, 43, 420 + 43, 0, 43, 0, 0, 0, 43, 43, 0, 0, 421 + 43, 7, 0, 0, 0, 0, 0, 0, 0, 43, 422 + 0, 43, 0, 43, 0, 0, 28, 43, 0, 0, 423 + 43, 0, 43, 0, 0, 43, 0, 0, 0, 0, 424 424 425 - 0, 38, 0, 0, 0, 0, 9, 0, 0, 0, 426 - 1, 0, 0, 0, 38, 0, 16, 0, 0, 28, 427 - 38, 0, 11, 38, 0, 0, 0, 0, 0, 0, 428 - 0, 0, 0, 0, 38, 0, 0, 12, 38, 0, 429 - 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 430 - 0, 4, 14, 13, 0, 0, 0, 0, 0, 0, 431 - 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432 - 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 425 + 10, 0, 0, 43, 0, 43, 0, 43, 0, 0, 426 + 43, 43, 0, 0, 43, 0, 0, 0, 0, 43, 427 + 9, 0, 0, 0, 1, 0, 0, 0, 43, 0, 428 + 16, 0, 0, 28, 43, 0, 11, 43, 0, 0, 429 + 0, 0, 36, 0, 0, 0, 0, 0, 0, 43, 430 + 0, 0, 12, 43, 0, 0, 0, 0, 0, 0, 431 + 6, 0, 0, 0, 0, 0, 4, 14, 13, 0, 432 + 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 433 433 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 434 - 0, 0, 17, 0, 5, 15, 18, 0, 0, 29, 434 + 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 435 435 436 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 437 - 0, 0, 7, 3, 0, 0, 0, 2, 0, 0, 438 - 0, 0, 0, 0 436 + 0, 0, 0, 0, 0, 0, 0, 17, 0, 5, 437 + 15, 18, 0, 0, 29, 0, 0, 0, 0, 0, 438 + 0, 0, 0, 0, 0, 0, 0, 7, 3, 0, 439 + 0, 0, 2, 0, 0, 0, 0, 0, 0 439 440 } ; 440 441 441 442 static yyconst flex_int32_t yy_ec[256] = ··· 450 449 11, 1, 2, 1, 12, 13, 14, 15, 12, 12, 451 450 2, 2, 16, 2, 2, 17, 2, 2, 2, 2, 452 451 2, 18, 2, 19, 2, 2, 2, 2, 2, 2, 453 - 1, 1, 1, 1, 2, 1, 20, 21, 22, 23, 452 + 1, 1, 1, 1, 20, 1, 21, 22, 23, 24, 454 453 455 - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 456 - 34, 35, 2, 36, 37, 38, 39, 40, 41, 42, 457 - 43, 2, 1, 1, 1, 1, 1, 1, 1, 1, 454 + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 455 + 35, 36, 2, 37, 38, 39, 40, 41, 42, 43, 456 + 44, 2, 1, 1, 1, 1, 1, 1, 1, 1, 458 457 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 459 458 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 460 459 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ··· 471 470 1, 1, 1, 1, 1 472 471 } ; 473 472 474 - static yyconst flex_int32_t yy_meta[44] = 473 + static yyconst flex_int32_t yy_meta[45] = 475 474 { 0, 476 475 1, 2, 1, 1, 1, 3, 3, 3, 3, 1, 477 - 1, 3, 3, 3, 3, 2, 2, 2, 2, 3, 478 - 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 476 + 1, 3, 3, 3, 3, 2, 2, 2, 2, 2, 477 + 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 479 478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 480 - 2, 2, 2 479 + 2, 2, 2, 2 481 480 } ; 482 481 483 - static yyconst flex_int16_t yy_base[427] = 482 + static yyconst flex_int16_t yy_base[442] = 484 483 { 0, 485 - 0, 0, 494, 495, 0, 495, 495, 495, 38, 42, 486 - 495, 495, 473, 459, 45, 467, 32, 20, 40, 53, 487 - 458, 469, 34, 62, 58, 58, 454, 452, 64, 98, 488 - 32, 466, 449, 0, 0, 81, 0, 446, 446, 478, 489 - 0, 467, 455, 457, 450, 54, 457, 455, 438, 452, 490 - 440, 433, 0, 449, 432, 452, 429, 428, 97, 428, 491 - 448, 433, 426, 105, 442, 432, 428, 104, 436, 421, 492 - 431, 432, 431, 77, 430, 95, 416, 424, 0, 431, 493 - 412, 103, 425, 424, 421, 0, 413, 441, 417, 405, 494 - 438, 410, 409, 426, 407, 406, 108, 405, 422, 410, 484 + 0, 0, 510, 511, 0, 511, 511, 511, 39, 43, 485 + 511, 511, 488, 474, 46, 482, 32, 20, 37, 57, 486 + 473, 484, 34, 64, 59, 64, 469, 467, 78, 113, 487 + 41, 481, 464, 0, 0, 104, 0, 461, 461, 494, 488 + 0, 483, 470, 472, 465, 44, 472, 470, 453, 467, 489 + 455, 448, 0, 464, 447, 468, 444, 443, 64, 443, 490 + 464, 448, 441, 67, 457, 447, 443, 52, 451, 436, 491 + 446, 435, 446, 445, 76, 444, 95, 430, 438, 0, 492 + 445, 426, 100, 439, 438, 435, 0, 427, 456, 431, 493 + 105, 454, 425, 424, 442, 422, 421, 112, 420, 438, 495 494 496 - 395, 111, 0, 0, 409, 397, 420, 393, 394, 390, 497 - 402, 0, 401, 399, 93, 116, 401, 391, 385, 390, 498 - 381, 414, 381, 76, 46, 380, 378, 381, 391, 390, 499 - 387, 386, 120, 385, 387, 0, 387, 368, 119, 384, 500 - 0, 400, 367, 495, 495, 365, 365, 495, 380, 363, 501 - 374, 0, 393, 372, 371, 355, 362, 368, 387, 366, 502 - 370, 349, 349, 366, 365, 347, 359, 345, 349, 353, 503 - 336, 374, 335, 113, 348, 338, 495, 336, 336, 0, 504 - 495, 350, 332, 0, 366, 331, 364, 330, 341, 327, 505 - 333, 339, 325, 339, 0, 343, 337, 338, 335, 334, 495 + 425, 410, 117, 0, 0, 424, 412, 436, 408, 409, 496 + 405, 417, 0, 416, 411, 413, 83, 107, 415, 405, 497 + 399, 404, 395, 429, 395, 126, 119, 394, 392, 395, 498 + 405, 404, 401, 396, 399, 100, 398, 400, 0, 400, 499 + 381, 123, 397, 0, 414, 380, 511, 511, 378, 378, 500 + 511, 393, 376, 387, 0, 407, 375, 384, 383, 367, 501 + 374, 380, 400, 378, 383, 361, 361, 378, 377, 359, 502 + 371, 357, 361, 365, 348, 387, 363, 346, 73, 359, 503 + 349, 511, 347, 347, 0, 511, 361, 343, 0, 378, 504 + 342, 376, 341, 352, 353, 337, 343, 349, 335, 349, 506 505 507 - 317, 321, 329, 121, 330, 119, 313, 316, 327, 322, 508 - 0, 319, 0, 303, 323, 319, 315, 317, 0, 321, 509 - 318, 319, 315, 306, 323, 297, 307, 306, 296, 309, 510 - 297, 129, 292, 297, 299, 302, 321, 302, 292, 286, 511 - 287, 298, 281, 298, 283, 296, 276, 287, 275, 308, 512 - 277, 282, 285, 284, 268, 282, 267, 271, 275, 0, 513 - 278, 264, 275, 262, 268, 273, 276, 262, 263, 265, 514 - 253, 258, 251, 258, 264, 259, 264, 263, 250, 261, 515 - 278, 244, 243, 242, 241, 253, 235, 495, 238, 236, 516 - 269, 248, 237, 239, 232, 237, 229, 229, 225, 221, 506 + 0, 354, 347, 348, 345, 344, 327, 331, 339, 146, 507 + 340, 123, 150, 323, 326, 337, 332, 0, 329, 0, 508 + 313, 333, 329, 325, 327, 0, 331, 0, 328, 329, 509 + 325, 316, 334, 307, 317, 316, 306, 319, 307, 132, 510 + 301, 301, 306, 308, 311, 0, 0, 331, 311, 301, 511 + 295, 296, 307, 290, 307, 292, 305, 285, 296, 284, 512 + 318, 286, 291, 294, 293, 277, 291, 276, 280, 284, 513 + 268, 0, 286, 272, 283, 270, 276, 281, 284, 270, 514 + 271, 273, 261, 266, 259, 266, 272, 267, 272, 271, 515 + 258, 269, 287, 252, 251, 252, 249, 248, 260, 242, 517 516 518 - 233, 229, 223, 235, 221, 221, 495, 233, 220, 227, 519 - 495, 226, 228, 215, 218, 212, 0, 211, 211, 0, 520 - 223, 224, 495, 241, 216, 223, 206, 217, 203, 215, 521 - 200, 203, 216, 231, 197, 196, 195, 495, 227, 199, 522 - 210, 194, 188, 187, 188, 495, 191, 201, 189, 182, 523 - 138, 0, 495, 495, 129, 196, 202, 185, 186, 194, 524 - 495, 193, 187, 176, 181, 191, 174, 175, 184, 170, 525 - 193, 167, 166, 179, 178, 495, 163, 178, 165, 178, 526 - 177, 192, 158, 166, 156, 155, 154, 160, 156, 165, 527 - 164, 141, 495, 152, 495, 495, 495, 161, 146, 495, 517 + 511, 245, 243, 277, 255, 244, 246, 239, 244, 236, 518 + 236, 232, 228, 240, 236, 230, 242, 228, 228, 240, 519 + 511, 239, 226, 233, 511, 232, 234, 221, 224, 218, 520 + 0, 217, 217, 0, 229, 230, 511, 248, 222, 229, 521 + 212, 223, 0, 209, 221, 206, 209, 222, 238, 203, 522 + 202, 201, 511, 234, 205, 217, 200, 194, 193, 194, 523 + 511, 197, 207, 195, 188, 142, 0, 511, 511, 130, 524 + 202, 209, 191, 192, 200, 511, 199, 193, 182, 187, 525 + 197, 180, 181, 190, 176, 200, 173, 172, 185, 184, 526 + 511, 169, 184, 171, 184, 183, 199, 164, 172, 162, 528 527 529 - 163, 146, 148, 147, 155, 156, 143, 139, 152, 141, 530 - 143, 139, 495, 495, 148, 146, 131, 495, 131, 126, 531 - 125, 81, 85, 495, 165, 68 528 + 161, 160, 166, 162, 171, 170, 147, 511, 158, 511, 529 + 511, 511, 167, 152, 511, 169, 152, 154, 153, 161, 530 + 162, 149, 145, 158, 147, 149, 145, 511, 511, 154, 531 + 152, 137, 511, 138, 145, 131, 53, 54, 511, 172, 532 + 66 532 533 } ; 533 534 534 - static yyconst flex_int16_t yy_def[427] = 535 + static yyconst flex_int16_t yy_def[442] = 535 536 { 0, 536 - 424, 1, 424, 424, 425, 424, 424, 424, 424, 424, 537 - 424, 424, 425, 425, 425, 425, 425, 425, 425, 425, 538 - 425, 425, 425, 425, 425, 425, 425, 425, 425, 425, 539 - 425, 425, 425, 425, 425, 424, 426, 425, 425, 425, 540 - 425, 425, 425, 425, 425, 425, 425, 425, 425, 425, 541 - 425, 425, 425, 425, 424, 425, 425, 425, 425, 424, 542 - 425, 425, 425, 425, 425, 425, 425, 425, 425, 425, 543 - 425, 425, 30, 30, 425, 425, 425, 425, 426, 425, 544 - 425, 424, 425, 425, 425, 425, 425, 425, 425, 425, 545 - 425, 425, 424, 425, 425, 425, 425, 424, 425, 425, 537 + 439, 1, 439, 439, 440, 439, 439, 439, 439, 439, 538 + 439, 439, 440, 440, 440, 440, 440, 440, 440, 440, 539 + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, 540 + 440, 440, 440, 440, 440, 439, 441, 440, 440, 440, 541 + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, 542 + 440, 440, 440, 440, 439, 440, 440, 440, 440, 439, 543 + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, 544 + 440, 440, 440, 30, 30, 440, 440, 440, 440, 441, 545 + 440, 440, 439, 440, 440, 440, 440, 440, 440, 440, 546 + 440, 440, 440, 439, 440, 440, 440, 440, 439, 440, 546 547 547 - 425, 424, 425, 425, 425, 425, 425, 425, 425, 425, 548 - 425, 425, 425, 425, 30, 30, 425, 425, 425, 425, 549 - 425, 425, 425, 424, 424, 425, 425, 425, 425, 424, 550 - 425, 425, 424, 425, 424, 425, 425, 425, 425, 424, 551 - 425, 425, 425, 424, 424, 425, 425, 424, 425, 425, 552 - 425, 425, 425, 425, 30, 425, 425, 425, 425, 425, 553 - 424, 425, 424, 424, 424, 424, 425, 425, 425, 425, 554 - 424, 425, 425, 424, 424, 425, 424, 425, 425, 425, 555 - 424, 424, 425, 425, 425, 425, 425, 425, 424, 425, 556 - 425, 425, 425, 424, 425, 424, 425, 424, 424, 424, 548 + 440, 440, 439, 440, 440, 440, 440, 440, 440, 440, 549 + 440, 440, 440, 440, 440, 440, 30, 30, 440, 440, 550 + 440, 440, 440, 440, 440, 439, 439, 440, 440, 440, 551 + 440, 439, 440, 440, 440, 439, 440, 439, 440, 440, 552 + 440, 440, 439, 440, 440, 440, 439, 439, 440, 440, 553 + 439, 440, 440, 440, 440, 440, 440, 440, 30, 440, 554 + 440, 440, 440, 440, 439, 440, 439, 439, 439, 439, 555 + 440, 440, 440, 440, 439, 440, 440, 440, 439, 439, 556 + 440, 439, 440, 440, 440, 439, 439, 440, 440, 440, 557 + 440, 440, 440, 439, 440, 440, 440, 440, 440, 439, 557 558 558 - 424, 425, 425, 425, 424, 424, 425, 424, 424, 424, 559 - 425, 425, 425, 424, 425, 424, 425, 424, 425, 424, 560 - 425, 425, 425, 424, 424, 425, 424, 424, 424, 425, 561 - 425, 424, 425, 424, 424, 424, 425, 424, 424, 424, 562 - 425, 424, 425, 424, 425, 424, 424, 425, 425, 425, 563 - 424, 425, 424, 424, 424, 425, 425, 424, 424, 425, 564 - 424, 424, 424, 424, 424, 424, 424, 425, 424, 425, 565 - 424, 425, 424, 424, 425, 425, 424, 424, 425, 424, 566 - 425, 424, 424, 424, 424, 424, 424, 424, 424, 424, 567 - 425, 424, 425, 424, 425, 424, 424, 425, 425, 424, 559 + 440, 439, 440, 439, 439, 439, 439, 440, 440, 440, 560 + 439, 439, 440, 440, 439, 439, 439, 440, 440, 440, 561 + 439, 440, 439, 440, 439, 440, 439, 440, 440, 440, 562 + 440, 439, 439, 440, 439, 439, 439, 440, 440, 439, 563 + 440, 440, 439, 439, 439, 440, 440, 440, 439, 439, 564 + 439, 440, 439, 440, 439, 440, 439, 439, 440, 440, 565 + 440, 439, 440, 439, 439, 439, 440, 440, 439, 439, 566 + 440, 440, 439, 439, 439, 439, 439, 439, 439, 440, 567 + 439, 440, 439, 440, 439, 439, 440, 440, 439, 439, 568 + 440, 439, 440, 439, 439, 440, 439, 439, 439, 439, 568 569 569 - 424, 425, 424, 424, 424, 424, 424, 424, 424, 424, 570 - 424, 424, 424, 424, 425, 424, 425, 424, 424, 425, 571 - 425, 424, 424, 425, 424, 424, 424, 424, 424, 424, 572 - 424, 424, 424, 424, 425, 424, 424, 424, 425, 424, 573 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 574 - 424, 425, 424, 424, 424, 424, 424, 424, 424, 424, 575 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 576 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 577 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 578 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 570 + 439, 439, 439, 440, 439, 440, 439, 440, 439, 439, 571 + 440, 440, 439, 439, 440, 439, 439, 439, 439, 440, 572 + 439, 439, 439, 439, 439, 439, 439, 439, 440, 439, 573 + 440, 439, 439, 440, 440, 439, 439, 440, 439, 439, 574 + 439, 439, 440, 439, 439, 439, 439, 439, 439, 440, 575 + 439, 439, 439, 440, 439, 439, 439, 439, 439, 439, 576 + 439, 439, 439, 439, 439, 439, 440, 439, 439, 439, 577 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 578 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 579 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 579 580 580 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 581 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 582 - 424, 424, 424, 0, 424, 424 581 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 582 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 583 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 584 + 439, 439, 439, 439, 439, 439, 439, 439, 0, 439, 585 + 439 583 586 } ; 584 587 585 - static yyconst flex_int16_t yy_nxt[539] = 588 + static yyconst flex_int16_t yy_nxt[556] = 586 589 { 0, 587 590 4, 5, 6, 7, 8, 9, 10, 10, 10, 11, 588 - 12, 5, 5, 5, 13, 14, 15, 16, 5, 17, 589 - 18, 19, 20, 21, 22, 5, 23, 24, 5, 23, 590 - 25, 26, 27, 28, 29, 30, 31, 32, 23, 5, 591 - 33, 34, 5, 36, 36, 36, 36, 36, 36, 36, 592 - 36, 40, 41, 44, 46, 47, 55, 48, 49, 50, 593 - 59, 42, 45, 59, 64, 60, 75, 165, 59, 76, 594 - 79, 56, 59, 51, 52, 86, 53, 66, 166, 37, 595 - 61, 67, 54, 71, 62, 68, 36, 36, 36, 36, 596 - 59, 65, 86, 59, 63, 163, 115, 164, 59, 72, 591 + 12, 5, 5, 5, 13, 14, 15, 16, 5, 5, 592 + 17, 18, 19, 20, 21, 22, 5, 23, 24, 5, 593 + 23, 25, 26, 27, 28, 29, 30, 31, 32, 23, 594 + 5, 33, 34, 5, 36, 36, 36, 36, 36, 36, 595 + 36, 36, 40, 41, 44, 46, 47, 50, 48, 49, 596 + 55, 59, 42, 45, 59, 64, 87, 60, 80, 59, 597 + 103, 51, 52, 59, 53, 56, 76, 433, 109, 77, 598 + 54, 37, 61, 87, 66, 110, 438, 62, 67, 111, 599 + 104, 98, 68, 65, 98, 105, 117, 63, 71, 98, 597 600 598 - 73, 116, 59, 73, 73, 73, 73, 418, 102, 73, 599 - 73, 73, 73, 423, 118, 155, 73, 73, 73, 73, 600 - 73, 74, 73, 97, 232, 124, 97, 103, 119, 108, 601 - 125, 97, 104, 144, 139, 97, 109, 139, 145, 73, 602 - 110, 174, 139, 208, 233, 180, 139, 414, 180, 422, 603 - 235, 175, 112, 180, 236, 209, 258, 180, 366, 368, 604 - 259, 401, 367, 421, 369, 402, 35, 35, 420, 419, 605 - 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, 606 - 408, 407, 406, 405, 404, 403, 400, 400, 399, 398, 607 - 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, 601 + 74, 118, 72, 98, 215, 59, 159, 74, 59, 36, 602 + 36, 36, 36, 59, 73, 120, 216, 59, 74, 74, 603 + 74, 74, 179, 126, 74, 74, 74, 74, 127, 121, 604 + 134, 74, 180, 74, 74, 74, 74, 75, 74, 142, 605 + 147, 169, 142, 135, 113, 148, 167, 142, 168, 240, 606 + 185, 142, 170, 185, 429, 244, 246, 247, 185, 245, 607 + 269, 383, 185, 381, 270, 241, 384, 382, 416, 437, 608 + 242, 436, 417, 35, 35, 435, 434, 433, 432, 431, 609 + 430, 429, 428, 427, 426, 425, 424, 423, 422, 421, 610 + 420, 419, 418, 415, 415, 414, 413, 412, 411, 410, 608 611 609 - 387, 386, 385, 384, 383, 181, 382, 381, 380, 379, 610 - 378, 377, 376, 375, 374, 373, 372, 145, 371, 370, 611 - 365, 364, 363, 362, 361, 360, 359, 358, 357, 356, 612 - 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, 613 - 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, 614 - 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 615 - 325, 324, 323, 322, 321, 320, 319, 318, 317, 316, 616 - 315, 314, 313, 312, 311, 310, 309, 308, 307, 306, 617 - 305, 304, 303, 302, 301, 300, 299, 298, 297, 296, 618 - 295, 294, 293, 292, 291, 290, 289, 288, 287, 286, 612 + 409, 408, 407, 406, 405, 404, 403, 402, 401, 400, 613 + 399, 398, 186, 397, 396, 395, 394, 393, 392, 391, 614 + 390, 389, 388, 387, 148, 386, 385, 380, 379, 378, 615 + 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, 616 + 367, 366, 365, 364, 363, 362, 361, 360, 359, 358, 617 + 357, 356, 355, 354, 353, 352, 351, 350, 349, 348, 618 + 347, 346, 345, 344, 343, 342, 341, 340, 339, 338, 619 + 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, 620 + 327, 326, 325, 324, 323, 322, 321, 320, 319, 318, 621 + 317, 316, 315, 314, 313, 312, 311, 310, 309, 308, 619 622 620 - 285, 284, 283, 282, 281, 112, 280, 145, 144, 279, 621 - 278, 277, 276, 275, 274, 273, 272, 271, 270, 269, 622 - 268, 267, 266, 265, 264, 263, 262, 261, 260, 257, 623 - 256, 255, 254, 253, 252, 177, 251, 250, 249, 248, 624 - 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 625 - 237, 234, 231, 230, 229, 228, 227, 144, 226, 225, 626 - 224, 195, 223, 222, 221, 220, 219, 218, 217, 216, 627 - 215, 214, 213, 212, 211, 210, 207, 206, 205, 204, 628 - 203, 112, 202, 201, 200, 199, 198, 197, 196, 195, 629 - 194, 193, 192, 191, 73, 190, 189, 188, 187, 186, 623 + 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, 624 + 297, 296, 295, 294, 293, 113, 292, 148, 147, 291, 625 + 290, 289, 288, 287, 286, 285, 284, 283, 282, 281, 626 + 280, 279, 278, 277, 276, 275, 274, 273, 272, 271, 627 + 268, 267, 266, 265, 264, 263, 182, 262, 261, 260, 628 + 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, 629 + 249, 248, 243, 239, 238, 237, 236, 235, 147, 234, 630 + 233, 232, 201, 231, 230, 229, 228, 227, 226, 225, 631 + 224, 223, 222, 221, 220, 219, 218, 217, 214, 213, 632 + 212, 211, 210, 209, 113, 208, 207, 206, 205, 204, 630 633 631 - 185, 184, 183, 182, 181, 179, 178, 177, 176, 173, 632 - 172, 171, 170, 169, 168, 167, 162, 161, 160, 159, 633 - 158, 157, 156, 154, 153, 152, 151, 150, 149, 148, 634 - 147, 146, 143, 142, 141, 140, 138, 137, 136, 135, 635 - 134, 133, 132, 131, 130, 129, 128, 127, 126, 123, 636 - 122, 121, 120, 117, 73, 114, 113, 112, 111, 107, 637 - 106, 105, 101, 100, 99, 98, 96, 95, 94, 93, 638 - 92, 91, 90, 89, 88, 86, 87, 85, 84, 83, 639 - 41, 82, 81, 80, 78, 77, 70, 69, 58, 57, 640 - 43, 39, 38, 424, 3, 424, 424, 424, 424, 424, 634 + 203, 202, 201, 200, 199, 198, 197, 74, 196, 195, 635 + 194, 193, 192, 191, 190, 189, 188, 187, 186, 184, 636 + 183, 182, 181, 178, 177, 176, 175, 174, 173, 172, 637 + 171, 166, 165, 164, 163, 162, 161, 160, 158, 157, 638 + 156, 155, 154, 153, 152, 151, 150, 149, 146, 145, 639 + 144, 143, 141, 140, 139, 138, 137, 136, 133, 132, 640 + 131, 130, 129, 128, 125, 124, 123, 122, 119, 74, 641 + 116, 115, 114, 113, 112, 108, 107, 106, 102, 101, 642 + 100, 99, 97, 96, 95, 94, 93, 92, 91, 90, 643 + 89, 87, 88, 86, 85, 84, 41, 83, 82, 81, 641 644 642 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 643 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 644 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 645 - 424, 424, 424, 424, 424, 424, 424, 424 645 + 79, 78, 70, 69, 58, 57, 43, 39, 38, 439, 646 + 3, 439, 439, 439, 439, 439, 439, 439, 439, 439, 647 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 648 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 649 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 650 + 439, 439, 439, 439, 439 646 651 } ; 647 652 648 - static yyconst flex_int16_t yy_chk[539] = 653 + static yyconst flex_int16_t yy_chk[556] = 649 654 { 0, 650 655 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 651 656 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 652 657 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 653 658 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 654 - 1, 1, 1, 9, 9, 9, 9, 10, 10, 10, 655 - 10, 15, 15, 17, 18, 18, 20, 18, 18, 19, 656 - 23, 15, 17, 23, 25, 24, 31, 125, 23, 31, 657 - 426, 20, 23, 19, 19, 46, 19, 26, 125, 9, 658 - 24, 26, 19, 29, 24, 26, 36, 36, 36, 36, 659 - 29, 25, 46, 29, 24, 124, 74, 124, 29, 29, 659 + 1, 1, 1, 1, 9, 9, 9, 9, 10, 10, 660 + 10, 10, 15, 15, 17, 18, 18, 19, 18, 18, 661 + 20, 23, 15, 17, 23, 25, 46, 24, 441, 23, 662 + 64, 19, 19, 23, 19, 20, 31, 438, 68, 31, 663 + 19, 9, 24, 46, 26, 68, 437, 24, 26, 68, 664 + 64, 59, 26, 25, 59, 64, 75, 24, 29, 59, 660 665 661 - 74, 74, 29, 30, 30, 30, 30, 423, 64, 30, 662 - 30, 30, 30, 422, 76, 115, 115, 30, 30, 30, 663 - 30, 30, 30, 59, 204, 82, 59, 64, 76, 68, 664 - 82, 59, 64, 102, 97, 59, 68, 97, 102, 116, 665 - 68, 133, 97, 174, 204, 139, 97, 421, 139, 420, 666 - 206, 133, 116, 139, 206, 174, 232, 139, 351, 355, 667 - 232, 392, 351, 419, 355, 392, 425, 425, 417, 416, 668 - 415, 412, 411, 410, 409, 408, 407, 406, 405, 404, 669 - 403, 402, 401, 399, 398, 394, 391, 390, 389, 388, 670 - 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, 666 + 75, 75, 29, 59, 179, 29, 117, 117, 29, 36, 667 + 36, 36, 36, 29, 29, 77, 179, 29, 30, 30, 668 + 30, 30, 136, 83, 30, 30, 30, 30, 83, 77, 669 + 91, 118, 136, 30, 30, 30, 30, 30, 30, 98, 670 + 103, 127, 98, 91, 118, 103, 126, 98, 126, 210, 671 + 142, 98, 127, 142, 436, 212, 213, 213, 142, 212, 672 + 240, 370, 142, 366, 240, 210, 370, 366, 407, 435, 673 + 210, 434, 407, 440, 440, 432, 431, 430, 427, 426, 674 + 425, 424, 423, 422, 421, 420, 419, 418, 417, 416, 675 + 414, 413, 409, 406, 405, 404, 403, 402, 401, 400, 671 676 672 - 377, 375, 374, 373, 372, 371, 370, 369, 368, 367, 673 - 366, 365, 364, 363, 362, 360, 359, 358, 357, 356, 674 - 350, 349, 348, 347, 345, 344, 343, 342, 341, 340, 675 - 339, 337, 336, 335, 334, 333, 332, 331, 330, 329, 676 - 328, 327, 326, 325, 324, 322, 321, 319, 318, 316, 677 - 315, 314, 313, 312, 310, 309, 308, 306, 305, 304, 678 - 303, 302, 301, 300, 299, 298, 297, 296, 295, 294, 679 - 293, 292, 291, 290, 289, 287, 286, 285, 284, 283, 680 - 282, 281, 280, 279, 278, 277, 276, 275, 274, 273, 681 - 272, 271, 270, 269, 268, 267, 266, 265, 264, 263, 677 + 399, 398, 397, 396, 395, 394, 393, 392, 390, 389, 678 + 388, 387, 386, 385, 384, 383, 382, 381, 380, 379, 679 + 378, 377, 375, 374, 373, 372, 371, 365, 364, 363, 680 + 362, 360, 359, 358, 357, 356, 355, 354, 352, 351, 681 + 350, 349, 348, 347, 346, 345, 344, 342, 341, 340, 682 + 339, 338, 336, 335, 333, 332, 330, 329, 328, 327, 683 + 326, 324, 323, 322, 320, 319, 318, 317, 316, 315, 684 + 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, 685 + 304, 303, 302, 300, 299, 298, 297, 296, 295, 294, 686 + 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, 682 687 683 - 262, 261, 259, 258, 257, 256, 255, 254, 253, 252, 684 - 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 685 - 241, 240, 239, 238, 237, 236, 235, 234, 233, 231, 686 - 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 687 - 220, 218, 217, 216, 215, 214, 212, 210, 209, 208, 688 - 207, 205, 203, 202, 201, 200, 199, 198, 197, 196, 689 - 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 690 - 183, 182, 179, 178, 176, 175, 173, 172, 171, 170, 691 - 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 692 - 159, 158, 157, 156, 155, 154, 153, 151, 150, 149, 688 + 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, 689 + 273, 271, 270, 269, 268, 267, 266, 265, 264, 263, 690 + 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 691 + 252, 251, 250, 249, 248, 245, 244, 243, 242, 241, 692 + 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 693 + 229, 227, 225, 224, 223, 222, 221, 219, 217, 216, 694 + 215, 214, 211, 209, 208, 207, 206, 205, 204, 203, 695 + 202, 200, 199, 198, 197, 196, 195, 194, 193, 192, 696 + 191, 190, 188, 187, 184, 183, 181, 180, 178, 177, 697 + 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 693 698 694 - 147, 146, 143, 142, 140, 138, 137, 135, 134, 132, 695 - 131, 130, 129, 128, 127, 126, 123, 122, 121, 120, 696 - 119, 118, 117, 114, 113, 111, 110, 109, 108, 107, 697 - 106, 105, 101, 100, 99, 98, 96, 95, 94, 93, 698 - 92, 91, 90, 89, 88, 87, 85, 84, 83, 81, 699 - 80, 78, 77, 75, 73, 72, 71, 70, 69, 67, 700 - 66, 65, 63, 62, 61, 60, 58, 57, 56, 55, 701 - 54, 52, 51, 50, 49, 48, 47, 45, 44, 43, 702 - 42, 40, 39, 38, 33, 32, 28, 27, 22, 21, 703 - 16, 14, 13, 3, 424, 424, 424, 424, 424, 424, 699 + 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 700 + 156, 154, 153, 152, 150, 149, 146, 145, 143, 141, 701 + 140, 138, 137, 135, 134, 133, 132, 131, 130, 129, 702 + 128, 125, 124, 123, 122, 121, 120, 119, 116, 115, 703 + 114, 112, 111, 110, 109, 108, 107, 106, 102, 101, 704 + 100, 99, 97, 96, 95, 94, 93, 92, 90, 89, 705 + 88, 86, 85, 84, 82, 81, 79, 78, 76, 74, 706 + 73, 72, 71, 70, 69, 67, 66, 65, 63, 62, 707 + 61, 60, 58, 57, 56, 55, 54, 52, 51, 50, 708 + 49, 48, 47, 45, 44, 43, 42, 40, 39, 38, 704 709 705 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 706 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 707 - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 708 - 424, 424, 424, 424, 424, 424, 424, 424 710 + 33, 32, 28, 27, 22, 21, 16, 14, 13, 3, 711 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 712 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 713 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 714 + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, 715 + 439, 439, 439, 439, 439 709 716 } ; 710 717 711 718 static yy_state_type yy_last_accepting_state; ··· 735 726 #include <errno.h> 736 727 #include "../perf.h" 737 728 #include "parse-events-bison.h" 729 + #include "parse-events.h" 738 730 739 731 static int __value(char *str, int base, int token) 740 732 { ··· 772 762 return PE_VALUE_SYM; 773 763 } 774 764 775 - #line 766 "<stdout>" 765 + static int term(int type) 766 + { 767 + parse_events_lval.num = type; 768 + return PE_TERM; 769 + } 770 + 771 + #line 782 "<stdout>" 776 772 777 773 #define INITIAL 0 778 774 ··· 960 944 register char *yy_cp, *yy_bp; 961 945 register int yy_act; 962 946 963 - #line 53 "util/parse-events.l" 947 + #line 60 "util/parse-events.l" 964 948 965 - #line 950 "<stdout>" 949 + #line 966 "<stdout>" 966 950 967 951 if ( !(yy_init) ) 968 952 { ··· 1015 999 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1016 1000 { 1017 1001 yy_current_state = (int) yy_def[yy_current_state]; 1018 - if ( yy_current_state >= 425 ) 1002 + if ( yy_current_state >= 440 ) 1019 1003 yy_c = yy_meta[(unsigned int) yy_c]; 1020 1004 } 1021 1005 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1022 1006 ++yy_cp; 1023 1007 } 1024 - while ( yy_base[yy_current_state] != 495 ); 1008 + while ( yy_base[yy_current_state] != 511 ); 1025 1009 1026 1010 yy_find_action: 1027 1011 yy_act = yy_accept[yy_current_state]; ··· 1047 1031 1048 1032 case 1: 1049 1033 YY_RULE_SETUP 1050 - #line 54 "util/parse-events.l" 1034 + #line 61 "util/parse-events.l" 1051 1035 { return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_CPU_CYCLES); } 1052 1036 YY_BREAK 1053 1037 case 2: 1054 1038 YY_RULE_SETUP 1055 - #line 55 "util/parse-events.l" 1039 + #line 62 "util/parse-events.l" 1056 1040 { return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_STALLED_CYCLES_FRONTEND); } 1057 1041 YY_BREAK 1058 1042 case 3: 1059 1043 YY_RULE_SETUP 1060 - #line 56 "util/parse-events.l" 1044 + #line 63 "util/parse-events.l" 1061 1045 { return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_STALLED_CYCLES_BACKEND); } 1062 1046 YY_BREAK 1063 1047 case 4: 1064 1048 YY_RULE_SETUP 1065 - #line 57 "util/parse-events.l" 1049 + #line 64 "util/parse-events.l" 1066 1050 { return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_INSTRUCTIONS); } 1067 1051 YY_BREAK 1068 1052 case 5: 1069 1053 YY_RULE_SETUP 1070 - #line 58 "util/parse-events.l" 1054 + #line 65 "util/parse-events.l" 1071 1055 { return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_CACHE_REFERENCES); } 1072 1056 YY_BREAK 1073 1057 case 6: 1074 1058 YY_RULE_SETUP 1075 - #line 59 "util/parse-events.l" 1059 + #line 66 "util/parse-events.l" 1076 1060 { return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_CACHE_MISSES); } 1077 1061 YY_BREAK 1078 1062 case 7: 1079 1063 YY_RULE_SETUP 1080 - #line 60 "util/parse-events.l" 1064 + #line 67 "util/parse-events.l" 1081 1065 { return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_BRANCH_INSTRUCTIONS); } 1082 1066 YY_BREAK 1083 1067 case 8: 1084 1068 YY_RULE_SETUP 1085 - #line 61 "util/parse-events.l" 1069 + #line 68 "util/parse-events.l" 1086 1070 { return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_BRANCH_MISSES); } 1087 1071 YY_BREAK 1088 1072 case 9: 1089 1073 YY_RULE_SETUP 1090 - #line 62 "util/parse-events.l" 1074 + #line 69 "util/parse-events.l" 1091 1075 { return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_BUS_CYCLES); } 1092 1076 YY_BREAK 1093 1077 case 10: 1094 1078 YY_RULE_SETUP 1095 - #line 63 "util/parse-events.l" 1079 + #line 70 "util/parse-events.l" 1096 1080 { return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_CPU_CLOCK); } 1097 1081 YY_BREAK 1098 1082 case 11: 1099 1083 YY_RULE_SETUP 1100 - #line 64 "util/parse-events.l" 1084 + #line 71 "util/parse-events.l" 1101 1085 { return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_TASK_CLOCK); } 1102 1086 YY_BREAK 1103 1087 case 12: 1104 1088 YY_RULE_SETUP 1105 - #line 65 "util/parse-events.l" 1089 + #line 72 "util/parse-events.l" 1106 1090 { return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_PAGE_FAULTS); } 1107 1091 YY_BREAK 1108 1092 case 13: 1109 1093 YY_RULE_SETUP 1110 - #line 66 "util/parse-events.l" 1094 + #line 73 "util/parse-events.l" 1111 1095 { return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_PAGE_FAULTS_MIN); } 1112 1096 YY_BREAK 1113 1097 case 14: 1114 1098 YY_RULE_SETUP 1115 - #line 67 "util/parse-events.l" 1099 + #line 74 "util/parse-events.l" 1116 1100 { return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_PAGE_FAULTS_MAJ); } 1117 1101 YY_BREAK 1118 1102 case 15: 1119 1103 YY_RULE_SETUP 1120 - #line 68 "util/parse-events.l" 1104 + #line 75 "util/parse-events.l" 1121 1105 { return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_CONTEXT_SWITCHES); } 1122 1106 YY_BREAK 1123 1107 case 16: 1124 1108 YY_RULE_SETUP 1125 - #line 69 "util/parse-events.l" 1109 + #line 76 "util/parse-events.l" 1126 1110 { return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_CPU_MIGRATIONS); } 1127 1111 YY_BREAK 1128 1112 case 17: 1129 1113 YY_RULE_SETUP 1130 - #line 70 "util/parse-events.l" 1114 + #line 77 "util/parse-events.l" 1131 1115 { return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_ALIGNMENT_FAULTS); } 1132 1116 YY_BREAK 1133 1117 case 18: 1134 1118 YY_RULE_SETUP 1135 - #line 71 "util/parse-events.l" 1119 + #line 78 "util/parse-events.l" 1136 1120 { return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_EMULATION_FAULTS); } 1137 1121 YY_BREAK 1138 1122 case 19: 1139 - #line 74 "util/parse-events.l" 1123 + #line 81 "util/parse-events.l" 1140 1124 case 20: 1141 - #line 75 "util/parse-events.l" 1125 + #line 82 "util/parse-events.l" 1142 1126 case 21: 1143 - #line 76 "util/parse-events.l" 1127 + #line 83 "util/parse-events.l" 1144 1128 case 22: 1145 - #line 77 "util/parse-events.l" 1129 + #line 84 "util/parse-events.l" 1146 1130 case 23: 1147 - #line 78 "util/parse-events.l" 1131 + #line 85 "util/parse-events.l" 1148 1132 case 24: 1149 - #line 79 "util/parse-events.l" 1133 + #line 86 "util/parse-events.l" 1150 1134 case 25: 1151 1135 YY_RULE_SETUP 1152 - #line 79 "util/parse-events.l" 1136 + #line 86 "util/parse-events.l" 1153 1137 { return str(PE_NAME_CACHE_TYPE); } 1154 1138 YY_BREAK 1155 1139 case 26: 1156 - #line 82 "util/parse-events.l" 1140 + #line 89 "util/parse-events.l" 1157 1141 case 27: 1158 - #line 83 "util/parse-events.l" 1142 + #line 90 "util/parse-events.l" 1159 1143 case 28: 1160 - #line 84 "util/parse-events.l" 1144 + #line 91 "util/parse-events.l" 1161 1145 case 29: 1162 - #line 85 "util/parse-events.l" 1146 + #line 92 "util/parse-events.l" 1163 1147 case 30: 1164 - #line 86 "util/parse-events.l" 1148 + #line 93 "util/parse-events.l" 1165 1149 case 31: 1166 1150 YY_RULE_SETUP 1167 - #line 86 "util/parse-events.l" 1151 + #line 93 "util/parse-events.l" 1168 1152 { return str(PE_NAME_CACHE_OP_RESULT); } 1169 1153 YY_BREAK 1154 + /* 1155 + * These are event config hardcoded term names to be specified 1156 + * within xxx/.../ syntax. So far we dont clash with other names, 1157 + * so we can put them here directly. In case the we have a conflict 1158 + * in future, this needs to go into '//' condition block. 1159 + */ 1170 1160 case 32: 1171 1161 YY_RULE_SETUP 1172 - #line 88 "util/parse-events.l" 1173 - { return PE_PREFIX_MEM; } 1162 + #line 101 "util/parse-events.l" 1163 + { return term(PARSE_EVENTS__TERM_TYPE_CONFIG); } 1174 1164 YY_BREAK 1175 1165 case 33: 1176 1166 YY_RULE_SETUP 1177 - #line 89 "util/parse-events.l" 1178 - { return raw(); } 1167 + #line 102 "util/parse-events.l" 1168 + { return term(PARSE_EVENTS__TERM_TYPE_CONFIG1); } 1179 1169 YY_BREAK 1180 1170 case 34: 1181 1171 YY_RULE_SETUP 1182 - #line 90 "util/parse-events.l" 1183 - { return value(10); } 1172 + #line 103 "util/parse-events.l" 1173 + { return term(PARSE_EVENTS__TERM_TYPE_CONFIG2); } 1184 1174 YY_BREAK 1185 1175 case 35: 1186 1176 YY_RULE_SETUP 1187 - #line 91 "util/parse-events.l" 1188 - { return value(16); } 1177 + #line 104 "util/parse-events.l" 1178 + { return term(PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD); } 1189 1179 YY_BREAK 1190 1180 case 36: 1191 1181 YY_RULE_SETUP 1192 - #line 93 "util/parse-events.l" 1193 - { return str(PE_MODIFIER_EVENT); } 1182 + #line 105 "util/parse-events.l" 1183 + { return term(PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE); } 1194 1184 YY_BREAK 1195 1185 case 37: 1196 1186 YY_RULE_SETUP 1197 - #line 94 "util/parse-events.l" 1198 - { return str(PE_MODIFIER_BP); } 1187 + #line 107 "util/parse-events.l" 1188 + { return PE_PREFIX_MEM; } 1199 1189 YY_BREAK 1200 1190 case 38: 1201 1191 YY_RULE_SETUP 1202 - #line 95 "util/parse-events.l" 1203 - { return str(PE_NAME); } 1192 + #line 108 "util/parse-events.l" 1193 + { return raw(); } 1204 1194 YY_BREAK 1205 1195 case 39: 1206 1196 YY_RULE_SETUP 1207 - #line 96 "util/parse-events.l" 1208 - { return '/'; } 1197 + #line 109 "util/parse-events.l" 1198 + { return value(10); } 1209 1199 YY_BREAK 1210 1200 case 40: 1211 1201 YY_RULE_SETUP 1212 - #line 97 "util/parse-events.l" 1213 - { return '-'; } 1202 + #line 110 "util/parse-events.l" 1203 + { return value(16); } 1214 1204 YY_BREAK 1215 1205 case 41: 1216 1206 YY_RULE_SETUP 1217 - #line 98 "util/parse-events.l" 1218 - { return ','; } 1207 + #line 112 "util/parse-events.l" 1208 + { return str(PE_MODIFIER_EVENT); } 1219 1209 YY_BREAK 1220 1210 case 42: 1221 1211 YY_RULE_SETUP 1222 - #line 99 "util/parse-events.l" 1223 - { return ':'; } 1212 + #line 113 "util/parse-events.l" 1213 + { return str(PE_MODIFIER_BP); } 1224 1214 YY_BREAK 1225 1215 case 43: 1226 1216 YY_RULE_SETUP 1227 - #line 100 "util/parse-events.l" 1228 - { return '='; } 1217 + #line 114 "util/parse-events.l" 1218 + { return str(PE_NAME); } 1229 1219 YY_BREAK 1230 1220 case 44: 1231 1221 YY_RULE_SETUP 1232 - #line 102 "util/parse-events.l" 1222 + #line 115 "util/parse-events.l" 1223 + { return '/'; } 1224 + YY_BREAK 1225 + case 45: 1226 + YY_RULE_SETUP 1227 + #line 116 "util/parse-events.l" 1228 + { return '-'; } 1229 + YY_BREAK 1230 + case 46: 1231 + YY_RULE_SETUP 1232 + #line 117 "util/parse-events.l" 1233 + { return ','; } 1234 + YY_BREAK 1235 + case 47: 1236 + YY_RULE_SETUP 1237 + #line 118 "util/parse-events.l" 1238 + { return ':'; } 1239 + YY_BREAK 1240 + case 48: 1241 + YY_RULE_SETUP 1242 + #line 119 "util/parse-events.l" 1243 + { return '='; } 1244 + YY_BREAK 1245 + case 49: 1246 + YY_RULE_SETUP 1247 + #line 121 "util/parse-events.l" 1233 1248 ECHO; 1234 1249 YY_BREAK 1235 - #line 1220 "<stdout>" 1250 + #line 1267 "<stdout>" 1236 1251 case YY_STATE_EOF(INITIAL): 1237 1252 yyterminate(); 1238 1253 ··· 1555 1508 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1556 1509 { 1557 1510 yy_current_state = (int) yy_def[yy_current_state]; 1558 - if ( yy_current_state >= 425 ) 1511 + if ( yy_current_state >= 440 ) 1559 1512 yy_c = yy_meta[(unsigned int) yy_c]; 1560 1513 } 1561 1514 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ··· 1583 1536 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1584 1537 { 1585 1538 yy_current_state = (int) yy_def[yy_current_state]; 1586 - if ( yy_current_state >= 425 ) 1539 + if ( yy_current_state >= 440 ) 1587 1540 yy_c = yy_meta[(unsigned int) yy_c]; 1588 1541 } 1589 1542 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1590 - yy_is_jam = (yy_current_state == 424); 1543 + yy_is_jam = (yy_current_state == 439); 1591 1544 1592 1545 return yy_is_jam ? 0 : yy_current_state; 1593 1546 } ··· 2261 2214 2262 2215 #define YYTABLES_NAME "yytables" 2263 2216 2264 - #line 102 "util/parse-events.l" 2217 + #line 121 "util/parse-events.l" 2265 2218 2266 2219 2267 2220
+1 -1
tools/perf/util/parse-events-flex.h
··· 308 308 #undef YY_DECL 309 309 #endif 310 310 311 - #line 102 "util/parse-events.l" 311 + #line 121 "util/parse-events.l" 312 312 313 313 314 314 #line 315 "util/parse-events-flex.h"
+96 -3
tools/perf/util/parse-events.c
··· 588 588 return add_event(list, idx, &attr, name); 589 589 } 590 590 591 - int 592 - parse_events_add_numeric(struct list_head *list, int *idx, 593 - unsigned long type, unsigned long config) 591 + static int config_term(struct perf_event_attr *attr, 592 + struct parse_events__term *term) 593 + { 594 + switch (term->type) { 595 + case PARSE_EVENTS__TERM_TYPE_CONFIG: 596 + attr->config = term->val.num; 597 + break; 598 + case PARSE_EVENTS__TERM_TYPE_CONFIG1: 599 + attr->config1 = term->val.num; 600 + break; 601 + case PARSE_EVENTS__TERM_TYPE_CONFIG2: 602 + attr->config2 = term->val.num; 603 + break; 604 + case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD: 605 + attr->sample_period = term->val.num; 606 + break; 607 + case PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE: 608 + /* 609 + * TODO uncomment when the field is available 610 + * attr->branch_sample_type = term->val.num; 611 + */ 612 + break; 613 + default: 614 + return -EINVAL; 615 + } 616 + return 0; 617 + } 618 + 619 + static int config_attr(struct perf_event_attr *attr, 620 + struct list_head *head, int fail) 621 + { 622 + struct parse_events__term *term; 623 + 624 + list_for_each_entry(term, head, list) 625 + if (config_term(attr, term) && fail) 626 + return -EINVAL; 627 + 628 + return 0; 629 + } 630 + 631 + int parse_events_add_numeric(struct list_head *list, int *idx, 632 + unsigned long type, unsigned long config, 633 + struct list_head *head_config) 594 634 { 595 635 struct perf_event_attr attr; 596 636 597 637 memset(&attr, 0, sizeof(attr)); 598 638 attr.type = type; 599 639 attr.config = config; 640 + 641 + if (head_config && 642 + config_attr(&attr, head_config, 1)) 643 + return -EINVAL; 644 + 600 645 return add_event(list, idx, &attr, 601 646 (char *) __event_name(type, config)); 602 647 } ··· 967 922 printf("\n"); 968 923 969 924 print_tracepoint_events(NULL, NULL); 925 + } 926 + 927 + int parse_events__is_hardcoded_term(struct parse_events__term *term) 928 + { 929 + return term->type <= PARSE_EVENTS__TERM_TYPE_HARDCODED_MAX; 930 + } 931 + 932 + int parse_events__new_term(struct parse_events__term **_term, int type, 933 + char *config, char *str, long num) 934 + { 935 + struct parse_events__term *term; 936 + 937 + term = zalloc(sizeof(*term)); 938 + if (!term) 939 + return -ENOMEM; 940 + 941 + INIT_LIST_HEAD(&term->list); 942 + term->type = type; 943 + term->config = config; 944 + 945 + switch (type) { 946 + case PARSE_EVENTS__TERM_TYPE_CONFIG: 947 + case PARSE_EVENTS__TERM_TYPE_CONFIG1: 948 + case PARSE_EVENTS__TERM_TYPE_CONFIG2: 949 + case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD: 950 + case PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE: 951 + case PARSE_EVENTS__TERM_TYPE_NUM: 952 + term->val.num = num; 953 + break; 954 + case PARSE_EVENTS__TERM_TYPE_STR: 955 + term->val.str = str; 956 + break; 957 + default: 958 + return -EINVAL; 959 + } 960 + 961 + *_term = term; 962 + return 0; 963 + } 964 + 965 + void parse_events__free_terms(struct list_head *terms) 966 + { 967 + struct parse_events__term *term, *h; 968 + 969 + list_for_each_entry_safe(term, h, terms, list) 970 + free(term); 971 + 972 + free(terms); 970 973 }
+30 -1
tools/perf/util/parse-events.h
··· 33 33 34 34 #define EVENTS_HELP_MAX (128*1024) 35 35 36 + enum { 37 + PARSE_EVENTS__TERM_TYPE_CONFIG, 38 + PARSE_EVENTS__TERM_TYPE_CONFIG1, 39 + PARSE_EVENTS__TERM_TYPE_CONFIG2, 40 + PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD, 41 + PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE, 42 + PARSE_EVENTS__TERM_TYPE_NUM, 43 + PARSE_EVENTS__TERM_TYPE_STR, 44 + 45 + PARSE_EVENTS__TERM_TYPE_HARDCODED_MAX = 46 + PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE, 47 + }; 48 + 49 + struct parse_events__term { 50 + char *config; 51 + union { 52 + char *str; 53 + long num; 54 + } val; 55 + int type; 56 + 57 + struct list_head list; 58 + }; 59 + 60 + int parse_events__is_hardcoded_term(struct parse_events__term *term); 61 + int parse_events__new_term(struct parse_events__term **term, int type, 62 + char *config, char *str, long num); 63 + void parse_events__free_terms(struct list_head *terms); 36 64 int parse_events_modifier(struct list_head *list __used, char *str __used); 37 65 int parse_events_add_tracepoint(struct list_head *list, int *idx, 38 66 char *sys, char *event); ··· 68 40 unsigned long config1, unsigned long config2, 69 41 char *mod); 70 42 int parse_events_add_numeric(struct list_head *list, int *idx, 71 - unsigned long type, unsigned long config); 43 + unsigned long type, unsigned long config, 44 + struct list_head *head_config); 72 45 int parse_events_add_cache(struct list_head *list, int *idx, 73 46 char *type, char *op_result1, char *op_result2); 74 47 int parse_events_add_breakpoint(struct list_head *list, int *idx,
+19
tools/perf/util/parse-events.l
··· 5 5 #include <errno.h> 6 6 #include "../perf.h" 7 7 #include "parse-events-bison.h" 8 + #include "parse-events.h" 8 9 9 10 static int __value(char *str, int base, int token) 10 11 { ··· 40 39 { 41 40 parse_events_lval.num = (type << 16) + config; 42 41 return PE_VALUE_SYM; 42 + } 43 + 44 + static int term(int type) 45 + { 46 + parse_events_lval.num = type; 47 + return PE_TERM; 43 48 } 44 49 45 50 %} ··· 91 84 speculative-read|speculative-load | 92 85 refs|Reference|ops|access | 93 86 misses|miss { return str(PE_NAME_CACHE_OP_RESULT); } 87 + 88 + /* 89 + * These are event config hardcoded term names to be specified 90 + * within xxx/.../ syntax. So far we dont clash with other names, 91 + * so we can put them here directly. In case the we have a conflict 92 + * in future, this needs to go into '//' condition block. 93 + */ 94 + config { return term(PARSE_EVENTS__TERM_TYPE_CONFIG); } 95 + config1 { return term(PARSE_EVENTS__TERM_TYPE_CONFIG1); } 96 + config2 { return term(PARSE_EVENTS__TERM_TYPE_CONFIG2); } 97 + period { return term(PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD); } 98 + branch_type { return term(PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE); } 94 99 95 100 mem: { return PE_PREFIX_MEM; } 96 101 r{num_raw_hex} { return raw(); }
+88 -6
tools/perf/util/parse-events.y
··· 23 23 24 24 %} 25 25 26 - %token PE_VALUE PE_VALUE_SYM PE_RAW 26 + %token PE_VALUE PE_VALUE_SYM PE_RAW PE_TERM 27 27 %token PE_NAME 28 28 %token PE_MODIFIER_EVENT PE_MODIFIER_BP 29 29 %token PE_NAME_CACHE_TYPE PE_NAME_CACHE_OP_RESULT ··· 32 32 %type <num> PE_VALUE 33 33 %type <num> PE_VALUE_SYM 34 34 %type <num> PE_RAW 35 + %type <num> PE_TERM 35 36 %type <str> PE_NAME 36 37 %type <str> PE_NAME_CACHE_TYPE 37 38 %type <str> PE_NAME_CACHE_OP_RESULT 38 39 %type <str> PE_MODIFIER_EVENT 39 40 %type <str> PE_MODIFIER_BP 41 + %type <head> event_config 42 + %type <term> event_term 40 43 41 44 %union 42 45 { 43 46 char *str; 44 47 unsigned long num; 48 + struct list_head *head; 49 + struct parse_events__term *term; 45 50 } 46 51 %% 47 52 ··· 61 56 | 62 57 event_def 63 58 64 - event_def: event_legacy_symbol sep_dc | 59 + event_def: event_legacy_symbol | 65 60 event_legacy_cache sep_dc | 66 61 event_legacy_mem | 67 62 event_legacy_tracepoint sep_dc | ··· 69 64 event_legacy_raw sep_dc 70 65 71 66 event_legacy_symbol: 72 - PE_VALUE_SYM 67 + PE_VALUE_SYM '/' event_config '/' 73 68 { 74 69 int type = $1 >> 16; 75 70 int config = $1 & 255; 76 71 77 - ABORT_ON(parse_events_add_numeric(list, idx, type, config)); 72 + ABORT_ON(parse_events_add_numeric(list, idx, type, config, $3)); 73 + parse_events__free_terms($3); 74 + } 75 + | 76 + PE_VALUE_SYM sep_slash_dc 77 + { 78 + int type = $1 >> 16; 79 + int config = $1 & 255; 80 + 81 + ABORT_ON(parse_events_add_numeric(list, idx, type, config, NULL)); 78 82 } 79 83 80 84 event_legacy_cache: ··· 122 108 event_legacy_numeric: 123 109 PE_VALUE ':' PE_VALUE 124 110 { 125 - ABORT_ON(parse_events_add_numeric(list, idx, $1, $3)); 111 + ABORT_ON(parse_events_add_numeric(list, idx, $1, $3, NULL)); 126 112 } 127 113 128 114 event_legacy_raw: 129 115 PE_RAW 130 116 { 131 - ABORT_ON(parse_events_add_numeric(list, idx, PERF_TYPE_RAW, $1)); 117 + ABORT_ON(parse_events_add_numeric(list, idx, PERF_TYPE_RAW, $1, NULL)); 118 + } 119 + 120 + event_config: 121 + event_config ',' event_term 122 + { 123 + struct list_head *head = $1; 124 + struct parse_events__term *term = $3; 125 + 126 + ABORT_ON(!head); 127 + list_add_tail(&term->list, head); 128 + $$ = $1; 129 + } 130 + | 131 + event_term 132 + { 133 + struct list_head *head = malloc(sizeof(*head)); 134 + struct parse_events__term *term = $1; 135 + 136 + ABORT_ON(!head); 137 + INIT_LIST_HEAD(head); 138 + list_add_tail(&term->list, head); 139 + $$ = head; 140 + } 141 + 142 + event_term: 143 + PE_NAME '=' PE_NAME 144 + { 145 + struct parse_events__term *term; 146 + 147 + ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_STR, 148 + $1, $3, 0)); 149 + $$ = term; 150 + } 151 + | 152 + PE_NAME '=' PE_VALUE 153 + { 154 + struct parse_events__term *term; 155 + 156 + ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_NUM, 157 + $1, NULL, $3)); 158 + $$ = term; 159 + } 160 + | 161 + PE_NAME 162 + { 163 + struct parse_events__term *term; 164 + 165 + ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_NUM, 166 + $1, NULL, 1)); 167 + $$ = term; 168 + } 169 + | 170 + PE_TERM '=' PE_VALUE 171 + { 172 + struct parse_events__term *term; 173 + 174 + ABORT_ON(parse_events__new_term(&term, $1, NULL, NULL, $3)); 175 + $$ = term; 176 + } 177 + | 178 + PE_TERM 179 + { 180 + struct parse_events__term *term; 181 + 182 + ABORT_ON(parse_events__new_term(&term, $1, NULL, NULL, 1)); 183 + $$ = term; 132 184 } 133 185 134 186 sep_dc: ':' | 187 + 188 + sep_slash_dc: '/' | ':' | 135 189 136 190 %% 137 191