25 if (len(raw_buf) == 144):
26 event =
PebsEvent(name, comm, dso, symbol, raw_buf)
27 elif (len(raw_buf) == 176):
28 event =
PebsNHM(name, comm, dso, symbol, raw_buf)
30 event =
PerfEvent(name, comm, dso, symbol, raw_buf)
36 def __init__(self, name, comm, dso, symbol, raw_buf, ev_type=EVTYPE_GENERIC):
43 PerfEvent.event_num += 1
46 print "PMU event: name=%12s, symbol=%24s, comm=%8s, dso=%12s" % (self.
name, self.
symbol, self.
comm, self.
dso)
55 def __init__(self, name, comm, dso, symbol, raw_buf, ev_type=EVTYPE_PEBS):
57 flags, ip, ax, bx, cx, dx, si, di, bp, sp = struct.unpack(
'QQQQQQQQQQ', tmp_buf)
69 PerfEvent.__init__(self, name, comm, dso, symbol, raw_buf, ev_type)
70 PebsEvent.pebs_num += 1
84 def __init__(self, name, comm, dso, symbol, raw_buf, ev_type=EVTYPE_PEBS_LL):
85 tmp_buf=raw_buf[144:176]
86 status, dla, dse, lat = struct.unpack(
'QQQQ', tmp_buf)
92 PebsEvent.__init__(self, name, comm, dso, symbol, raw_buf, ev_type)
93 PebsNHM.pebs_nhm_num += 1