Skip to content

Get full command line of a pid #2116

Answered by fbs
udaypalagati asked this question in Q&A
Jan 5, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

we don't have a helper for that, nor seems there to be a BPF helper for it. What I'd do is try to redo the steps in bpf.

The data you want is available in /proc/pid/cmdline so a first guess would be a similar named function:

$ sudo bpftrace -l 'kprobe:*cmdline*'
kprobe:cmdline_partition
kprobe:cmdline_parts_find
kprobe:cmdline_parts_free
kprobe:cmdline_parts_parse
kprobe:cmdline_parts_set
kprobe:cmdline_proc_show
kprobe:drm_connector_pick_cmdline_mode
kprobe:drm_mode_create_from_cmdline_mode
kprobe:drm_mode_parse_cmdline_extra
kprobe:drm_mode_parse_cmdline_options.constprop.0
kprobe:get_cmdline
kprobe:get_mm_cmdline
kprobe:ima_kexec_cmdline
kprobe:proc_pid_cmdline_read
kprobe:vm_cmdline_g…

Replies: 1 comment 3 replies

Comment options

fbs
Jan 6, 2022
Collaborator

You must be logged in to vote
3 replies
@udaypalagati
Comment options

@fbs
Comment options

fbs Jan 7, 2022
Collaborator

@udaypalagati
Comment options

Answer selected by udaypalagati
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants