All of lore.kernel.org
 help / color / mirror / Atom feed
* Broken kretprobe stack traces
@ 2021-03-03  1:15 Daniel Xu
  2021-03-03  4:48 ` Masami Hiramatsu
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Xu @ 2021-03-03  1:15 UTC (permalink / raw)
  To: mhiramat; +Cc: linux-kernel, bpf, kuba

Hi Masami,

Jakub reported a bug with kretprobe stack traces -- wondering if you've gotten
any bug reports related to stack traces being broken for kretprobes.

I think (can't prove) this used to work:

    # bpftrace -e 'kretprobe:__tcp_retransmit_skb { @[kstack()] = count() }'
    Attaching 1 probe...
    ^C

    @[
        kretprobe_trampoline+0
    ]: 1

fentry/fexit probes seem to work:

    # bpftrace -e 'kretfunc:__tcp_retransmit_skb { @[kstack()] = count() }'
    Attaching 1 probe...
    ^C
    
    @[
        ftrace_trampoline+10799
        bpf_get_stackid_raw_tp+121
        ftrace_trampoline+10799
        __tun_chr_ioctl.isra.0.cold+33312
        __tcp_retransmit_skb+5
        tcp_send_loss_probe+254
        tcp_write_timer_handler+394
        tcp_write_timer+149
        call_timer_fn+41
        __run_timers+493
        run_timer_softirq+25
        __softirqentry_text_start+207
        asm_call_sysvec_on_stack+18
        do_softirq_own_stack+55
        irq_exit_rcu+158
        sysvec_apic_timer_interrupt+54
        asm_sysvec_apic_timer_interrupt+18
    ]: 1
    @[
        ftrace_trampoline+10799
        bpf_get_stackid_raw_tp+121
        ftrace_trampoline+10799
        __tun_chr_ioctl.isra.0.cold+33312
        __tcp_retransmit_skb+5
  <...>

which makes me suspect it's a kprobe specific issue.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-03-04 20:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03  1:15 Broken kretprobe stack traces Daniel Xu
2021-03-03  4:48 ` Masami Hiramatsu
2021-03-03 14:26   ` Steven Rostedt
2021-03-03 19:58     ` Daniel Xu
2021-03-03 20:13       ` Daniel Xu
2021-03-03 20:37         ` Steven Rostedt
2021-03-04  2:18           ` Daniel Xu
2021-03-04 19:04             ` Daniel Xu
2021-03-04 13:19     ` Masami Hiramatsu
2021-03-04 15:22       ` [PATCH] kprobes: stacktrace: Recover the address changed by kretprobe kernel test robot
2021-03-04 17:37       ` kernel test robot
2021-03-04 20:25       ` kernel test robot
2021-03-03 19:57   ` Broken kretprobe stack traces Daniel Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.