17 sys.path.append(os.environ[
'PERF_EXEC_PATH'] + \
18 '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
25 print "Intel PT Power Events and PTWRITE" 31 print ' '.join([
'%s=%s'%(k,
str(v))
for k,v
in sorted(event_fields_dict.items())])
34 data = struct.unpack_from(
"<IQ", raw_buf)
38 print "IP: %u payload: %#x" % (exact_ip, payload),
41 data = struct.unpack_from(
"<BBBBII", raw_buf)
43 f = (data[4] + 500) / 1000
44 p = ((cbr * 1000 / data[2]) + 5) / 10
45 print "%3u freq: %4u MHz (%3u%%)" % (cbr, f, p),
48 data = struct.unpack_from(
"<IQ", raw_buf)
50 hints = payload & 0xff
51 extensions = (payload >> 32) & 0x3
52 print "hints: %#x extensions: %#x" % (hints, extensions),
55 data = struct.unpack_from(
"<IQ", raw_buf)
57 hw = (payload >> 7) & 1
58 cstate = (payload >> 12) & 0xf
59 subcstate = (payload >> 8) & 0xf
60 print "hw: %u cstate: %u sub-cstate: %u" % (hw, cstate, subcstate),
63 data = struct.unpack_from(
"<I", raw_buf)
66 print "IP: %u" % (exact_ip),
69 data = struct.unpack_from(
"<IQ", raw_buf)
71 deepest_cstate = payload & 0xf
72 last_cstate = (payload >> 4) & 0xf
73 wake_reason = (payload >> 8) & 0xf
74 print "deepest cstate: %u last cstate: %u wake reason: %#x" % (deepest_cstate, last_cstate, wake_reason),
81 print "%16s %5u/%-5u [%03u] %9u.%09u %7s:" % (comm, pid, tid, cpu, ts / 1000000000, ts %1000000000, name),
85 print "%16x %s (%s)" % (ip, symbol, dso)
88 event_attr = param_dict[
"attr"]
89 sample = param_dict[
"sample"]
90 raw_buf = param_dict[
"raw_buf"]
91 comm = param_dict[
"comm"]
92 name = param_dict[
"ev_name"]
95 if (param_dict.has_key(
"dso")):
96 dso = param_dict[
"dso"]
100 if (param_dict.has_key(
"symbol")):
101 symbol = param_dict[
"symbol"]
105 if name ==
"ptwrite":
113 elif name ==
"mwait":
121 elif name ==
"exstop":
def print_exstop(raw_buf)
def process_event(param_dict)
def print_common_ip(sample, symbol, dso)
static int str(yyscan_t scanner, int token)
def trace_unhandled(event_name, context, event_fields_dict)
def print_common_start(comm, sample, name)
def print_ptwrite(raw_buf)