trace: Migrate to new symbols API and remove addresses from stacks
authorSasha Goldshtein <goldshtn@gmail.com>
Thu, 9 Feb 2017 05:21:49 +0000 (00:21 -0500)
committerSasha Goldshtein <goldshtn@gmail.com>
Tue, 21 Feb 2017 09:30:43 +0000 (09:30 +0000)
tools/trace.py

index f2a8741..0c294ac 100755 (executable)
@@ -457,7 +457,8 @@ BPF_PERF_OUTPUT(%s);
 
             stack = list(bpf.get_table(self.stacks_name).walk(stack_id))
             for addr in stack:
-                    print("        %016x %s" % (addr, bpf.sym(addr, tgid)))
+                    print("        %s" % (bpf.sym(addr, tgid,
+                                         show_module=True, show_address=True)))
 
         def _format_message(self, bpf, tgid, values):
                 # Replace each %K with kernel sym and %U with user sym in tgid
@@ -466,9 +467,10 @@ BPF_PERF_OUTPUT(%s);
                 user_placeholders = [i for i, t in enumerate(self.types)
                                      if t == 'U']
                 for kp in kernel_placeholders:
-                        values[kp] = bpf.ksymaddr(values[kp])
+                        values[kp] = bpf.ksym(values[kp], show_address=True)
                 for up in user_placeholders:
-                        values[up] = bpf.symaddr(values[up], tgid)
+                        values[up] = bpf.sym(values[up], tgid,
+                                           show_module=True, show_address=True)
                 return self.python_format % tuple(values)
 
         def print_event(self, bpf, cpu, data, size):