From 9b6d7a0c0330e95b28909510f979c60c4763af88 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 15 Sep 2011 22:04:23 -0400 Subject: [PATCH] Generate trace syscall table macros Signed-off-by: Mathieu Desnoyers --- .../headers/x86-64-syscalls-3.0.4-integers.h | 90 +++++++++++++++++++ .../lttng-syscalls-generate-headers.sh | 6 ++ 2 files changed, 96 insertions(+) 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 a22e7389..3d6c6b21 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 @@ -526,6 +526,96 @@ TRACE_EVENT(sys_mmap, TP_fast_assign(tp_assign(mmap0, mmap0) tp_assign(mmap1, mmap1) tp_assign(mmap2, 12) tp_assign(mmap3, mmap3) tp_assign(mmap4, mmap4) tp_assign(mmap5, mmap5)), TP_printk() ) +TRACE_SYSCALL_TABLE(sys_close, 3) +TRACE_SYSCALL_TABLE(sys_lseek, 8) +TRACE_SYSCALL_TABLE(sys_mmap, 9) +TRACE_SYSCALL_TABLE(sys_mprotect, 10) +TRACE_SYSCALL_TABLE(sys_munmap, 11) +TRACE_SYSCALL_TABLE(sys_brk, 12) +TRACE_SYSCALL_TABLE(sys_ioctl, 16) +TRACE_SYSCALL_TABLE(sys_sched_yield, 24) +TRACE_SYSCALL_TABLE(sys_mremap, 25) +TRACE_SYSCALL_TABLE(sys_msync, 26) +TRACE_SYSCALL_TABLE(sys_madvise, 28) +TRACE_SYSCALL_TABLE(sys_shmget, 29) +TRACE_SYSCALL_TABLE(sys_dup, 32) +TRACE_SYSCALL_TABLE(sys_dup2, 33) +TRACE_SYSCALL_TABLE(sys_pause, 34) +TRACE_SYSCALL_TABLE(sys_alarm, 37) +TRACE_SYSCALL_TABLE(sys_getpid, 39) +TRACE_SYSCALL_TABLE(sys_socket, 41) +TRACE_SYSCALL_TABLE(sys_shutdown, 48) +TRACE_SYSCALL_TABLE(sys_listen, 50) +TRACE_SYSCALL_TABLE(sys_exit, 60) +TRACE_SYSCALL_TABLE(sys_kill, 62) +TRACE_SYSCALL_TABLE(sys_semget, 64) +TRACE_SYSCALL_TABLE(sys_msgget, 68) +TRACE_SYSCALL_TABLE(sys_fcntl, 72) +TRACE_SYSCALL_TABLE(sys_flock, 73) +TRACE_SYSCALL_TABLE(sys_fsync, 74) +TRACE_SYSCALL_TABLE(sys_fdatasync, 75) +TRACE_SYSCALL_TABLE(sys_ftruncate, 77) +TRACE_SYSCALL_TABLE(sys_fchdir, 81) +TRACE_SYSCALL_TABLE(sys_fchmod, 91) +TRACE_SYSCALL_TABLE(sys_fchown, 93) +TRACE_SYSCALL_TABLE(sys_umask, 95) +TRACE_SYSCALL_TABLE(sys_ptrace, 101) +TRACE_SYSCALL_TABLE(sys_getuid, 102) +TRACE_SYSCALL_TABLE(sys_getgid, 104) +TRACE_SYSCALL_TABLE(sys_setuid, 105) +TRACE_SYSCALL_TABLE(sys_setgid, 106) +TRACE_SYSCALL_TABLE(sys_geteuid, 107) +TRACE_SYSCALL_TABLE(sys_getegid, 108) +TRACE_SYSCALL_TABLE(sys_setpgid, 109) +TRACE_SYSCALL_TABLE(sys_getppid, 110) +TRACE_SYSCALL_TABLE(sys_getpgrp, 111) +TRACE_SYSCALL_TABLE(sys_setsid, 112) +TRACE_SYSCALL_TABLE(sys_setreuid, 113) +TRACE_SYSCALL_TABLE(sys_setregid, 114) +TRACE_SYSCALL_TABLE(sys_setresuid, 117) +TRACE_SYSCALL_TABLE(sys_setresgid, 119) +TRACE_SYSCALL_TABLE(sys_getpgid, 121) +TRACE_SYSCALL_TABLE(sys_setfsuid, 122) +TRACE_SYSCALL_TABLE(sys_setfsgid, 123) +TRACE_SYSCALL_TABLE(sys_getsid, 124) +TRACE_SYSCALL_TABLE(sys_personality, 135) +TRACE_SYSCALL_TABLE(sys_sysfs, 139) +TRACE_SYSCALL_TABLE(sys_getpriority, 140) +TRACE_SYSCALL_TABLE(sys_setpriority, 141) +TRACE_SYSCALL_TABLE(sys_sched_getscheduler, 145) +TRACE_SYSCALL_TABLE(sys_sched_get_priority_max, 146) +TRACE_SYSCALL_TABLE(sys_sched_get_priority_min, 147) +TRACE_SYSCALL_TABLE(sys_mlock, 149) +TRACE_SYSCALL_TABLE(sys_munlock, 150) +TRACE_SYSCALL_TABLE(sys_mlockall, 151) +TRACE_SYSCALL_TABLE(sys_munlockall, 152) +TRACE_SYSCALL_TABLE(sys_vhangup, 153) +TRACE_SYSCALL_TABLE(sys_prctl, 157) +TRACE_SYSCALL_TABLE(sys_sync, 162) +TRACE_SYSCALL_TABLE(sys_gettid, 186) +TRACE_SYSCALL_TABLE(sys_tkill, 200) +TRACE_SYSCALL_TABLE(sys_io_destroy, 207) +TRACE_SYSCALL_TABLE(sys_epoll_create, 213) +TRACE_SYSCALL_TABLE(sys_remap_file_pages, 216) +TRACE_SYSCALL_TABLE(sys_restart_syscall, 219) +TRACE_SYSCALL_TABLE(sys_timer_getoverrun, 225) +TRACE_SYSCALL_TABLE(sys_timer_delete, 226) +TRACE_SYSCALL_TABLE(sys_exit_group, 231) +TRACE_SYSCALL_TABLE(sys_tgkill, 234) +TRACE_SYSCALL_TABLE(sys_ioprio_set, 251) +TRACE_SYSCALL_TABLE(sys_ioprio_get, 252) +TRACE_SYSCALL_TABLE(sys_inotify_init, 253) +TRACE_SYSCALL_TABLE(sys_inotify_rm_watch, 255) +TRACE_SYSCALL_TABLE(sys_unshare, 272) +TRACE_SYSCALL_TABLE(sys_tee, 276) +TRACE_SYSCALL_TABLE(sys_timerfd_create, 283) +TRACE_SYSCALL_TABLE(sys_eventfd, 284) +TRACE_SYSCALL_TABLE(sys_eventfd2, 290) +TRACE_SYSCALL_TABLE(sys_epoll_create1, 291) +TRACE_SYSCALL_TABLE(sys_dup3, 292) +TRACE_SYSCALL_TABLE(sys_inotify_init1, 294) +TRACE_SYSCALL_TABLE(sys_syncfs, 306) +TRACE_SYSCALL_TABLE(sys_setns, 308) #endif /* _TRACE_SYSCALLS_H */ diff --git a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh index f241d343..2e5dcc3c 100644 --- a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh +++ b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh @@ -160,6 +160,12 @@ sed 's/^syscall \([^ ]*\) nr \([^ ]*\) nbargs \([^ ]*\) '\ ')/g'\ ${TMPFILE} >> ${HEADER} +# Macro for tracing syscall table + +sed 's/^syscall \([^ ]*\) nr \([^ ]*\).*$/'\ +'TRACE_SYSCALL_TABLE(sys_\1, \2)/g'\ + ${SRCFILE} >> ${HEADER} + echo -n \ " #endif /* _TRACE_SYSCALLS_H */ -- 2.34.1