Skip to content

Commit

Permalink
ocperf/toplev: Modernize PEBS handling
Browse files Browse the repository at this point in the history
Use new JSON fields and remove description mangling.

Fixes #510
  • Loading branch information
Andi Kleen committed Jun 21, 2024
1 parent 6116855 commit 5a218cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 6 additions & 9 deletions ocperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
import event_download

force_download = False
pebs_enable = "p"
experimental = False
ocverbose = os.getenv("OCVERBOSE") is not None

Expand Down Expand Up @@ -266,7 +265,8 @@ def __init__(self, name, val, desc):
self.msr = 0
self.msrval = 0
self.desc = desc
self.pebs = 0
self.precise = 0
self.collectpebs = 0
self.newextra = ""
self.overflow = None
self.errata = None
Expand Down Expand Up @@ -671,13 +671,10 @@ def getdec(x):
e.msr = msrnum
if u'SampleAfterValue' in row:
e.overflow = get(u'SampleAfterValue')
e.pebs = get(u'PEBS')
if e.pebs and int(e.pebs):
if name.endswith("_ps") or int(e.pebs) == 2:
e.extra += pebs_enable
d += " (Uses PEBS)"
else:
d = d.replace("(Precise Event)","") + " (Supports PEBS)"
e.precise = getdec(u'Precise') if u'Precise' in row else 0
e.collectpebs = getdec(u'CollectPEBS') if u'CollectPEBS' in row else 0
if e.collectpebs > 1:
e.extra += "pp"
try:
if get(u'Errata') != "null":
try:
Expand Down
2 changes: 0 additions & 2 deletions toplev.py
Original file line number Diff line number Diff line change
Expand Up @@ -2745,8 +2745,6 @@ def sample_event(e, emap):
if not ev:
raise BadEvent(e)
postfix = args.ring_filter
if ev.pebs and int(ev.pebs):
postfix = "pp"
if postfix:
postfix = ":" + postfix
return ev.name + postfix
Expand Down

0 comments on commit 5a218cf

Please sign in to comment.