How to log system calls (the syscall number and the return value, for both int 0x80
and sysenter/syscall
) on FreeBSD 10.1 x86_64 from source code?
I know truss
can do the work, but I need to log other information like the buffer of copyout
during each system call.
I tried to locate the source code of truss
, but failed. Also I tried to trace them in amd64_syscall()
, but the result seems to be incomplete compared to the result of truss
. Any idea about which functions should I care about in the implementation?