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

Configure Feed

Select the types of activity you want to include in your feed.

perf jevents: Term list fix in event parsing

Fix events seemingly broken apart at a comma.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Thomas Falcon <thomas.falcon@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
7d5b4061 826650f7

+6 -1
+6 -1
tools/perf/pmu-events/metric.py
··· 568 568 r'Event(r"\1")', py) 569 569 # If it started with a # it should have been a literal, rather than an event name 570 570 py = re.sub(r'#Event\(r"([^"]*)"\)', r'Literal("#\1")', py) 571 + # Fix events wrongly broken at a ',' 572 + while True: 573 + prev_py = py 574 + py = re.sub(r'Event\(r"([^"]*)"\),Event\(r"([^"]*)"\)', r'Event(r"\1,\2")', py) 575 + if py == prev_py: 576 + break 571 577 # Convert accidentally converted hex constants ("0Event(r"xDEADBEEF)"") back to a constant, 572 578 # but keep it wrapped in Event(), otherwise Python drops the 0x prefix and it gets interpreted as 573 579 # a double by the Bison parser ··· 591 585 _RewriteIfExpToSelect().visit(parsed) 592 586 parsed = ast.fix_missing_locations(parsed) 593 587 return _Constify(eval(compile(parsed, orig, 'eval'))) 594 - 595 588 596 589 def RewriteMetricsInTermsOfOthers(metrics: List[Tuple[str, str, Expression]] 597 590 )-> Dict[Tuple[str, str], Expression]: