Skip to content

Commit

Permalink
toplev: Fix PEBS events in model
Browse files Browse the repository at this point in the history
  • Loading branch information
Andi Kleen committed Apr 3, 2024
1 parent 019a17b commit c103ec0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions toplev.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def unsup_event(e, table, kernel_version, min_kernel=None):
return False

def remove_qual(ev):
return re.sub(r':[ku]+', '', re.sub(r'/[ku]+', '/', ev))
return re.sub(r':(p?)[ku]+', lambda m: m.group(1), re.sub(r'/(p?)[ku]+', lambda m: '/' + m.group(1), ev))

def limited_overflow(evlist, num):
class GenericCounters:
Expand Down Expand Up @@ -1396,6 +1396,8 @@ def __del__(self):
self.perf.kill()

def separator(x):
if ":" in x:
return ""
if x.startswith("cpu"):
return ""
return ":"
Expand All @@ -1405,10 +1407,7 @@ def add_filter_event(e):
return e
if e == "dummy" or e == "emulation-faults" or e == "duration_time":
return e
if ":" in e:
s = ""
else:
s = separator(e)
s = separator(e)
if not e.endswith(s + args.ring_filter):
return e + s + args.ring_filter
return e
Expand Down

0 comments on commit c103ec0

Please sign in to comment.