Commit 2bf3ff3d authored by Sasha Goldshtein's avatar Sasha Goldshtein

stacksnoop: Migrate to new symbols API and remove addresses

parent b9f8f4ac
...@@ -119,10 +119,7 @@ while 1: ...@@ -119,10 +119,7 @@ while 1:
(task, pid, cpu, flags, ts, msg) = b.trace_fields() (task, pid, cpu, flags, ts, msg) = b.trace_fields()
if msg != "": if msg != "":
(reg, addr) = msg.split(" ") (reg, addr) = msg.split(" ")
if offset: ip = b.ksym(int(addr, 16), show_address=offset)
ip = b.ksymaddr(int(addr, 16))
else:
ip = b.ksym(int(addr, 16))
msg = msg + " " + ip msg = msg + " " + ip
if verbose: if verbose:
print("%-18.9f %-12.12s %-6d %-3d %s" % (ts, task, pid, cpu, msg)) print("%-18.9f %-12.12s %-6d %-3d %s" % (ts, task, pid, cpu, msg))
......
...@@ -120,8 +120,8 @@ def print_event(cpu, data, size): ...@@ -120,8 +120,8 @@ def print_event(cpu, data, size):
print("%-18.9f %s" % (ts, function)) print("%-18.9f %s" % (ts, function))
for addr in stack_traces.walk(event.stack_id): for addr in stack_traces.walk(event.stack_id):
sym = b.ksymaddr(addr) if offset else b.ksym(addr) sym = b.ksym(addr, show_address=offset)
print("\t%016x %s" % (addr, sym)) print("\t%s" % sym)
print() print()
......
...@@ -8,12 +8,12 @@ to see how they were invoked. For example, tracing the submit_bio() call: ...@@ -8,12 +8,12 @@ to see how they were invoked. For example, tracing the submit_bio() call:
# ./stacksnoop submit_bio # ./stacksnoop submit_bio
TIME(s) SYSCALL TIME(s) SYSCALL
3592.838736000 submit_bio 3592.838736000 submit_bio
ffffffff813bd961 submit_bio submit_bio
ffffffff81257c12 submit_bh submit_bh
ffffffff81301948 jbd2_journal_commit_transaction jbd2_journal_commit_transaction
ffffffff8130653a kjournald2 kjournald2
ffffffff810a2df8 kthread kthread
ffffffff8183a122 ret_from_fork ret_from_fork
This shows that submit_bio() was called by submit_bh(), which was called This shows that submit_bio() was called by submit_bh(), which was called
by jbd2_journal_commit_transaction(), and so on. by jbd2_journal_commit_transaction(), and so on.
...@@ -28,12 +28,12 @@ The -v option includes more fields, including the on-CPU process (COMM and PID): ...@@ -28,12 +28,12 @@ The -v option includes more fields, including the on-CPU process (COMM and PID):
# ./stacksnoop -v submit_bio # ./stacksnoop -v submit_bio
TIME(s) COMM PID CPU SYSCALL TIME(s) COMM PID CPU SYSCALL
3734.855027000 jbd2/dm-0-8 313 0 submit_bio 3734.855027000 jbd2/dm-0-8 313 0 submit_bio
ffffffff813bd961 submit_bio submit_bio
ffffffff81257c12 submit_bh submit_bh
ffffffff81301948 jbd2_journal_commit_transaction jbd2_journal_commit_transaction
ffffffff8130653a kjournald2 kjournald2
ffffffff810a2df8 kthread kthread
ffffffff8183a122 ret_from_fork ret_from_fork
This identifies the application issuing the sync syscall: the jbd2 process This identifies the application issuing the sync syscall: the jbd2 process
(COMM column). (COMM column).
...@@ -45,30 +45,30 @@ process: ...@@ -45,30 +45,30 @@ process:
# ./stacksnoop -v second_overflow # ./stacksnoop -v second_overflow
TIME(s) COMM PID CPU SYSCALL TIME(s) COMM PID CPU SYSCALL
3837.526433000 <idle> 0 1 second_overflow 3837.526433000 <idle> 0 1 second_overflow
ffffffff810fac41 second_overflow second_overflow
ffffffff81102320 tick_do_update_jiffies64 tick_do_update_jiffies64
ffffffff81102bf0 tick_irq_enter tick_irq_enter
ffffffff810882ac irq_enter irq_enter
ffffffff8183c7df smp_apic_timer_interrupt smp_apic_timer_interrupt
ffffffff8183aae2 apic_timer_interrupt apic_timer_interrupt
ffffffff81038f9e default_idle default_idle
ffffffff8103979f arch_cpu_idle arch_cpu_idle
ffffffff810c69da default_idle_call default_idle_call
ffffffff810c6cd7 cpu_startup_entry cpu_startup_entry
ffffffff81051cbe start_secondary start_secondary
3838.526953000 <idle> 0 1 second_overflow 3838.526953000 <idle> 0 1 second_overflow
ffffffff810fac41 second_overflow second_overflow
ffffffff81102320 tick_do_update_jiffies64 tick_do_update_jiffies64
ffffffff81102bf0 tick_irq_enter tick_irq_enter
ffffffff810882ac irq_enter irq_enter
ffffffff8183c7df smp_apic_timer_interrupt smp_apic_timer_interrupt
ffffffff8183aae2 apic_timer_interrupt apic_timer_interrupt
ffffffff81038f9e default_idle default_idle
ffffffff8103979f arch_cpu_idle arch_cpu_idle
ffffffff810c69da default_idle_call default_idle_call
ffffffff810c6cd7 cpu_startup_entry cpu_startup_entry
ffffffff81051cbe start_secondary start_secondary
This fires every second (see TIME(s)), and is from tick_do_update_jiffies64(). This fires every second (see TIME(s)), and is from tick_do_update_jiffies64().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment