diff options
author | Emilio G. Cota | 2018-10-21 19:27:44 +0200 |
---|---|---|
committer | Alex Bennée | 2019-10-28 16:12:38 +0100 |
commit | c36f7a642cd81cff566ffe23e0a863ac4d7f1f91 (patch) | |
tree | 982cd3975a978ac5e031cde5922238c361949cc2 /include/user/syscall-trace.h | |
parent | *-user: notify plugin of exit (diff) | |
download | qemu-c36f7a642cd81cff566ffe23e0a863ac4d7f1f91.tar.gz qemu-c36f7a642cd81cff566ffe23e0a863ac4d7f1f91.tar.xz qemu-c36f7a642cd81cff566ffe23e0a863ac4d7f1f91.zip |
*-user: plugin syscalls
To avoid too much duplication add a wrapper that the existing trace
and the new plugin calls can live in. We could move the -strace code
here as well but that is left for a future series as the code is
subtly different between the bsd and linux.
Signed-off-by: Emilio G. Cota <cota@braap.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
[AJB: wrap in syscall-trace.h, expand commit msg]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Diffstat (limited to 'include/user/syscall-trace.h')
-rw-r--r-- | include/user/syscall-trace.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h new file mode 100644 index 0000000000..9e60473643 --- /dev/null +++ b/include/user/syscall-trace.h @@ -0,0 +1,40 @@ +/* + * Common System Call Tracing Wrappers for *-user + * + * Copyright (c) 2019 Linaro + * Written by Alex Bennée <alex.bennee@linaro.org> + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef _SYSCALL_TRACE_H_ +#define _SYSCALL_TRACE_H_ + +/* + * These helpers just provide a common place for the various + * subsystems that want to track syscalls to put their hooks in. We + * could potentially unify the -strace code here as well. + */ + +static inline void record_syscall_start(void *cpu, int num, + abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, + abi_long arg5, abi_long arg6, + abi_long arg7, abi_long arg8) +{ + trace_guest_user_syscall(cpu, num, + arg1, arg2, arg3, arg4, + arg5, arg6, arg7, arg8); + qemu_plugin_vcpu_syscall(cpu, num, + arg1, arg2, arg3, arg4, + arg5, arg6, arg7, arg8); +} + +static inline void record_syscall_return(void *cpu, int num, abi_long ret) +{ + trace_guest_user_syscall_ret(cpu, num, ret); + qemu_plugin_vcpu_syscall_ret(cpu, num, ret); +} + + +#endif /* _SYSCALL_TRACE_H_ */ |