Created
March 21, 2023 09:49
-
-
Save maurorappa/652b5234881684f6a6d5f646f757af86 to your computer and use it in GitHub Desktop.
bpftrace example for debugging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check all available kernel tracepoints, for example: | |
# cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_adjtimex/format | |
name: sys_enter_adjtimex | |
ID: 345 | |
format: | |
….. | |
field:int common_pid; offset:4; size:4; signed:1; | |
….. | |
Run this oneliner using bpftrace utility: | |
# bpftrace -e 'tracepoint:syscalls:sys_enter_adjtimex {printf("clock adjusted by pid %d\n",pid)}' | |
Attaching 1 probe... | |
clock adjusted by pid 199758 | |
clock adjusted by pid 199758 | |
clock adjusted by pid 199758 | |
clock adjusted by pid 199758 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment