Skip to content

Commit

Permalink
toplev: Handle fixed counter with kernel qualifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Andi Kleen committed Jul 3, 2015
1 parent aae3189 commit b315006
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 @@ -665,6 +665,7 @@ def wait(self):
"INST_RETIRED.ANY": "instructions",
"CPU_CLK_UNHALTED.REF_TSC": "ref-cycles",
"CPU_CLK_UNHALTED.REF_TSC:amt1": "cpu/event=0x0,umask=0x3,any=1/",
"CPU_CLK_UNHALTED.REF_TSC:sup": "cpu/event=0x0,umask=0x3/k",
}

fixed_set = frozenset(fixed_counters.keys())
Expand Down Expand Up @@ -1093,7 +1094,7 @@ def ev_append(ev, level, obj):

def canon_event(e):
m = re.match(r"(.*?):(.*)", e)
if m and m.group(2) != "amt1":
if m and m.group(2) != "amt1" and m.group(2) != "sup":
e = m.group(1)
if e in fixed_counters:
return fixed_counters[e]
Expand Down Expand Up @@ -1133,7 +1134,7 @@ def lookup_res(res, rev, ev, obj, env, level, referenced, cpuoff = -1):
referenced.add(index)
#print (ev, level, obj.name), "->", index
rmap_ev = event_rmap(rev[index]).lower()
assert (rmap_ev == canon_event(ev) or
assert (rmap_ev == canon_event(ev).replace("/k", "/") or
(ev in event_fixes and canon_event(event_fixes[ev]) == rmap_ev) or
rmap_ev == "dummy")

Expand Down

0 comments on commit b315006

Please sign in to comment.