Open Asphaltt opened 1 month ago
Thanks for the proposal. Retrieving ksym addrs from bpf_prog_info
:+1:
even though for subprog's ksym addresses.
Do you mind to elaborate what do you mean by "subprog"?
elaborate what do you mean by "subprog"?
For instance:
# less /proc/kallsyms
ffffffffc135d0d4 t bpf_prog_9cf8e6173844be22_F [bpf]
ffffffffc135f180 t bpf_prog_ab605ebb7ccc37a8_F [bpf]
ffffffffc13c3060 t bpf_prog_9147d89081192601_F [bpf]
ffffffffc13c56dc t bpf_prog_96d55732a81d4096_F [bpf]
ffffffffc135d0d4 t bpf_prog_bd58215f88be5281_kprobe_skb_3 [bpf]
ffffffffc135f180
, ffffffffc13c3060
and ffffffffc13c56dc
are the ksym addresses for kprobe_skb_3
's subprogs.
And the symbols for these subprogs are F
instead of their function names.
With the aforementioned PR, pwru is able to retrieve these ksym addresses alongside the function names for these subprogs. Then, pwru is able to show the exact info for subprogs' ksym addresses.
Got it, thanks! Yep, the proposal makes sense to me.
When I deep dive into
struct bpf_prog_info
, I find that we can retrieve ksyms and ksyms' corresponding func info byProgramInfo
(see ebpf PR info: expose ksym info and func info by ProgramInfo).Q: For
--output-stack
, what is the exact bpf prog tracked?For example, use one tc-bpf code for multiple pods in k8s env:
And, what if
pwru --output-stack --filter-track-bpf-helpers
?So, which bpf prog is
bpf_prog_f641265f228ac785_YYY[bpf]
? As there are multiplebpf_prog_f641265f228ac785_YYY[bpf]
in/proc/kallsyms
.A: Provide exact bpf prog info for ksym addresses.
With the aforementioned ebpf PR, pwru is able to retrieve the exact bpf prog info for ksym addresses, even though for subprog's ksym addresses.
Then, as for subprog info for a ksym address, it can be
${subprog function name}:${prog entry function name}[${TYPE}][${ID}][bpf]
. As for prog info for a ksym address, it can be${prog entry function name}[${TYPE}][${ID}][bpf]
.At the same time, the prog info for
--filter-trace-tc
and--filter-trace-xdp
will be updated too.TODOs
@brb @jschwinger233 WDYT?