Skip to content

Commit

Permalink
Work around perf adding uncore event name
Browse files Browse the repository at this point in the history
  • Loading branch information
Andi Kleen committed Nov 11, 2024
1 parent 1dce19d commit 2622b35
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions toplev.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def get_group(prefix, m):
return prefix + m.group(1)
return prefix

return re.sub(r':(p?)[ku]+', lambda m: get_group("", m), re.sub(r'/(p?)[ku]+', lambda m: get_group("/", m), ev))
return re.sub(r':(p?)[kuhgHeD]+$', lambda m: get_group("", m), re.sub(r'/(p?)[kuhgHeD]+$', lambda m: get_group("/", m), ev))

def limited_overflow(evlist, num):
class GenericCounters:
Expand Down Expand Up @@ -2248,6 +2248,7 @@ def check_event(rlist, event, off, title, prev_interval, l, revnum, linenum, las
revnum = r.sched.evnum
if event.startswith("uncore"):
event = re.sub(r'_[0-9]+', '', event)
event = re.sub(r'/uncore_[a-z]+,', '/', event)
try:
expected_ev = remove_qual(revnum[off])
except IndexError:
Expand Down Expand Up @@ -2435,8 +2436,8 @@ def do_execute(rlist, summary, evstr, flat_rmap, out, rest, resoff, revnum):
title = title.replace("CPU", "")

# code later relies on stripping ku flags
event = remove_qual(event)
event = re.sub(r'\s+\[.*\]', '', event)
event = remove_qual(event)
m = re.match(r"tool/(.*)/", event)
if m:
event = m.group(1)
Expand Down

0 comments on commit 2622b35

Please sign in to comment.