qemu/include/user/syscall-trace.h
<<
>>
Prefs
   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/*
  14 * These helpers just provide a common place for the various
  15 * subsystems that want to track syscalls to put their hooks in. We
  16 * could potentially unify the -strace code here as well.
  17 */
  18
  19static inline void record_syscall_start(void *cpu, int num,
  20                                        abi_long arg1, abi_long arg2,
  21                                        abi_long arg3, abi_long arg4,
  22                                        abi_long arg5, abi_long arg6,
  23                                        abi_long arg7, abi_long arg8)
  24{
  25    trace_guest_user_syscall(cpu, num,
  26                             arg1, arg2, arg3, arg4,
  27                             arg5, arg6, arg7, arg8);
  28    qemu_plugin_vcpu_syscall(cpu, num,
  29                             arg1, arg2, arg3, arg4,
  30                             arg5, arg6, arg7, arg8);
  31}
  32
  33static inline void record_syscall_return(void *cpu, int num, abi_long ret)
  34{
  35    trace_guest_user_syscall_ret(cpu, num, ret);
  36    qemu_plugin_vcpu_syscall_ret(cpu, num, ret);
  37}
  38
  39
  40#endif /* _SYSCALL_TRACE_H_ */
  41