xref: /openbmc/qemu/include/user/syscall-trace.h (revision d2dfe0b5)
1 /*
2  * Common System Call Tracing Wrappers for *-user
3  *
4  * Copyright (c) 2019 Linaro
5  * Written by Alex Bennée <alex.bennee@linaro.org>
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef SYSCALL_TRACE_H
11 #define SYSCALL_TRACE_H
12 
13 #include "exec/user/abitypes.h"
14 #include "qemu/plugin.h"
15 #include "trace/trace-root.h"
16 
17 /*
18  * These helpers just provide a common place for the various
19  * subsystems that want to track syscalls to put their hooks in. We
20  * could potentially unify the -strace code here as well.
21  */
22 
23 static inline void record_syscall_start(void *cpu, int num,
24                                         abi_long arg1, abi_long arg2,
25                                         abi_long arg3, abi_long arg4,
26                                         abi_long arg5, abi_long arg6,
27                                         abi_long arg7, abi_long arg8)
28 {
29     qemu_plugin_vcpu_syscall(cpu, num,
30                              arg1, arg2, arg3, arg4,
31                              arg5, arg6, arg7, arg8);
32 }
33 
34 static inline void record_syscall_return(void *cpu, int num, abi_long ret)
35 {
36     qemu_plugin_vcpu_syscall_ret(cpu, num, ret);
37 }
38 
39 
40 #endif /* SYSCALL_TRACE_H */
41