Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib/bpf_inspect.py: inspect linked progs #403

Merged

Conversation

Asphaltt
Copy link
Contributor

@Asphaltt Asphaltt commented Jun 2, 2024

Since 'prog->aux->linked_prog' has been moved to trampoline, it has to inspect linked progs from tracing link's trampoline.

Therefore, add --show-details for link command to show the linked progs for tracing link.

Example:

drgn ./contrib/bpf_inspect.py l --show-details
     1: BPF_LINK_TYPE_TRACING
	prog:        2: BPF_PROG_TYPE_TRACING            hid_tail_call                    __hid_bpf_tail_call
  1057: BPF_LINK_TYPE_TRACING
	prog:     3862: BPF_PROG_TYPE_EXT                freplace_handler                 stub_handler
	target:   3861: BPF_PROG_TYPE_KPROBE             k_tcp_connect
	linked:   3862: BPF_PROG_TYPE_EXT                freplace_handler
  1058: BPF_LINK_TYPE_TRACING
	prog:     3862: BPF_PROG_TYPE_EXT                freplace_handler                 stub_handler
	target:   3860: BPF_PROG_TYPE_KPROBE             k_icsk_complete_hashdance
	linked:   3862: BPF_PROG_TYPE_EXT                freplace_handler
  1059: BPF_LINK_TYPE_PERF_EVENT
	prog:     3861: BPF_PROG_TYPE_KPROBE             k_tcp_connect
  1060: BPF_LINK_TYPE_PERF_EVENT
	prog:     3860: BPF_PROG_TYPE_KPROBE             k_icsk_complete_hashdance

Since 'prog->aux->linked_prog' has been moved to trampoline, it has to
inspect linked progs from tracing link's trampoline.

Therefore, add --show-details for link command to show the linked progs
for tracing link.

Signed-off-by: Leon Hwang <[email protected]>
@Asphaltt Asphaltt force-pushed the feature/bpf_inspect/show-linked-progs branch from 534b02a to 3227737 Compare June 2, 2024 16:37
@osandov osandov merged commit 17f18ac into osandov:main Jun 21, 2024
32 of 33 checks passed
@osandov
Copy link
Owner

osandov commented Jun 21, 2024

Sorry I missed this one before, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants