Reputation: 1707
I'm trying to debugging SELinux by printing some information in the avc_audit()
function. The information that I need is the current pid and system call. The pid is easy: get_current()->pid
, but I can't find a way to get the current system call that I'm handling.
I have looked at get_wchan()
, but it only works with waiting processes. I could examine the stack just like what get_wchan()
does, but it there a better way?
Upvotes: 2
Views: 426
Reputation: 6768
Call dump_stack() in your code, this will give you the stack trace into the syslog, this should help you determine which syscall was invoked. There are better ways to trace syscall in the kernel, systemtap, ftrace etc. You may want to start off looking into process/strace.stp
Upvotes: 2