2018-10-21 19:27:44 +02:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2021-06-05 19:49:38 +02:00
|
|
|
#ifndef SYSCALL_TRACE_H
|
|
|
|
#define SYSCALL_TRACE_H
|
2018-10-21 19:27:44 +02:00
|
|
|
|
2022-12-22 13:08:11 +01:00
|
|
|
#include "exec/user/abitypes.h"
|
2023-03-15 18:43:14 +01:00
|
|
|
#include "qemu/plugin.h"
|
2020-02-04 12:20:10 +01:00
|
|
|
#include "trace/trace-root.h"
|
2019-12-11 21:31:10 +01:00
|
|
|
|
2018-10-21 19:27:44 +02:00
|
|
|
/*
|
|
|
|
* 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);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-05-06 15:49:11 +02:00
|
|
|
#endif /* SYSCALL_TRACE_H */
|