Commit 64199ae
perf parse-events: Fix propagation of term's no_value when cloning
The no_value field in 'struct parse_events_term' indicates that the val
variable isn't used, the case for an event name.
Cloning wasn't propagating this, making cloned event name terms
appearing to have a constant assinged to them.
Working around the bug would check for a value of 1 assigned to value,
but then this meant a user value of 1 couldn't be differentiated causing
the value to be lost in debug printing and perf list.
The change fixes the cloning and updates the "val.num ==/!= 1" tests to
use no_value instead.
To better check the no_value is set appropriately parameter comments are
added for constant values.
This found that no_value wasn't set correctly in parse_events_multi_pmu_add,
which matters now that no_value is used to indicate an event name.
Fixes: 7a6e916 ("perf parse-events: Make common term list to strbuf helper")
Fixes: 99e7138 ("perf tools: Fail on using multiple bits long terms without value")
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Kan Liang <kan.liang@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230831071421.2201358-4-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>1 parent 58d3a4c commit 64199ae
3 files changed
+19
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1510 | 1510 | | |
1511 | 1511 | | |
1512 | 1512 | | |
1513 | | - | |
1514 | | - | |
| 1513 | + | |
| 1514 | + | |
1515 | 1515 | | |
1516 | 1516 | | |
1517 | 1517 | | |
| |||
2482 | 2482 | | |
2483 | 2483 | | |
2484 | 2484 | | |
2485 | | - | |
| 2485 | + | |
2486 | 2486 | | |
2487 | 2487 | | |
2488 | 2488 | | |
| |||
2501 | 2501 | | |
2502 | 2502 | | |
2503 | 2503 | | |
2504 | | - | |
| 2504 | + | |
2505 | 2505 | | |
2506 | 2506 | | |
2507 | 2507 | | |
| |||
2518 | 2518 | | |
2519 | 2519 | | |
2520 | 2520 | | |
2521 | | - | |
2522 | | - | |
2523 | | - | |
2524 | | - | |
2525 | | - | |
2526 | | - | |
2527 | | - | |
| 2521 | + | |
2528 | 2522 | | |
| 2523 | + | |
2529 | 2524 | | |
2530 | 2525 | | |
2531 | 2526 | | |
2532 | 2527 | | |
2533 | 2528 | | |
2534 | 2529 | | |
2535 | | - | |
| 2530 | + | |
2536 | 2531 | | |
2537 | 2532 | | |
2538 | 2533 | | |
2539 | 2534 | | |
2540 | | - | |
| 2535 | + | |
2541 | 2536 | | |
2542 | 2537 | | |
2543 | 2538 | | |
| |||
2611 | 2606 | | |
2612 | 2607 | | |
2613 | 2608 | | |
2614 | | - | |
| 2609 | + | |
| 2610 | + | |
2615 | 2611 | | |
2616 | | - | |
| 2612 | + | |
2617 | 2613 | | |
2618 | 2614 | | |
2619 | 2615 | | |
2620 | 2616 | | |
2621 | 2617 | | |
2622 | 2618 | | |
2623 | | - | |
| 2619 | + | |
2624 | 2620 | | |
2625 | 2621 | | |
2626 | 2622 | | |
2627 | 2623 | | |
| 2624 | + | |
2628 | 2625 | | |
2629 | 2626 | | |
2630 | 2627 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
715 | | - | |
| 715 | + | |
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
| |||
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
742 | | - | |
| 742 | + | |
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
755 | | - | |
| 755 | + | |
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
768 | | - | |
| 768 | + | |
| 769 | + | |
769 | 770 | | |
770 | 771 | | |
771 | 772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1396 | 1396 | | |
1397 | 1397 | | |
1398 | 1398 | | |
1399 | | - | |
| 1399 | + | |
1400 | 1400 | | |
1401 | 1401 | | |
1402 | 1402 | | |
| |||
0 commit comments