-
Notifications
You must be signed in to change notification settings - Fork 364
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
tetra: Add debug progs command #2967
Conversation
56a83c1
to
f15f209
Compare
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
da37531
to
f0033f9
Compare
55bef1e
to
370530f
Compare
8ecdf5f
to
d2ad1a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left two comments about the details, but looks good and very useful, thanks!
cmd/tetra/debug/progs.go
Outdated
flags.BoolVar(&cfg.all, "all", false, "Get all programs") | ||
flags.StringVar(&cfg.lib, "bpf-lib", "bpf/objs/", "Location of Tetragon libs (btf and bpf files)") | ||
flags.StringVar(&cfg.bpffs, "bpf-dir", "/sys/fs/bpf/tetragon", "Location of bpffs tetragon directory") | ||
flags.IntVar(&cfg.timeout, "timeout", 1, "Run in one shot mode with argument of the delay in sec") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flags.IntVar(&cfg.timeout, "timeout", 1, "Run in one shot mode with argument of the delay in sec") | |
flags.IntVar(&cfg.timeout, "timeout", 1, "Interval in seconds (delay in one shot mode)") |
nit, the help text sounds like it automatically enabled the one shot mode
607516b
to
1754996
Compare
Adding tetra debug progs command that enables bpf program stats and collects them for running programs. The deault output looks like: # ./tetra debug progs --once 2024-10-05 20:59:26.75755952 +0000 UTC m=+1.037895215 Ovh(%) Id Cnt Time Name Pin 0.00 1934 0 0 event_execve /sys/fs/bpf/tetragon/__base__/event_execve/prog 0.00 1929 0 0 event_exit_acct_process /sys/fs/bpf/tetragon/__base__/event_exit/prog 0.00 1931 0 0 event_wake_up_new_task /sys/fs/bpf/tetragon/__base__/kprobe_pid_clear/prog 0.00 1937 0 0 tg_kp_bprm_committing_creds /sys/fs/bpf/tetragon/__base__/tg_kp_bprm_committing_creds/prog It provides several options to control timeout and repetition, all should be described in help. Signed-off-by: Jiri Olsa <[email protected]>
We need proper attach string or uprobe programs because they will be part of overhead metrics. Storing attach for standard uprobe, like: Attach="/home/jolsa/tetragon/contrib/tester-progs/nop main" and uprobe multi, like: Attach="uprobe_multi (1 functions)" Signed-off-by: Jiri Olsa <[email protected]>
We need that for proper overhead metrics. Signed-off-by: Jiri Olsa <[email protected]>
1754996
to
c4419e0
Compare
ugh, forgot to push the bpf prog iter bits, it's there now, sorry @lambdanis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works on my machine, thanks
Adding tetra debug progs command that enables bpf program stats and collects them for running programs.
The deault output looks like:
It provides several options to control timeout and repetition, all should be described in help.
TODO will add a way to dump full bpf program name