#include #include #include #include #include #include #include #include #include #include #include #include "qemu.h" int do_strace=0; struct syscallname { int nr; const char *name; const char *format; void (*call)(const struct syscallname *, abi_long, abi_long, abi_long, abi_long, abi_long, abi_long); void (*result)(const struct syscallname *, abi_long); }; #ifdef __GNUC__ /* * It is possible that target doesn't have syscall that uses * following flags but we don't want the compiler to warn * us about them being unused. Same applies to utility print * functions. It is ok to keep them while not used. */ #define UNUSED __attribute__ ((unused)) #else #define UNUSED #endif /* * Structure used to translate flag values into strings. This is * similar that is in the actual strace tool. */ struct flags { abi_long f_value; /* flag */ const char *f_string; /* stringified flag */ }; /* common flags for all architectures */ #define FLAG_GENERIC(name) { name, #name } /* target specific flags (syscall_defs.h has TARGET_) */ #define FLAG_TARGET(name) { TARGET_ ## name, #name } /* end of flags array */ #define FLAG_END { 0, NULL } UNUSED static const char *get_comma(int); UNUSED static void print_pointer(abi_long, int); UNUSED static void print_flags(const struct flags *, abi_long, int); UNUSED static void print_at_dirfd(abi_long, int); UNUSED static void print_file_mode(abi_long, int); UNUSED static void print_open_flags(abi_long, int); UNUSED static void print_syscall_prologue(const struct syscallname *); UNUSED static void print_syscall_epilogue(const struct syscallname *); UNUSED static void print_string(abi_long, int); UNUSED static void print_raw_param(const char *, abi_long, int); UNUSED static void print_timeval(abi_ulong, int); UNUSED static void print_number(abi_long, int); UNUSED static void print_signal(abi_ulong, int); /* * Utility functions */ static void print_ipc_cmd(int cmd) { #define output_cmd(val) \ if( cmd == val ) { \ gemu_log(#val); \ return; \ } cmd &= 0xff; /* General IPC commands */ output_cmd( IPC_RMID ); output_cmd( IPC_SET ); output_cmd( IPC_STAT ); output_cmd( IPC_INFO ); /* msgctl() commands */ #ifdef __USER_MISC output_cmd( MSG_STAT ); output_cmd( MSG_INFO ); #endif /* shmctl() commands */ output_cmd( SHM_LOCK ); output_cmd( SHM_UNLOCK ); output_cmd( SHM_STAT ); output_cmd( SHM_INFO ); /* semctl() commands */ output_cmd( GETPID ); output_cmd( GETVAL ); output_cmd( GETALL ); output_cmd( GETNCNT ); output_cmd( GETZCNT ); output_cmd( SETVAL ); output_cmd( SETALL ); output_cmd( SEM_STAT ); output_cmd( SEM_INFO ); output_cmd( IPC_RMID ); output_cmd( IPC_RMID ); output_cmd( IPC_RMID ); output_cmd( IPC_RMID ); output_cmd( IPC_RMID ); output_cmd( IPC_RMID ); output_cmd( IPC_RMID ); output_cmd( IPC_RMID ); output_cmd( IPC_RMID ); /* Some value we don't recognize */ gemu_log("%d",cmd); } static void print_signal(abi_ulong arg, int last) { const char *signal_name = NULL; switch(arg) { case TARGET_SIGHUP: signal_name = "SIGHUP"; break; case TARGET_SIGINT: signal_name = "SIGINT"; break; case TARGET_SIGQUIT: signal_name = "SIGQUIT"; break; case TARGET_SIGILL: signal_name = "SIGILL"; break; case TARGET_SIGABRT: signal_name = "SIGABRT"; break; case TARGET_SIGFPE: signal_name = "SIGFPE"; break; case TARGET_SIGKILL: signal_name = "SIGKILL"; break; case TARGET_SIGSEGV: signal_name = "SIGSEGV"; break; case TARGET_SIGPIPE: signal_name = "SIGPIPE"; break; case TARGET_SIGALRM: signal_name = "SIGALRM"; break; case TARGET_SIGTERM: signal_name = "SIGTERM"; break; case TARGET_SIGUSR1: signal_name = "SIGUSR1"; break; case TARGET_SIGUSR2: signal_name = "SIGUSR2"; break; case TARGET_SIGCHLD: signal_name = "SIGCHLD"; break; case TARGET_SIGCONT: signal_name = "SIGCONT"; break; case TARGET_SIGSTOP: signal_name = "SIGSTOP"; break; case TARGET_SIGTTIN: signal_name = "SIGTTIN"; break; case TARGET_SIGTTOU: signal_name = "SIGTTOU"; break; } if (signal_name == NULL) { print_raw_param("%ld", arg, last); return; } gemu_log("%s%s", signal_name, get_comma(last)); } #ifdef TARGET_NR__newselect static void print_fdset(int n, abi_ulong target_fds_addr) { int i; gemu_log("["); if( target_fds_addr ) { abi_long *target_fds; target_fds = lock_user(VERIFY_READ, target_fds_addr, sizeof(*target_fds)*(n / TARGET_ABI_BITS + 1), 1); if (!target_fds) return; for (i=n; i>=0; i--) { if ((tswapal(target_fds[i / TARGET_ABI_BITS]) >> (i & (TARGET_ABI_BITS - 1))) & 1) gemu_log("%d,", i ); } unlock_user(target_fds, target_fds_addr, 0); } gemu_log("]"); } #endif /* * Sysycall specific output functions */ /* select */ #ifdef TARGET_NR__newselect static long newselect_arg1 = 0; static long newselect_arg2 = 0; static long newselect_arg3 = 0; static long newselect_arg4 = 0; static long newselect_arg5 = 0; static void print_newselect(const struct syscallname *name, abi_long arg1, abi_long arg2, abi
##############################################################################
# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
# os-odl_l3-fdio-noha daily task suite

schema: "yardstick:suite:0.1"

name: "os-odl_l3-fdio-noha"
test_cases_dir: "tests/opnfv/test_cases/"
test_cases:
-
  file_name: opnfv_yardstick_tc002.yaml
-
  file_name: opnfv_yardstick_tc005.yaml
-
  file_name: opnfv_yardstick_tc010.yaml
-
  file_name: opnfv_yardstick_tc011.yaml
-
  file_name: opnfv_yardstick_tc012.yaml
-
  file_name: opnfv_yardstick_tc014.yaml
-
  file_name: opnfv_yardstick_tc037.yaml
-
  file_name: opnfv_yardstick_tc069.yaml
-
  file_name: opnfv_yardstick_tc070.yaml
-
  file_name: opnfv_yardstick_tc071.yaml
-
  file_name: opnfv_yardstick_tc072.yaml
i_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); #if defined(TARGET_M68K) print_flags(clone_flags, arg0, 0); print_raw_param("newsp=0x" TARGET_ABI_FMT_lx, arg1, 1); #elif defined(TARGET_SH4) || defined(TARGET_ALPHA) print_flags(clone_flags, arg0, 0); print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx, arg1, 0); print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx, arg2, 0); print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx, arg3, 0); print_raw_param("tls=0x" TARGET_ABI_FMT_lx, arg4, 1); #elif defined(TARGET_CRIS) print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx, arg0, 0); print_flags(clone_flags, arg1, 0); print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx, arg2, 0); print_raw_param("tls=0x" TARGET_ABI_FMT_lx, arg3, 0); print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx, arg4, 1); #else print_flags(clone_flags, arg0, 0); print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx, arg1, 0); print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx, arg2, 0); print_raw_param("tls=0x" TARGET_ABI_FMT_lx, arg3, 0); print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx, arg4, 1); #endif print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_creat static void print_creat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_file_mode(arg1, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_execv static void print_execv(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_raw_param("0x" TARGET_ABI_FMT_lx, arg1, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_faccessat static void print_faccessat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_flags(access_flags, arg2, 0); print_flags(at_file_flags, arg3, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_fchmodat static void print_fchmodat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_file_mode(arg2, 0); print_flags(at_file_flags, arg3, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_fchownat static void print_fchownat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_raw_param("%d", arg2, 0); print_raw_param("%d", arg3, 0); print_flags(at_file_flags, arg4, 1); print_syscall_epilogue(name); } #endif #if defined(TARGET_NR_fcntl) || defined(TARGET_NR_fcntl64) static void print_fcntl(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_raw_param("%d", arg0, 0); switch(arg1) { case TARGET_F_DUPFD: gemu_log("F_DUPFD,"); print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); break; case TARGET_F_GETFD: gemu_log("F_GETFD"); break; case TARGET_F_SETFD: gemu_log("F_SETFD,"); print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); break; case TARGET_F_GETFL: gemu_log("F_GETFL"); break; case TARGET_F_SETFL: gemu_log("F_SETFL,"); print_open_flags(arg2, 1); break; case TARGET_F_GETLK: gemu_log("F_GETLK,"); print_pointer(arg2, 1); break; case TARGET_F_SETLK: gemu_log("F_SETLK,"); print_pointer(arg2, 1); break; case TARGET_F_SETLKW: gemu_log("F_SETLKW,"); print_pointer(arg2, 1); break; case TARGET_F_GETOWN: gemu_log("F_GETOWN"); break; case TARGET_F_SETOWN: gemu_log("F_SETOWN,"); print_raw_param(TARGET_ABI_FMT_ld, arg2, 0); break; case TARGET_F_GETSIG: gemu_log("F_GETSIG"); break; case TARGET_F_SETSIG: gemu_log("F_SETSIG,"); print_raw_param(TARGET_ABI_FMT_ld, arg2, 0); break; #if TARGET_ABI_BITS == 32 case TARGET_F_GETLK64: gemu_log("F_GETLK64,"); print_pointer(arg2, 1); break; case TARGET_F_SETLK64: gemu_log("F_SETLK64,"); print_pointer(arg2, 1); break; case TARGET_F_SETLKW64: gemu_log("F_SETLKW64,"); print_pointer(arg2, 1); break; #endif case TARGET_F_SETLEASE: gemu_log("F_SETLEASE,"); print_raw_param(TARGET_ABI_FMT_ld, arg2, 0); break; case TARGET_F_GETLEASE: gemu_log("F_GETLEASE"); break; case TARGET_F_DUPFD_CLOEXEC: gemu_log("F_DUPFD_CLOEXEC,"); print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); break; case TARGET_F_NOTIFY: gemu_log("F_NOTIFY,"); print_raw_param(TARGET_ABI_FMT_ld, arg2, 0); break; default: print_raw_param(TARGET_ABI_FMT_ld, arg1, 0); print_pointer(arg2, 1); break; } print_syscall_epilogue(name); } #define print_fcntl64 print_fcntl #endif #ifdef TARGET_NR_futimesat static void print_futimesat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_timeval(arg2, 0); print_timeval(arg2 + sizeof (struct target_timeval), 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_link static void print_link(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_string(arg1, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_linkat static void print_linkat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_at_dirfd(arg2, 0); print_string(arg3, 0); print_flags(at_file_flags, arg4, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR__llseek static void print__llseek(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { const char *whence = "UNKNOWN"; print_syscall_prologue(name); print_raw_param("%d", arg0, 0); print_raw_param("%ld", arg1, 0); print_raw_param("%ld", arg2, 0); print_pointer(arg3, 0); switch(arg4) { case SEEK_SET: whence = "SEEK_SET"; break; case SEEK_CUR: whence = "SEEK_CUR"; break; case SEEK_END: whence = "SEEK_END"; break; } gemu_log("%s",whence); print_syscall_epilogue(name); } #endif #if defined(TARGET_NR_stat) || defined(TARGET_NR_stat64) || \ defined(TARGET_NR_lstat) || defined(TARGET_NR_lstat64) static void print_stat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_pointer(arg1, 1); print_syscall_epilogue(name); } #define print_lstat print_stat #define print_stat64 print_stat #define print_lstat64 print_stat #endif #if defined(TARGET_NR_fstat) || defined(TARGET_NR_fstat64) static void print_fstat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_raw_param("%d", arg0, 0); print_pointer(arg1, 1); print_syscall_epilogue(name); } #define print_fstat64 print_fstat #endif #ifdef TARGET_NR_mkdir static void print_mkdir(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_file_mode(arg1, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_mkdirat static void print_mkdirat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_file_mode(arg2, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_rmdir static void print_rmdir(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_rt_sigaction static void print_rt_sigaction(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_signal(arg0, 0); print_pointer(arg1, 0); print_pointer(arg2, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_rt_sigprocmask static void print_rt_sigprocmask(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { const char *how = "UNKNOWN"; print_syscall_prologue(name); switch(arg0) { case TARGET_SIG_BLOCK: how = "SIG_BLOCK"; break; case TARGET_SIG_UNBLOCK: how = "SIG_UNBLOCK"; break; case TARGET_SIG_SETMASK: how = "SIG_SETMASK"; break; } gemu_log("%s,",how); print_pointer(arg1, 0); print_pointer(arg2, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_mknod static void print_mknod(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { int hasdev = (arg1 & (S_IFCHR|S_IFBLK)); print_syscall_prologue(name); print_string(arg0, 0); print_file_mode(arg1, (hasdev == 0)); if (hasdev) { print_raw_param("makedev(%d", major(arg2), 0); print_raw_param("%d)", minor(arg2), 1); } print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_mknodat static void print_mknodat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { int hasdev = (arg2 & (S_IFCHR|S_IFBLK)); print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_file_mode(arg2, (hasdev == 0)); if (hasdev) { print_raw_param("makedev(%d", major(arg3), 0); print_raw_param("%d)", minor(arg3), 1); } print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_mq_open static void print_mq_open(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { int is_creat = (arg1 & TARGET_O_CREAT); print_syscall_prologue(name); print_string(arg0, 0); print_open_flags(arg1, (is_creat == 0)); if (is_creat) { print_file_mode(arg2, 0); print_pointer(arg3, 1); } print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_open static void print_open(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { int is_creat = (arg1 & TARGET_O_CREAT); print_syscall_prologue(name); print_string(arg0, 0); print_open_flags(arg1, (is_creat == 0)); if (is_creat) print_file_mode(arg2, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_openat static void print_openat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { int is_creat = (arg2 & TARGET_O_CREAT); print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_open_flags(arg2, (is_creat == 0)); if (is_creat) print_file_mode(arg3, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_mq_unlink static void print_mq_unlink(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 1); print_syscall_epilogue(name); } #endif #if defined(TARGET_NR_fstatat64) || defined(TARGET_NR_newfstatat) static void print_fstatat64(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_pointer(arg2, 0); print_flags(at_file_flags, arg3, 1); print_syscall_epilogue(name); } #define print_newfstatat print_fstatat64 #endif #ifdef TARGET_NR_readlink static void print_readlink(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_pointer(arg1, 0); print_raw_param("%u", arg2, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_readlinkat static void print_readlinkat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_pointer(arg2, 0); print_raw_param("%u", arg3, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_rename static void print_rename(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_string(arg1, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_renameat static void print_renameat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_at_dirfd(arg2, 0); print_string(arg3, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_statfs static void print_statfs(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_pointer(arg1, 1); print_syscall_epilogue(name); } #define print_statfs64 print_statfs #endif #ifdef TARGET_NR_symlink static void print_symlink(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_string(arg1, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_symlinkat static void print_symlinkat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_at_dirfd(arg1, 0); print_string(arg2, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_mount static void print_mount(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_string(arg1, 0); print_string(arg2, 0); print_flags(mount_flags, arg3, 0); print_pointer(arg4, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_umount static void print_umount(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_umount2 static void print_umount2(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_flags(umount2_flags, arg1, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_unlink static void print_unlink(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_unlinkat static void print_unlinkat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_flags(unlinkat_flags, arg2, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_utime static void print_utime(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_pointer(arg1, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_utimes static void print_utimes(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_string(arg0, 0); print_pointer(arg1, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_utimensat static void print_utimensat(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_at_dirfd(arg0, 0); print_string(arg1, 0); print_pointer(arg2, 0); print_flags(at_file_flags, arg3, 1); print_syscall_epilogue(name); } #endif #if defined(TARGET_NR_mmap) || defined(TARGET_NR_mmap2) static void print_mmap(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_pointer(arg0, 0); print_raw_param("%d", arg1, 0); print_flags(mmap_prot_flags, arg2, 0); print_flags(mmap_flags, arg3, 0); print_raw_param("%d", arg4, 0); print_raw_param("%#x", arg5, 1); print_syscall_epilogue(name); } #define print_mmap2 print_mmap #endif #ifdef TARGET_NR_mprotect static void print_mprotect(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_pointer(arg0, 0); print_raw_param("%d", arg1, 0); print_flags(mmap_prot_flags, arg2, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_munmap static void print_munmap(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_pointer(arg0, 0); print_raw_param("%d", arg1, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_futex static void print_futex_op(abi_long tflag, int last) { #define print_op(val) \ if( cmd == val ) { \ gemu_log(#val); \ return; \ } int cmd = (int)tflag; #ifdef FUTEX_PRIVATE_FLAG if (cmd & FUTEX_PRIVATE_FLAG) { gemu_log("FUTEX_PRIVATE_FLAG|"); cmd &= ~FUTEX_PRIVATE_FLAG; } #endif #ifdef FUTEX_CLOCK_REALTIME if (cmd & FUTEX_CLOCK_REALTIME) { gemu_log("FUTEX_CLOCK_REALTIME|"); cmd &= ~FUTEX_CLOCK_REALTIME; } #endif print_op(FUTEX_WAIT) print_op(FUTEX_WAKE) print_op(FUTEX_FD) print_op(FUTEX_REQUEUE) print_op(FUTEX_CMP_REQUEUE) print_op(FUTEX_WAKE_OP) print_op(FUTEX_LOCK_PI) print_op(FUTEX_UNLOCK_PI) print_op(FUTEX_TRYLOCK_PI) #ifdef FUTEX_WAIT_BITSET print_op(FUTEX_WAIT_BITSET) #endif #ifdef FUTEX_WAKE_BITSET print_op(FUTEX_WAKE_BITSET) #endif /* unknown values */ gemu_log("%d",cmd); } static void print_futex(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_pointer(arg0, 0); print_futex_op(arg1, 0); print_raw_param(",%d", arg2, 0); print_pointer(arg3, 0); /* struct timespec */ print_pointer(arg4, 0); print_raw_param("%d", arg4, 1); print_syscall_epilogue(name); } #endif #ifdef TARGET_NR_kill static void print_kill(const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { print_syscall_prologue(name); print_raw_param("%d", arg0, 0); print_signal(arg1, 1); print_syscall_epilogue(name); } #endif /* * An array of all of the syscalls we know about */ static const struct syscallname scnames[] = { #include "strace.list" }; static int nsyscalls = ARRAY_SIZE(scnames); /* * The public interface to this module. */ void print_syscall(int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) { int i; const char *format="%s(" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld ")"; gemu_log("%d ", getpid() ); for(i=0;i