Lines Matching +full:sample +full:- +full:time

1 # SPDX-License-Identifier: GPL-2.0
2 # arm-cs-trace-disasm.py: ARM CoreSight Trace Dump With Disassember
22 # perf script -s scripts/python/arm-cs-trace-disasm.py \
23 # -- -d objdump -k path/to/vmlinux
24 # Output disassembly with llvm-objdump:
25 # perf script -s scripts/python/arm-cs-trace-disasm.py \
26 # -- -d llvm-objdump-11 -k path/to/vmlinux
28 # perf script -s scripts/python/arm-cs-trace-disasm.py
33 make_option("-k", "--vmlinux", dest="vmlinux_name",
35 make_option("-d", "--objdump", dest="objdump_name",
37 make_option("-v", "--verbose", dest="verbose",
48 disasm_re = re.compile(r"^\s*([0-9a-fA-F]+):")
49 disasm_func_re = re.compile(r"^\s*([0-9a-fA-F]+)\s.*:")
93 start_addr = start_addr - dso_start;
94 stop_addr = stop_addr - dso_start;
95 disasm = [ options.objdump_name, "-d", "-z",
96 "--start-address="+format(start_addr,"#x"),
97 "--stop-address="+format(stop_addr,"#x") ]
99 disasm_output = check_output(disasm).decode('utf-8').split('\n')
113 def print_sample(sample): argument
114 print("Sample = { cpu: %04d addr: 0x%016x phys_addr: 0x%016x ip: 0x%016x " \
115 "pid: %d tid: %d period: %d time: %d }" % \
116 (sample['cpu'], sample['addr'], sample['phys_addr'], \
117 sample['ip'], sample['pid'], sample['tid'], \
118 sample['period'], sample['time']))
129 def common_start_str(comm, sample): argument
130 sec = int(sample["time"] / 1000000000)
131 ns = sample["time"] % 1000000000
132 cpu = sample["cpu"]
133 pid = sample["pid"]
134 tid = sample["tid"]
135 return "%16s %5u/%-5u [%04u] %9u.%09u " % (comm, pid, tid, cpu, sec, ns)
137 # This code is copied from intel-pt-events.py for printing source code
139 def print_srccode(comm, param_dict, sample, symbol, dso): argument
140 ip = sample["ip"]
142 start_str = common_start_str(comm, sample) + ("%x" % ip).rjust(16).ljust(40)
145 start_str = common_start_str(comm, sample) + (symbol + offs).ljust(40)
157 src_file = ("..." + source_file_name[-37:]) + " "
181 sample = param_dict["sample"]
191 cpu = sample["cpu"]
192 ip = sample["ip"]
193 addr = sample["addr"]
197 print_sample(sample)
215 print_srccode(comm, param_dict, sample, symbol, dso)
218 # Don't proceed if this event is not a branch sample, .
224 # +------------+------------+------------+
226 # +------------+------------+------------+
228 # +------------+------------+------------+
243 # Record for previous sample packet
274 print_srccode(comm, param_dict, sample, symbol, dso)