[PATCH v1 1/2] syscall.c: split trace_syscall() into 5 functions

Victor Krapivensky krapivenskiy.va at phystech.edu
Mon Jun 5 11:23:40 UTC 2017


On Mon, Jun 05, 2017 at 02:47:41AM +0300, Dmitry V. Levin wrote:
> Why "static inline"?  Is it important whether the function is actually
> inlined or not?  If not, no need to insist on inlining.

OK, removed "inline".

> Why syscall_entering_decode was given this name?  It does get_scno,
> get_syscall_args, decode_mips_subcall, decode_socket_subcall,
> decode_ipc_subcall - in other words, it fetches syscall number
> and arguments.


> This split is not the only one possible, what was the rationale for this
> one?  For example, get_scno and get_syscall_args are not invoked by
> syscall_entering_trace, but get_regs and get_syscall_result are invoked by
> syscall_exiting_trace - why?

The intent is that the entering Lua hook will be run after
syscall_entering_decode (if it returns 1), and the exiting one after
syscall_exiting_measure. This way, the entering hook will be able to
inject return value/signal and affect the way the syscall is traced.




More information about the Strace-devel mailing list