From cac8f1aa8774b81f6fe72f670a9413d9287db263 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 17 Sep 2011 12:19:05 -0400 Subject: [PATCH] Allow trace syscall table override Signed-off-by: Mathieu Desnoyers --- .../headers/x86-64-syscalls-3.0.4_integers.h | 182 +++++++++ .../x86-64-syscalls-3.0.4_integers_override.h | 5 + .../headers/x86-64-syscalls-3.0.4_pointers.h | 344 ++++++++++++++++++ .../x86-64-syscalls-3.0.4_pointers_override.h | 5 + .../lttng-syscalls-generate-headers.sh | 11 +- 5 files changed, 544 insertions(+), 3 deletions(-) diff --git a/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_integers.h b/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_integers.h index 4ae864f1..b7a76c8d 100644 --- a/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_integers.h +++ b/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_integers.h @@ -738,95 +738,277 @@ TRACE_EVENT(sys_mmap, #else /* CREATE_SYSCALL_TABLE */ +#include "x86-64-syscalls-3.0.4_integers_override.h" + +#ifndef OVERRIDE_sys_sched_yield TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sched_yield, 24, 0) +#endif +#ifndef OVERRIDE_sys_pause TRACE_SYSCALL_TABLE(syscalls_noargs, sys_pause, 34, 0) +#endif +#ifndef OVERRIDE_sys_getpid TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpid, 39, 0) +#endif +#ifndef OVERRIDE_sys_getuid TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getuid, 102, 0) +#endif +#ifndef OVERRIDE_sys_getgid TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getgid, 104, 0) +#endif +#ifndef OVERRIDE_sys_geteuid TRACE_SYSCALL_TABLE(syscalls_noargs, sys_geteuid, 107, 0) +#endif +#ifndef OVERRIDE_sys_getegid TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getegid, 108, 0) +#endif +#ifndef OVERRIDE_sys_getppid TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getppid, 110, 0) +#endif +#ifndef OVERRIDE_sys_getpgrp TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpgrp, 111, 0) +#endif +#ifndef OVERRIDE_sys_setsid TRACE_SYSCALL_TABLE(syscalls_noargs, sys_setsid, 112, 0) +#endif +#ifndef OVERRIDE_sys_munlockall TRACE_SYSCALL_TABLE(syscalls_noargs, sys_munlockall, 152, 0) +#endif +#ifndef OVERRIDE_sys_vhangup TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vhangup, 153, 0) +#endif +#ifndef OVERRIDE_sys_sync TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sync, 162, 0) +#endif +#ifndef OVERRIDE_sys_gettid TRACE_SYSCALL_TABLE(syscalls_noargs, sys_gettid, 186, 0) +#endif +#ifndef OVERRIDE_sys_restart_syscall TRACE_SYSCALL_TABLE(syscalls_noargs, sys_restart_syscall, 219, 0) +#endif +#ifndef OVERRIDE_sys_inotify_init TRACE_SYSCALL_TABLE(syscalls_noargs, sys_inotify_init, 253, 0) +#endif +#ifndef OVERRIDE_sys_close TRACE_SYSCALL_TABLE(sys_close, sys_close, 3, 1) +#endif +#ifndef OVERRIDE_sys_lseek TRACE_SYSCALL_TABLE(sys_lseek, sys_lseek, 8, 3) +#endif +#ifndef OVERRIDE_sys_mmap TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 9, 6) +#endif +#ifndef OVERRIDE_sys_mprotect TRACE_SYSCALL_TABLE(sys_mprotect, sys_mprotect, 10, 3) +#endif +#ifndef OVERRIDE_sys_munmap TRACE_SYSCALL_TABLE(sys_munmap, sys_munmap, 11, 2) +#endif +#ifndef OVERRIDE_sys_brk TRACE_SYSCALL_TABLE(sys_brk, sys_brk, 12, 1) +#endif +#ifndef OVERRIDE_sys_ioctl TRACE_SYSCALL_TABLE(sys_ioctl, sys_ioctl, 16, 3) +#endif +#ifndef OVERRIDE_sys_mremap TRACE_SYSCALL_TABLE(sys_mremap, sys_mremap, 25, 5) +#endif +#ifndef OVERRIDE_sys_msync TRACE_SYSCALL_TABLE(sys_msync, sys_msync, 26, 3) +#endif +#ifndef OVERRIDE_sys_madvise TRACE_SYSCALL_TABLE(sys_madvise, sys_madvise, 28, 3) +#endif +#ifndef OVERRIDE_sys_shmget TRACE_SYSCALL_TABLE(sys_shmget, sys_shmget, 29, 3) +#endif +#ifndef OVERRIDE_sys_dup TRACE_SYSCALL_TABLE(sys_dup, sys_dup, 32, 1) +#endif +#ifndef OVERRIDE_sys_dup2 TRACE_SYSCALL_TABLE(sys_dup2, sys_dup2, 33, 2) +#endif +#ifndef OVERRIDE_sys_alarm TRACE_SYSCALL_TABLE(sys_alarm, sys_alarm, 37, 1) +#endif +#ifndef OVERRIDE_sys_socket TRACE_SYSCALL_TABLE(sys_socket, sys_socket, 41, 3) +#endif +#ifndef OVERRIDE_sys_shutdown TRACE_SYSCALL_TABLE(sys_shutdown, sys_shutdown, 48, 2) +#endif +#ifndef OVERRIDE_sys_listen TRACE_SYSCALL_TABLE(sys_listen, sys_listen, 50, 2) +#endif +#ifndef OVERRIDE_sys_exit TRACE_SYSCALL_TABLE(sys_exit, sys_exit, 60, 1) +#endif +#ifndef OVERRIDE_sys_kill TRACE_SYSCALL_TABLE(sys_kill, sys_kill, 62, 2) +#endif +#ifndef OVERRIDE_sys_semget TRACE_SYSCALL_TABLE(sys_semget, sys_semget, 64, 3) +#endif +#ifndef OVERRIDE_sys_msgget TRACE_SYSCALL_TABLE(sys_msgget, sys_msgget, 68, 2) +#endif +#ifndef OVERRIDE_sys_fcntl TRACE_SYSCALL_TABLE(sys_fcntl, sys_fcntl, 72, 3) +#endif +#ifndef OVERRIDE_sys_flock TRACE_SYSCALL_TABLE(sys_flock, sys_flock, 73, 2) +#endif +#ifndef OVERRIDE_sys_fsync TRACE_SYSCALL_TABLE(sys_fsync, sys_fsync, 74, 1) +#endif +#ifndef OVERRIDE_sys_fdatasync TRACE_SYSCALL_TABLE(sys_fdatasync, sys_fdatasync, 75, 1) +#endif +#ifndef OVERRIDE_sys_ftruncate TRACE_SYSCALL_TABLE(sys_ftruncate, sys_ftruncate, 77, 2) +#endif +#ifndef OVERRIDE_sys_fchdir TRACE_SYSCALL_TABLE(sys_fchdir, sys_fchdir, 81, 1) +#endif +#ifndef OVERRIDE_sys_fchmod TRACE_SYSCALL_TABLE(sys_fchmod, sys_fchmod, 91, 2) +#endif +#ifndef OVERRIDE_sys_fchown TRACE_SYSCALL_TABLE(sys_fchown, sys_fchown, 93, 3) +#endif +#ifndef OVERRIDE_sys_umask TRACE_SYSCALL_TABLE(sys_umask, sys_umask, 95, 1) +#endif +#ifndef OVERRIDE_sys_ptrace TRACE_SYSCALL_TABLE(sys_ptrace, sys_ptrace, 101, 4) +#endif +#ifndef OVERRIDE_sys_setuid TRACE_SYSCALL_TABLE(sys_setuid, sys_setuid, 105, 1) +#endif +#ifndef OVERRIDE_sys_setgid TRACE_SYSCALL_TABLE(sys_setgid, sys_setgid, 106, 1) +#endif +#ifndef OVERRIDE_sys_setpgid TRACE_SYSCALL_TABLE(sys_setpgid, sys_setpgid, 109, 2) +#endif +#ifndef OVERRIDE_sys_setreuid TRACE_SYSCALL_TABLE(sys_setreuid, sys_setreuid, 113, 2) +#endif +#ifndef OVERRIDE_sys_setregid TRACE_SYSCALL_TABLE(sys_setregid, sys_setregid, 114, 2) +#endif +#ifndef OVERRIDE_sys_setresuid TRACE_SYSCALL_TABLE(sys_setresuid, sys_setresuid, 117, 3) +#endif +#ifndef OVERRIDE_sys_setresgid TRACE_SYSCALL_TABLE(sys_setresgid, sys_setresgid, 119, 3) +#endif +#ifndef OVERRIDE_sys_getpgid TRACE_SYSCALL_TABLE(sys_getpgid, sys_getpgid, 121, 1) +#endif +#ifndef OVERRIDE_sys_setfsuid TRACE_SYSCALL_TABLE(sys_setfsuid, sys_setfsuid, 122, 1) +#endif +#ifndef OVERRIDE_sys_setfsgid TRACE_SYSCALL_TABLE(sys_setfsgid, sys_setfsgid, 123, 1) +#endif +#ifndef OVERRIDE_sys_getsid TRACE_SYSCALL_TABLE(sys_getsid, sys_getsid, 124, 1) +#endif +#ifndef OVERRIDE_sys_personality TRACE_SYSCALL_TABLE(sys_personality, sys_personality, 135, 1) +#endif +#ifndef OVERRIDE_sys_sysfs TRACE_SYSCALL_TABLE(sys_sysfs, sys_sysfs, 139, 3) +#endif +#ifndef OVERRIDE_sys_getpriority TRACE_SYSCALL_TABLE(sys_getpriority, sys_getpriority, 140, 2) +#endif +#ifndef OVERRIDE_sys_setpriority TRACE_SYSCALL_TABLE(sys_setpriority, sys_setpriority, 141, 3) +#endif +#ifndef OVERRIDE_sys_sched_getscheduler TRACE_SYSCALL_TABLE(sys_sched_getscheduler, sys_sched_getscheduler, 145, 1) +#endif +#ifndef OVERRIDE_sys_sched_get_priority_max TRACE_SYSCALL_TABLE(sys_sched_get_priority_max, sys_sched_get_priority_max, 146, 1) +#endif +#ifndef OVERRIDE_sys_sched_get_priority_min TRACE_SYSCALL_TABLE(sys_sched_get_priority_min, sys_sched_get_priority_min, 147, 1) +#endif +#ifndef OVERRIDE_sys_mlock TRACE_SYSCALL_TABLE(sys_mlock, sys_mlock, 149, 2) +#endif +#ifndef OVERRIDE_sys_munlock TRACE_SYSCALL_TABLE(sys_munlock, sys_munlock, 150, 2) +#endif +#ifndef OVERRIDE_sys_mlockall TRACE_SYSCALL_TABLE(sys_mlockall, sys_mlockall, 151, 1) +#endif +#ifndef OVERRIDE_sys_prctl TRACE_SYSCALL_TABLE(sys_prctl, sys_prctl, 157, 5) +#endif +#ifndef OVERRIDE_sys_tkill TRACE_SYSCALL_TABLE(sys_tkill, sys_tkill, 200, 2) +#endif +#ifndef OVERRIDE_sys_io_destroy TRACE_SYSCALL_TABLE(sys_io_destroy, sys_io_destroy, 207, 1) +#endif +#ifndef OVERRIDE_sys_epoll_create TRACE_SYSCALL_TABLE(sys_epoll_create, sys_epoll_create, 213, 1) +#endif +#ifndef OVERRIDE_sys_remap_file_pages TRACE_SYSCALL_TABLE(sys_remap_file_pages, sys_remap_file_pages, 216, 5) +#endif +#ifndef OVERRIDE_sys_timer_getoverrun TRACE_SYSCALL_TABLE(sys_timer_getoverrun, sys_timer_getoverrun, 225, 1) +#endif +#ifndef OVERRIDE_sys_timer_delete TRACE_SYSCALL_TABLE(sys_timer_delete, sys_timer_delete, 226, 1) +#endif +#ifndef OVERRIDE_sys_exit_group TRACE_SYSCALL_TABLE(sys_exit_group, sys_exit_group, 231, 1) +#endif +#ifndef OVERRIDE_sys_tgkill TRACE_SYSCALL_TABLE(sys_tgkill, sys_tgkill, 234, 3) +#endif +#ifndef OVERRIDE_sys_ioprio_set TRACE_SYSCALL_TABLE(sys_ioprio_set, sys_ioprio_set, 251, 3) +#endif +#ifndef OVERRIDE_sys_ioprio_get TRACE_SYSCALL_TABLE(sys_ioprio_get, sys_ioprio_get, 252, 2) +#endif +#ifndef OVERRIDE_sys_inotify_rm_watch TRACE_SYSCALL_TABLE(sys_inotify_rm_watch, sys_inotify_rm_watch, 255, 2) +#endif +#ifndef OVERRIDE_sys_unshare TRACE_SYSCALL_TABLE(sys_unshare, sys_unshare, 272, 1) +#endif +#ifndef OVERRIDE_sys_tee TRACE_SYSCALL_TABLE(sys_tee, sys_tee, 276, 4) +#endif +#ifndef OVERRIDE_sys_timerfd_create TRACE_SYSCALL_TABLE(sys_timerfd_create, sys_timerfd_create, 283, 2) +#endif +#ifndef OVERRIDE_sys_eventfd TRACE_SYSCALL_TABLE(sys_eventfd, sys_eventfd, 284, 1) +#endif +#ifndef OVERRIDE_sys_eventfd2 TRACE_SYSCALL_TABLE(sys_eventfd2, sys_eventfd2, 290, 2) +#endif +#ifndef OVERRIDE_sys_epoll_create1 TRACE_SYSCALL_TABLE(sys_epoll_create1, sys_epoll_create1, 291, 1) +#endif +#ifndef OVERRIDE_sys_dup3 TRACE_SYSCALL_TABLE(sys_dup3, sys_dup3, 292, 3) +#endif +#ifndef OVERRIDE_sys_inotify_init1 TRACE_SYSCALL_TABLE(sys_inotify_init1, sys_inotify_init1, 294, 1) +#endif +#ifndef OVERRIDE_sys_syncfs TRACE_SYSCALL_TABLE(sys_syncfs, sys_syncfs, 306, 1) +#endif +#ifndef OVERRIDE_sys_setns TRACE_SYSCALL_TABLE(sys_setns, sys_setns, 308, 2) +#endif #endif /* CREATE_SYSCALL_TABLE */ diff --git a/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_integers_override.h b/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_integers_override.h index e69de29b..0cdb32a1 100644 --- a/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_integers_override.h +++ b/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_integers_override.h @@ -0,0 +1,5 @@ +#ifndef CREATE_SYSCALL_TABLE + +#else /* CREATE_SYSCALL_TABLE */ + +#endif /* CREATE_SYSCALL_TABLE */ diff --git a/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers.h b/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers.h index b5a19861..19c699df 100644 --- a/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers.h +++ b/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers.h @@ -1558,176 +1558,520 @@ TRACE_EVENT(sys_epoll_pwait, #else /* CREATE_SYSCALL_TABLE */ +#include "x86-64-syscalls-3.0.4_pointers_override.h" + +#ifndef OVERRIDE_sys_read TRACE_SYSCALL_TABLE(sys_read, sys_read, 0, 3) +#endif +#ifndef OVERRIDE_sys_write TRACE_SYSCALL_TABLE(sys_write, sys_write, 1, 3) +#endif +#ifndef OVERRIDE_sys_open TRACE_SYSCALL_TABLE(sys_open, sys_open, 2, 3) +#endif +#ifndef OVERRIDE_sys_newstat TRACE_SYSCALL_TABLE(sys_newstat, sys_newstat, 4, 2) +#endif +#ifndef OVERRIDE_sys_newfstat TRACE_SYSCALL_TABLE(sys_newfstat, sys_newfstat, 5, 2) +#endif +#ifndef OVERRIDE_sys_newlstat TRACE_SYSCALL_TABLE(sys_newlstat, sys_newlstat, 6, 2) +#endif +#ifndef OVERRIDE_sys_poll TRACE_SYSCALL_TABLE(sys_poll, sys_poll, 7, 3) +#endif +#ifndef OVERRIDE_sys_rt_sigaction TRACE_SYSCALL_TABLE(sys_rt_sigaction, sys_rt_sigaction, 13, 4) +#endif +#ifndef OVERRIDE_sys_rt_sigprocmask TRACE_SYSCALL_TABLE(sys_rt_sigprocmask, sys_rt_sigprocmask, 14, 4) +#endif +#ifndef OVERRIDE_sys_readv TRACE_SYSCALL_TABLE(sys_readv, sys_readv, 19, 3) +#endif +#ifndef OVERRIDE_sys_writev TRACE_SYSCALL_TABLE(sys_writev, sys_writev, 20, 3) +#endif +#ifndef OVERRIDE_sys_access TRACE_SYSCALL_TABLE(sys_access, sys_access, 21, 2) +#endif +#ifndef OVERRIDE_sys_pipe TRACE_SYSCALL_TABLE(sys_pipe, sys_pipe, 22, 1) +#endif +#ifndef OVERRIDE_sys_select TRACE_SYSCALL_TABLE(sys_select, sys_select, 23, 5) +#endif +#ifndef OVERRIDE_sys_mincore TRACE_SYSCALL_TABLE(sys_mincore, sys_mincore, 27, 3) +#endif +#ifndef OVERRIDE_sys_shmat TRACE_SYSCALL_TABLE(sys_shmat, sys_shmat, 30, 3) +#endif +#ifndef OVERRIDE_sys_shmctl TRACE_SYSCALL_TABLE(sys_shmctl, sys_shmctl, 31, 3) +#endif +#ifndef OVERRIDE_sys_nanosleep TRACE_SYSCALL_TABLE(sys_nanosleep, sys_nanosleep, 35, 2) +#endif +#ifndef OVERRIDE_sys_getitimer TRACE_SYSCALL_TABLE(sys_getitimer, sys_getitimer, 36, 2) +#endif +#ifndef OVERRIDE_sys_setitimer TRACE_SYSCALL_TABLE(sys_setitimer, sys_setitimer, 38, 3) +#endif +#ifndef OVERRIDE_sys_sendfile64 TRACE_SYSCALL_TABLE(sys_sendfile64, sys_sendfile64, 40, 4) +#endif +#ifndef OVERRIDE_sys_connect TRACE_SYSCALL_TABLE(sys_connect, sys_connect, 42, 3) +#endif +#ifndef OVERRIDE_sys_accept TRACE_SYSCALL_TABLE(sys_accept, sys_accept, 43, 3) +#endif +#ifndef OVERRIDE_sys_sendto TRACE_SYSCALL_TABLE(sys_sendto, sys_sendto, 44, 6) +#endif +#ifndef OVERRIDE_sys_recvfrom TRACE_SYSCALL_TABLE(sys_recvfrom, sys_recvfrom, 45, 6) +#endif +#ifndef OVERRIDE_sys_sendmsg TRACE_SYSCALL_TABLE(sys_sendmsg, sys_sendmsg, 46, 3) +#endif +#ifndef OVERRIDE_sys_recvmsg TRACE_SYSCALL_TABLE(sys_recvmsg, sys_recvmsg, 47, 3) +#endif +#ifndef OVERRIDE_sys_bind TRACE_SYSCALL_TABLE(sys_bind, sys_bind, 49, 3) +#endif +#ifndef OVERRIDE_sys_getsockname TRACE_SYSCALL_TABLE(sys_getsockname, sys_getsockname, 51, 3) +#endif +#ifndef OVERRIDE_sys_getpeername TRACE_SYSCALL_TABLE(sys_getpeername, sys_getpeername, 52, 3) +#endif +#ifndef OVERRIDE_sys_socketpair TRACE_SYSCALL_TABLE(sys_socketpair, sys_socketpair, 53, 4) +#endif +#ifndef OVERRIDE_sys_setsockopt TRACE_SYSCALL_TABLE(sys_setsockopt, sys_setsockopt, 54, 5) +#endif +#ifndef OVERRIDE_sys_getsockopt TRACE_SYSCALL_TABLE(sys_getsockopt, sys_getsockopt, 55, 5) +#endif +#ifndef OVERRIDE_sys_wait4 TRACE_SYSCALL_TABLE(sys_wait4, sys_wait4, 61, 4) +#endif +#ifndef OVERRIDE_sys_newuname TRACE_SYSCALL_TABLE(sys_newuname, sys_newuname, 63, 1) +#endif +#ifndef OVERRIDE_sys_semop TRACE_SYSCALL_TABLE(sys_semop, sys_semop, 65, 3) +#endif +#ifndef OVERRIDE_sys_shmdt TRACE_SYSCALL_TABLE(sys_shmdt, sys_shmdt, 67, 1) +#endif +#ifndef OVERRIDE_sys_msgsnd TRACE_SYSCALL_TABLE(sys_msgsnd, sys_msgsnd, 69, 4) +#endif +#ifndef OVERRIDE_sys_msgrcv TRACE_SYSCALL_TABLE(sys_msgrcv, sys_msgrcv, 70, 5) +#endif +#ifndef OVERRIDE_sys_msgctl TRACE_SYSCALL_TABLE(sys_msgctl, sys_msgctl, 71, 3) +#endif +#ifndef OVERRIDE_sys_truncate TRACE_SYSCALL_TABLE(sys_truncate, sys_truncate, 76, 2) +#endif +#ifndef OVERRIDE_sys_getdents TRACE_SYSCALL_TABLE(sys_getdents, sys_getdents, 78, 3) +#endif +#ifndef OVERRIDE_sys_getcwd TRACE_SYSCALL_TABLE(sys_getcwd, sys_getcwd, 79, 2) +#endif +#ifndef OVERRIDE_sys_chdir TRACE_SYSCALL_TABLE(sys_chdir, sys_chdir, 80, 1) +#endif +#ifndef OVERRIDE_sys_rename TRACE_SYSCALL_TABLE(sys_rename, sys_rename, 82, 2) +#endif +#ifndef OVERRIDE_sys_mkdir TRACE_SYSCALL_TABLE(sys_mkdir, sys_mkdir, 83, 2) +#endif +#ifndef OVERRIDE_sys_rmdir TRACE_SYSCALL_TABLE(sys_rmdir, sys_rmdir, 84, 1) +#endif +#ifndef OVERRIDE_sys_creat TRACE_SYSCALL_TABLE(sys_creat, sys_creat, 85, 2) +#endif +#ifndef OVERRIDE_sys_link TRACE_SYSCALL_TABLE(sys_link, sys_link, 86, 2) +#endif +#ifndef OVERRIDE_sys_unlink TRACE_SYSCALL_TABLE(sys_unlink, sys_unlink, 87, 1) +#endif +#ifndef OVERRIDE_sys_symlink TRACE_SYSCALL_TABLE(sys_symlink, sys_symlink, 88, 2) +#endif +#ifndef OVERRIDE_sys_readlink TRACE_SYSCALL_TABLE(sys_readlink, sys_readlink, 89, 3) +#endif +#ifndef OVERRIDE_sys_chmod TRACE_SYSCALL_TABLE(sys_chmod, sys_chmod, 90, 2) +#endif +#ifndef OVERRIDE_sys_chown TRACE_SYSCALL_TABLE(sys_chown, sys_chown, 92, 3) +#endif +#ifndef OVERRIDE_sys_lchown TRACE_SYSCALL_TABLE(sys_lchown, sys_lchown, 94, 3) +#endif +#ifndef OVERRIDE_sys_gettimeofday TRACE_SYSCALL_TABLE(sys_gettimeofday, sys_gettimeofday, 96, 2) +#endif +#ifndef OVERRIDE_sys_getrlimit TRACE_SYSCALL_TABLE(sys_getrlimit, sys_getrlimit, 97, 2) +#endif +#ifndef OVERRIDE_sys_getrusage TRACE_SYSCALL_TABLE(sys_getrusage, sys_getrusage, 98, 2) +#endif +#ifndef OVERRIDE_sys_sysinfo TRACE_SYSCALL_TABLE(sys_sysinfo, sys_sysinfo, 99, 1) +#endif +#ifndef OVERRIDE_sys_times TRACE_SYSCALL_TABLE(sys_times, sys_times, 100, 1) +#endif +#ifndef OVERRIDE_sys_syslog TRACE_SYSCALL_TABLE(sys_syslog, sys_syslog, 103, 3) +#endif +#ifndef OVERRIDE_sys_getgroups TRACE_SYSCALL_TABLE(sys_getgroups, sys_getgroups, 115, 2) +#endif +#ifndef OVERRIDE_sys_setgroups TRACE_SYSCALL_TABLE(sys_setgroups, sys_setgroups, 116, 2) +#endif +#ifndef OVERRIDE_sys_getresuid TRACE_SYSCALL_TABLE(sys_getresuid, sys_getresuid, 118, 3) +#endif +#ifndef OVERRIDE_sys_getresgid TRACE_SYSCALL_TABLE(sys_getresgid, sys_getresgid, 120, 3) +#endif +#ifndef OVERRIDE_sys_rt_sigpending TRACE_SYSCALL_TABLE(sys_rt_sigpending, sys_rt_sigpending, 127, 2) +#endif +#ifndef OVERRIDE_sys_rt_sigtimedwait TRACE_SYSCALL_TABLE(sys_rt_sigtimedwait, sys_rt_sigtimedwait, 128, 4) +#endif +#ifndef OVERRIDE_sys_rt_sigqueueinfo TRACE_SYSCALL_TABLE(sys_rt_sigqueueinfo, sys_rt_sigqueueinfo, 129, 3) +#endif +#ifndef OVERRIDE_sys_rt_sigsuspend TRACE_SYSCALL_TABLE(sys_rt_sigsuspend, sys_rt_sigsuspend, 130, 2) +#endif +#ifndef OVERRIDE_sys_utime TRACE_SYSCALL_TABLE(sys_utime, sys_utime, 132, 2) +#endif +#ifndef OVERRIDE_sys_mknod TRACE_SYSCALL_TABLE(sys_mknod, sys_mknod, 133, 3) +#endif +#ifndef OVERRIDE_sys_ustat TRACE_SYSCALL_TABLE(sys_ustat, sys_ustat, 136, 2) +#endif +#ifndef OVERRIDE_sys_statfs TRACE_SYSCALL_TABLE(sys_statfs, sys_statfs, 137, 2) +#endif +#ifndef OVERRIDE_sys_fstatfs TRACE_SYSCALL_TABLE(sys_fstatfs, sys_fstatfs, 138, 2) +#endif +#ifndef OVERRIDE_sys_sched_setparam TRACE_SYSCALL_TABLE(sys_sched_setparam, sys_sched_setparam, 142, 2) +#endif +#ifndef OVERRIDE_sys_sched_getparam TRACE_SYSCALL_TABLE(sys_sched_getparam, sys_sched_getparam, 143, 2) +#endif +#ifndef OVERRIDE_sys_sched_setscheduler TRACE_SYSCALL_TABLE(sys_sched_setscheduler, sys_sched_setscheduler, 144, 3) +#endif +#ifndef OVERRIDE_sys_sched_rr_get_interval TRACE_SYSCALL_TABLE(sys_sched_rr_get_interval, sys_sched_rr_get_interval, 148, 2) +#endif +#ifndef OVERRIDE_sys_pivot_root TRACE_SYSCALL_TABLE(sys_pivot_root, sys_pivot_root, 155, 2) +#endif +#ifndef OVERRIDE_sys_sysctl TRACE_SYSCALL_TABLE(sys_sysctl, sys_sysctl, 156, 1) +#endif +#ifndef OVERRIDE_sys_adjtimex TRACE_SYSCALL_TABLE(sys_adjtimex, sys_adjtimex, 159, 1) +#endif +#ifndef OVERRIDE_sys_setrlimit TRACE_SYSCALL_TABLE(sys_setrlimit, sys_setrlimit, 160, 2) +#endif +#ifndef OVERRIDE_sys_chroot TRACE_SYSCALL_TABLE(sys_chroot, sys_chroot, 161, 1) +#endif +#ifndef OVERRIDE_sys_settimeofday TRACE_SYSCALL_TABLE(sys_settimeofday, sys_settimeofday, 164, 2) +#endif +#ifndef OVERRIDE_sys_mount TRACE_SYSCALL_TABLE(sys_mount, sys_mount, 165, 5) +#endif +#ifndef OVERRIDE_sys_umount TRACE_SYSCALL_TABLE(sys_umount, sys_umount, 166, 2) +#endif +#ifndef OVERRIDE_sys_swapon TRACE_SYSCALL_TABLE(sys_swapon, sys_swapon, 167, 2) +#endif +#ifndef OVERRIDE_sys_swapoff TRACE_SYSCALL_TABLE(sys_swapoff, sys_swapoff, 168, 1) +#endif +#ifndef OVERRIDE_sys_reboot TRACE_SYSCALL_TABLE(sys_reboot, sys_reboot, 169, 4) +#endif +#ifndef OVERRIDE_sys_sethostname TRACE_SYSCALL_TABLE(sys_sethostname, sys_sethostname, 170, 2) +#endif +#ifndef OVERRIDE_sys_setdomainname TRACE_SYSCALL_TABLE(sys_setdomainname, sys_setdomainname, 171, 2) +#endif +#ifndef OVERRIDE_sys_init_module TRACE_SYSCALL_TABLE(sys_init_module, sys_init_module, 175, 3) +#endif +#ifndef OVERRIDE_sys_delete_module TRACE_SYSCALL_TABLE(sys_delete_module, sys_delete_module, 176, 2) +#endif +#ifndef OVERRIDE_sys_nfsservctl TRACE_SYSCALL_TABLE(sys_nfsservctl, sys_nfsservctl, 180, 3) +#endif +#ifndef OVERRIDE_sys_setxattr TRACE_SYSCALL_TABLE(sys_setxattr, sys_setxattr, 188, 5) +#endif +#ifndef OVERRIDE_sys_lsetxattr TRACE_SYSCALL_TABLE(sys_lsetxattr, sys_lsetxattr, 189, 5) +#endif +#ifndef OVERRIDE_sys_fsetxattr TRACE_SYSCALL_TABLE(sys_fsetxattr, sys_fsetxattr, 190, 5) +#endif +#ifndef OVERRIDE_sys_getxattr TRACE_SYSCALL_TABLE(sys_getxattr, sys_getxattr, 191, 4) +#endif +#ifndef OVERRIDE_sys_lgetxattr TRACE_SYSCALL_TABLE(sys_lgetxattr, sys_lgetxattr, 192, 4) +#endif +#ifndef OVERRIDE_sys_fgetxattr TRACE_SYSCALL_TABLE(sys_fgetxattr, sys_fgetxattr, 193, 4) +#endif +#ifndef OVERRIDE_sys_listxattr TRACE_SYSCALL_TABLE(sys_listxattr, sys_listxattr, 194, 3) +#endif +#ifndef OVERRIDE_sys_llistxattr TRACE_SYSCALL_TABLE(sys_llistxattr, sys_llistxattr, 195, 3) +#endif +#ifndef OVERRIDE_sys_flistxattr TRACE_SYSCALL_TABLE(sys_flistxattr, sys_flistxattr, 196, 3) +#endif +#ifndef OVERRIDE_sys_removexattr TRACE_SYSCALL_TABLE(sys_removexattr, sys_removexattr, 197, 2) +#endif +#ifndef OVERRIDE_sys_lremovexattr TRACE_SYSCALL_TABLE(sys_lremovexattr, sys_lremovexattr, 198, 2) +#endif +#ifndef OVERRIDE_sys_fremovexattr TRACE_SYSCALL_TABLE(sys_fremovexattr, sys_fremovexattr, 199, 2) +#endif +#ifndef OVERRIDE_sys_time TRACE_SYSCALL_TABLE(sys_time, sys_time, 201, 1) +#endif +#ifndef OVERRIDE_sys_futex TRACE_SYSCALL_TABLE(sys_futex, sys_futex, 202, 6) +#endif +#ifndef OVERRIDE_sys_sched_setaffinity TRACE_SYSCALL_TABLE(sys_sched_setaffinity, sys_sched_setaffinity, 203, 3) +#endif +#ifndef OVERRIDE_sys_sched_getaffinity TRACE_SYSCALL_TABLE(sys_sched_getaffinity, sys_sched_getaffinity, 204, 3) +#endif +#ifndef OVERRIDE_sys_io_setup TRACE_SYSCALL_TABLE(sys_io_setup, sys_io_setup, 206, 2) +#endif +#ifndef OVERRIDE_sys_io_getevents TRACE_SYSCALL_TABLE(sys_io_getevents, sys_io_getevents, 208, 5) +#endif +#ifndef OVERRIDE_sys_io_submit TRACE_SYSCALL_TABLE(sys_io_submit, sys_io_submit, 209, 3) +#endif +#ifndef OVERRIDE_sys_io_cancel TRACE_SYSCALL_TABLE(sys_io_cancel, sys_io_cancel, 210, 3) +#endif +#ifndef OVERRIDE_sys_getdents64 TRACE_SYSCALL_TABLE(sys_getdents64, sys_getdents64, 217, 3) +#endif +#ifndef OVERRIDE_sys_set_tid_address TRACE_SYSCALL_TABLE(sys_set_tid_address, sys_set_tid_address, 218, 1) +#endif +#ifndef OVERRIDE_sys_semtimedop TRACE_SYSCALL_TABLE(sys_semtimedop, sys_semtimedop, 220, 4) +#endif +#ifndef OVERRIDE_sys_timer_create TRACE_SYSCALL_TABLE(sys_timer_create, sys_timer_create, 222, 3) +#endif +#ifndef OVERRIDE_sys_timer_settime TRACE_SYSCALL_TABLE(sys_timer_settime, sys_timer_settime, 223, 4) +#endif +#ifndef OVERRIDE_sys_timer_gettime TRACE_SYSCALL_TABLE(sys_timer_gettime, sys_timer_gettime, 224, 2) +#endif +#ifndef OVERRIDE_sys_clock_settime TRACE_SYSCALL_TABLE(sys_clock_settime, sys_clock_settime, 227, 2) +#endif +#ifndef OVERRIDE_sys_clock_gettime TRACE_SYSCALL_TABLE(sys_clock_gettime, sys_clock_gettime, 228, 2) +#endif +#ifndef OVERRIDE_sys_clock_getres TRACE_SYSCALL_TABLE(sys_clock_getres, sys_clock_getres, 229, 2) +#endif +#ifndef OVERRIDE_sys_clock_nanosleep TRACE_SYSCALL_TABLE(sys_clock_nanosleep, sys_clock_nanosleep, 230, 4) +#endif +#ifndef OVERRIDE_sys_epoll_wait TRACE_SYSCALL_TABLE(sys_epoll_wait, sys_epoll_wait, 232, 4) +#endif +#ifndef OVERRIDE_sys_epoll_ctl TRACE_SYSCALL_TABLE(sys_epoll_ctl, sys_epoll_ctl, 233, 4) +#endif +#ifndef OVERRIDE_sys_utimes TRACE_SYSCALL_TABLE(sys_utimes, sys_utimes, 235, 2) +#endif +#ifndef OVERRIDE_sys_mq_open TRACE_SYSCALL_TABLE(sys_mq_open, sys_mq_open, 240, 4) +#endif +#ifndef OVERRIDE_sys_mq_unlink TRACE_SYSCALL_TABLE(sys_mq_unlink, sys_mq_unlink, 241, 1) +#endif +#ifndef OVERRIDE_sys_mq_timedsend TRACE_SYSCALL_TABLE(sys_mq_timedsend, sys_mq_timedsend, 242, 5) +#endif +#ifndef OVERRIDE_sys_mq_timedreceive TRACE_SYSCALL_TABLE(sys_mq_timedreceive, sys_mq_timedreceive, 243, 5) +#endif +#ifndef OVERRIDE_sys_mq_notify TRACE_SYSCALL_TABLE(sys_mq_notify, sys_mq_notify, 244, 2) +#endif +#ifndef OVERRIDE_sys_mq_getsetattr TRACE_SYSCALL_TABLE(sys_mq_getsetattr, sys_mq_getsetattr, 245, 3) +#endif +#ifndef OVERRIDE_sys_kexec_load TRACE_SYSCALL_TABLE(sys_kexec_load, sys_kexec_load, 246, 4) +#endif +#ifndef OVERRIDE_sys_waitid TRACE_SYSCALL_TABLE(sys_waitid, sys_waitid, 247, 5) +#endif +#ifndef OVERRIDE_sys_inotify_add_watch TRACE_SYSCALL_TABLE(sys_inotify_add_watch, sys_inotify_add_watch, 254, 3) +#endif +#ifndef OVERRIDE_sys_openat TRACE_SYSCALL_TABLE(sys_openat, sys_openat, 257, 4) +#endif +#ifndef OVERRIDE_sys_mkdirat TRACE_SYSCALL_TABLE(sys_mkdirat, sys_mkdirat, 258, 3) +#endif +#ifndef OVERRIDE_sys_mknodat TRACE_SYSCALL_TABLE(sys_mknodat, sys_mknodat, 259, 4) +#endif +#ifndef OVERRIDE_sys_fchownat TRACE_SYSCALL_TABLE(sys_fchownat, sys_fchownat, 260, 5) +#endif +#ifndef OVERRIDE_sys_futimesat TRACE_SYSCALL_TABLE(sys_futimesat, sys_futimesat, 261, 3) +#endif +#ifndef OVERRIDE_sys_newfstatat TRACE_SYSCALL_TABLE(sys_newfstatat, sys_newfstatat, 262, 4) +#endif +#ifndef OVERRIDE_sys_unlinkat TRACE_SYSCALL_TABLE(sys_unlinkat, sys_unlinkat, 263, 3) +#endif +#ifndef OVERRIDE_sys_renameat TRACE_SYSCALL_TABLE(sys_renameat, sys_renameat, 264, 4) +#endif +#ifndef OVERRIDE_sys_linkat TRACE_SYSCALL_TABLE(sys_linkat, sys_linkat, 265, 5) +#endif +#ifndef OVERRIDE_sys_symlinkat TRACE_SYSCALL_TABLE(sys_symlinkat, sys_symlinkat, 266, 3) +#endif +#ifndef OVERRIDE_sys_readlinkat TRACE_SYSCALL_TABLE(sys_readlinkat, sys_readlinkat, 267, 4) +#endif +#ifndef OVERRIDE_sys_fchmodat TRACE_SYSCALL_TABLE(sys_fchmodat, sys_fchmodat, 268, 3) +#endif +#ifndef OVERRIDE_sys_faccessat TRACE_SYSCALL_TABLE(sys_faccessat, sys_faccessat, 269, 3) +#endif +#ifndef OVERRIDE_sys_pselect6 TRACE_SYSCALL_TABLE(sys_pselect6, sys_pselect6, 270, 6) +#endif +#ifndef OVERRIDE_sys_ppoll TRACE_SYSCALL_TABLE(sys_ppoll, sys_ppoll, 271, 5) +#endif +#ifndef OVERRIDE_sys_set_robust_list TRACE_SYSCALL_TABLE(sys_set_robust_list, sys_set_robust_list, 273, 2) +#endif +#ifndef OVERRIDE_sys_get_robust_list TRACE_SYSCALL_TABLE(sys_get_robust_list, sys_get_robust_list, 274, 3) +#endif +#ifndef OVERRIDE_sys_splice TRACE_SYSCALL_TABLE(sys_splice, sys_splice, 275, 6) +#endif +#ifndef OVERRIDE_sys_vmsplice TRACE_SYSCALL_TABLE(sys_vmsplice, sys_vmsplice, 278, 4) +#endif +#ifndef OVERRIDE_sys_utimensat TRACE_SYSCALL_TABLE(sys_utimensat, sys_utimensat, 280, 4) +#endif +#ifndef OVERRIDE_sys_epoll_pwait TRACE_SYSCALL_TABLE(sys_epoll_pwait, sys_epoll_pwait, 281, 6) +#endif +#ifndef OVERRIDE_sys_signalfd TRACE_SYSCALL_TABLE(sys_signalfd, sys_signalfd, 282, 3) +#endif +#ifndef OVERRIDE_sys_timerfd_settime TRACE_SYSCALL_TABLE(sys_timerfd_settime, sys_timerfd_settime, 286, 4) +#endif +#ifndef OVERRIDE_sys_timerfd_gettime TRACE_SYSCALL_TABLE(sys_timerfd_gettime, sys_timerfd_gettime, 287, 2) +#endif +#ifndef OVERRIDE_sys_accept4 TRACE_SYSCALL_TABLE(sys_accept4, sys_accept4, 288, 4) +#endif +#ifndef OVERRIDE_sys_signalfd4 TRACE_SYSCALL_TABLE(sys_signalfd4, sys_signalfd4, 289, 4) +#endif +#ifndef OVERRIDE_sys_pipe2 TRACE_SYSCALL_TABLE(sys_pipe2, sys_pipe2, 293, 2) +#endif +#ifndef OVERRIDE_sys_preadv TRACE_SYSCALL_TABLE(sys_preadv, sys_preadv, 295, 5) +#endif +#ifndef OVERRIDE_sys_pwritev TRACE_SYSCALL_TABLE(sys_pwritev, sys_pwritev, 296, 5) +#endif +#ifndef OVERRIDE_sys_rt_tgsigqueueinfo TRACE_SYSCALL_TABLE(sys_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, 297, 4) +#endif +#ifndef OVERRIDE_sys_perf_event_open TRACE_SYSCALL_TABLE(sys_perf_event_open, sys_perf_event_open, 298, 5) +#endif +#ifndef OVERRIDE_sys_recvmmsg TRACE_SYSCALL_TABLE(sys_recvmmsg, sys_recvmmsg, 299, 5) +#endif +#ifndef OVERRIDE_sys_prlimit64 TRACE_SYSCALL_TABLE(sys_prlimit64, sys_prlimit64, 302, 4) +#endif +#ifndef OVERRIDE_sys_clock_adjtime TRACE_SYSCALL_TABLE(sys_clock_adjtime, sys_clock_adjtime, 305, 2) +#endif +#ifndef OVERRIDE_sys_sendmmsg TRACE_SYSCALL_TABLE(sys_sendmmsg, sys_sendmmsg, 307, 4) +#endif #endif /* CREATE_SYSCALL_TABLE */ diff --git a/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers_override.h b/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers_override.h index e69de29b..0cdb32a1 100644 --- a/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers_override.h +++ b/instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers_override.h @@ -0,0 +1,5 @@ +#ifndef CREATE_SYSCALL_TABLE + +#else /* CREATE_SYSCALL_TABLE */ + +#endif /* CREATE_SYSCALL_TABLE */ diff --git a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh index e90f5ed4..b98a5e10 100644 --- a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh +++ b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh @@ -211,8 +211,9 @@ echo \ #include \"../../../probes/define_trace.h\" #else /* CREATE_SYSCALL_TABLE */ -" >> ${HEADER} +#include \"${INPUTFILE}_${CLASS}_override.h\" +" >> ${HEADER} NRARGS=0 @@ -220,14 +221,18 @@ if [ "$CLASS" = integers ]; then #noargs grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE} perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) .*$/'\ -'TRACE_SYSCALL_TABLE\(syscalls_noargs, sys_$1, $2, $3\)/g'\ +'#ifndef OVERRIDE_sys_$1\n'\ +'TRACE_SYSCALL_TABLE\(syscalls_noargs, sys_$1, $2, $3\)\n'\ +'#endif/g'\ ${TMPFILE} >> ${HEADER} fi #others. grep -v "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE} perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) .*$/'\ -'TRACE_SYSCALL_TABLE(sys_$1, sys_$1, $2, $3)/g'\ +'#ifndef OVERRIDE_sys_$1\n'\ +'TRACE_SYSCALL_TABLE(sys_$1, sys_$1, $2, $3)\n'\ +'#endif/g'\ ${TMPFILE} >> ${HEADER} echo -n \ -- 2.34.1