Kernel: Add syscall performance event type

This allows tracing the syscalls made by a thread through the kernel's
performance event framework, which is similar in principle to strace.

Currently, this merely logs a stack backtrace to the current thread's
performance event buffer whenever a syscall is made, if profiling is
enabled. Future improvements could include tracing the arguments and
the return value, for example.
This commit is contained in:
Jean-Baptiste Boric 2021-08-10 21:02:59 +02:00 committed by Andreas Kling
commit 0286160b62
Notes: sideshowbarker 2024-07-18 07:09:05 +09:00
6 changed files with 24 additions and 1 deletions

View file

@ -62,6 +62,7 @@ enum {
PERF_EVENT_KMALLOC = 2048,
PERF_EVENT_KFREE = 4096,
PERF_EVENT_PAGE_FAULT = 8192,
PERF_EVENT_SYSCALL = 16384,
};
#define WNOHANG 1