ARM: Resolve sys_unknown system calls
A message that is not in the archive (sent off-list or not yet received): [email protected]
----- Original Message -----
Quoted 9 lines
From: "Jan Glauber" <[email protected]>
To: [email protected]
Sent: Friday, April 11, 2014 8:13:46 AM
Subject: [lttng-dev] [Patch lttng-modules] ARM: Resolvesys_unknownsystem callsThe LTTng system call extractor relies on kallsyms. Not every system call is defined in the kernel with
SYSCALL_DEFINE, so some system calls are missing in kallsyms and shown assys_unknownby LTTng.
Quoted 10 lines
Manually declare the following missing calls for the ARM list:
-sys_recv
-sys_sigreturn
-sys_rt_sigreturn
-sys_pread64
-sys_prwite64
-sys_vfork
-sys_ftruncate64
-sys_fstatfs64
-sys_fallocate
At the top of each file you modified, there is a big
/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */
comment. I created the "override" header files for this exact purpose: make sure the manual overrides are not lost when we automatically generate the header from a future kernel version.
Please move those changes to the override headers where they belong.
Thanks,
Mathieu
Quoted 377 lines
Signed-off-by Jan Glauber <[email protected]>--- instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 | 9 +++ instrumentation/headers/arm-32-syscalls-3.4.25_integers.h | 30 ++++++++ instrumentation/headers/arm-32-syscalls-3.4.25_pointers.h | 72 ++++++++++++++++++++ 3 files changed, 111 insertions(+)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -80,6 +80,7 @@ syscall sys_wait4 nr 114 nbargs 4 types: (pid_t, int *,int, struct rusage *) ar
syscallsys_swapoffnr 115 nbargs 1 types: (const char *) args:
(specialfile)
syscallsys_sysinfonr 116 nbargs 1 types: (struct sysinfo *) args: (info) syscallsys_fsyncnr 118 nbargs 1 types: (unsigned int) args: (fd)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +3
-0+syscall sys_sigreturn nr 119 nbargs 1 types: (struct pt_regs *) args: (regs) syscall sys_setdomainname nr 121 nbargs 2 types: (char *, int) args: (name, len) syscall sys_newuname nr 122 nbargs 1 types: (struct new_utsname *) args: (name) syscall sys_adjtimex nr 124 nbargs 1 types: (struct timex *) args: (txc_p)@@ -125,18 +126,23 @@ syscall sys_poll nr 168 nbargs 3 types: (struct pollfd *, unsigned int, int) arg syscall sys_setresgid16 nr 170 nbargs 3 types: (old_gid_t, old_gid_t, old_gid_t) args: (rgid, egid, sgid) syscall sys_getresgid16 nr 171 nbargs 3 types: (old_gid_t *, old_gid_t *, old_gid_t *) args: (rgid, egid, sgid) syscall sys_prctl nr 172 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) +syscall sys_rt_sigreturn nr 173 nbargs 1 types: (struct pt_regs *) args: (regs) syscall sys_rt_sigaction nr 174 nbargs 4 types: (int, const struct sigaction *, struct sigaction *, size_t) args: (sig, act, oact, sigsetsize) syscall sys_rt_sigprocmask nr 175 nbargs 4 types: (int, sigset_t *, sigset_t *, size_t) args: (how, nset, oset, sigsetsize) syscall sys_rt_sigpending nr 176 nbargs 2 types: (sigset_t *, size_t) args: (set, sigsetsize) syscall sys_rt_sigtimedwait nr 177 nbargs 4 types: (const sigset_t *, siginfo_t *, const struct timespec *, size_t) args: (uthese, uinfo, uts, sigsetsize) syscall sys_rt_sigqueueinfo nr 178 nbargs 3 types: (pid_t, int, siginfo_t *) args: (pid, sig, uinfo) syscall sys_rt_sigsuspend nr 179 nbargs 2 types: (sigset_t *, size_t) args: (unewset, sigsetsize) +syscall sys_pread64 nr 180 nbargs 4 types: (unsigned int, const char *,
size_t,loff_t) args: (fd, buf, count, pos)
+syscallsys_pwrite64nr 181 nbargs 4 types: (unsigned int, const char *,size_t,loff_t) args: (fd, buf, count, pos)
syscallsys_chown16nr 182 nbargs 3 types: (const char *,old_uid_t,old_gid_t) args: (filename, user, group)
syscallsys_getcwdnr 183 nbargs 2 types: (char *, unsigned long) args:
(buf, size)
syscallsys_capgetnr 184 nbargs 2 types: (cap_user_header_t,cap_user_data_t) args: (header, dataptr)
syscallsys_capsetnr 185 nbargs 2 types: (cap_user_header_t, constcap_user_data_t) args: (header, data)
syscallsys_sendfilenr 187 nbargs 4 types: (int, int,off_t*,size_t)
args: (out_fd,in_fd, offset, count)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +2
-0+syscall sys_vfork nr 190 nbargs 0 types: () args: () syscall sys_getrlimit nr 191 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) +syscall sys_ftruncate64 nr 194 nbargs 2 types: (unsigned int, loff_t) args:(fd, length)
syscallsys_stat64nr 195 nbargs 2 types: (const char *, struct stat64 *)
args: (filename, statbuf)
syscallsys_lstat64nr 196 nbargs 2 types: (const char *, struct stat64 *)
args: (filename, statbuf)
syscallsys_fstat64nr 197 nbargs 2 types: (unsigned long, struct stat64 *)
args: (fd, statbuf)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -202,6 +208,7 @@ syscall sys_clock_settime nr 262 nbargs 2 types: (const
clockid_t, const struct
syscallsys_clock_gettimenr 263 nbargs 2 types: (constclockid_t, struct timespec *) args: (which_clock, tp)
syscallsys_clock_getresnr 264 nbargs 2 types: (constclockid_t, struct timespec *) args: (which_clock, tp)
syscallsys_clock_nanosleepnr 265 nbargs 4 types: (constclockid_t, int, const struct timespec *, struct timespec *) args: (which_clock, flags, rqtp, rmtp)
+syscallsys_fstatfs64nr 267 nbargs 3 types: (unsigned int,size_t, struct statfs64 *) args: (fd, sz, buf)
syscallsys_tgkillnr 268 nbargs 3 types: (pid_t,pid_t, int) args: (tgid, pid, sig)
syscallsys_utimesnr 269 nbargs 2 types: (char *, struct timeval *) args:
(filename, utimes)
syscallsys_mq_opennr 274 nbargs 4 types: (const char *, int,umode_t, structmq_attr*) args: (u_name, oflag, mode,u_attr)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -221,6 +228,7 @@ syscall sys_getpeername nr 287 nbargs 3 types: (int,struct sockaddr *, int *) a
syscallsys_socketpairnr 288 nbargs 4 types: (int, int, int, int *) args:
(family, type, protocol, usockvec)
syscallsys_sendnr 289 nbargs 4 types: (int, void *,size_t, unsigned)
args: (fd, buff, len, flags)
syscallsys_sendtonr 290 nbargs 6 types: (int, void *,size_t, unsigned, struct sockaddr *, int) args: (fd, buff, len, flags, addr,addr_len)
+syscallsys_recvnr 291 nbargs 6 types: (int, void *,size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr,addr_len)
syscallsys_recvfromnr 292 nbargs 6 types: (int, void *,size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr,addr_len) syscallsys_shutdownnr 293 nbargs 2 types: (int, int) args: (fd, how) syscallsys_setsockoptnr 294 nbargs 5 types: (int, int, int, char *, int)
args: (fd, level, optname, optval, optlen)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -273,6 +281,7 @@ syscall sys_utimensat nr 348 nbargs 4 types: (int, constchar *, struct timespec
syscallsys_signalfdnr 349 nbargs 3 types: (int,sigset_t*,size_t) args:
(ufd,user_mask, sizemask)
syscallsys_timerfd_createnr 350 nbargs 2 types: (int, int) args: (clockid, flags)
syscallsys_eventfdnr 351 nbargs 1 types: (unsigned int) args: (count)
+syscallsys_fallocatenr 352 nbargs 4 types: (int, int,loff_t,loff_t)
args: (fd, mode, offset, len)
syscallsys_timerfd_settimenr 353 nbargs 4 types: (int, int, const struct itimerspec *, struct itimerspec *) args: (ufd, flags, utmr, otmr) syscallsys_timerfd_gettimenr 354 nbargs 2 types: (int, struct itimerspec *) args: (ufd, otmr)
syscallsys_signalfd4nr 355 nbargs 4 types: (int,sigset_t*,size_t, int)
args: (ufd,user_mask, sizemask, flags)
diff --gita/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers.hb/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers.hindex 9b10e5e..444de89 100644instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers.h +21
-0@@ -56,6 +56,9 @@ SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_munlockall)#ifndef OVERRIDE_32_sys_sched_yield SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sched_yield)#endif +#ifndef OVERRIDE_32_sys_vfork +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_vfork) +#endif #ifndef OVERRIDE_32_sys_getuid SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getuid)#endif @@ -497,6 +500,15 @@ SC_TRACE_EVENT(sys_munlock, TP_printk() )#endif +#ifndef OVERRIDE_32_sys_ftruncate64 +SC_TRACE_EVENT (sys_ftruncate64, + TP_PROTO(unsigned int fd, loff_t length), +TP_ARGS (fd, length), + TP_STRUCT__entry(__field(unsigned int, fd) __field(loff_t, length)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(length, length)), +TP_printk () +) +#endif #ifndef OVERRIDE_32_sys_setreuid SC_TRACE_EVENT(sys_setreuid, TP_PROTO(uid_t ruid, uid_t euid),@@ -812,6 +824,15 @@ SC_TRACE_EVENT(sys_tee, TP_printk() )#endif +#ifndef OVERRIDE_32_sys_fallocate +SC_TRACE_EVENT (sys_fallocate, + TP_PROTO(int fd, int mode, loff_t offset, loff_t len), +TP_ARGS (fd, mode, offset, len), + TP_STRUCT__entry(__field(int, fd) __field(int, mode) __field(loff_t, offset) __field(loff_t, len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(mode, mode) tp_assign(offset, offset) tp_assign(len, len)), +TP_printk () +) +#endif #ifndef OVERRIDE_32_sys_mremapSC_TRACE_EVENT(sys_mremap,
instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers.h +3
-0TP_PROTO(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr),@@ -901,6 +922,9 @@ TRACE_SYSCALL_TABLE(syscalls_noargs, sys_munlockall, 153, 0)#ifndef OVERRIDE_TABLE_32_sys_sched_yield TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sched_yield, 158, 0)#endif +#ifndef OVERRIDE_TABLE_32_sys_vfork +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vfork, 190, 0) +#endif #ifndef OVERRIDE_TABLE_32_sys_getuidTRACE_SYSCALL_TABLE (syscalls_noargs, sys_getuid,199 ,0 )#endif
instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers.h +3
-0@@ -1057,6 +1081,9 @@ TRACE_SYSCALL_TABLE(sys_setresgid16, sys_setresgid16, 170, 3)#ifndef OVERRIDE_TABLE_32_sys_prctl TRACE_SYSCALL_TABLE(sys_prctl, sys_prctl, 172, 5)#endif +#ifndef OVERRIDE_TABLE_32_sys_ftruncate64 +TRACE_SYSCALL_TABLE(sys_ftruncate64, sys_ftruncate64, 194, 2) +#endif #ifndef OVERRIDE_TABLE_32_sys_setreuidTRACE_SYSCALL_TABLE (sys_setreuid, sys_setreuid,203 ,2 )#endif
instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers.h +3
-0@@ -1156,6 +1183,9 @@ TRACE_SYSCALL_TABLE(sys_timerfd_create, sys_timerfd_create, 350, 2)#ifndef OVERRIDE_TABLE_32_sys_eventfd TRACE_SYSCALL_TABLE(sys_eventfd, sys_eventfd, 351, 1)#endif +#ifndef OVERRIDE_TABLE_32_sys_fallocate +TRACE_SYSCALL_TABLE(sys_fallocate, sys_fallocate, 352, 4) +#endif #ifndef OVERRIDE_TABLE_32_sys_eventfd2TRACE_SYSCALL_TABLE (sys_eventfd2, sys_eventfd2,356 ,2 )#endif
diff --gita/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.hb/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.hindex 3a9c146..796ca52 100644instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.h +27
-0@@ -108,6 +108,15 @@ SC_TRACE_EVENT(sys_sysinfo, TP_printk() )#endif +#ifndef OVERRIDE_32_sys_sigreturn +SC_TRACE_EVENT (sys_sigreturn, + TP_PROTO(struct pt_regs * regs), +TP_ARGS (regs), + TP_STRUCT__entry(__field_hex(struct pt_regs *, regs)), +TP_fast_assign (tp_assign (regs, regs)), +TP_printk () +) +#endif #ifndef OVERRIDE_32_sys_newuname SC_TRACE_EVENT(sys_newuname, TP_PROTO(struct new_utsname * name),@@ -135,6 +144,15 @@ SC_TRACE_EVENT(sys_sysctl, TP_printk() )#endif +#ifndef OVERRIDE_32_sys_rt_sigreturn +SC_TRACE_EVENT (sys_rt_sigreturn, + TP_PROTO(struct pt_regs * regs), +TP_ARGS (regs), + TP_STRUCT__entry(__field_hex(struct pt_regs *, regs)), +TP_fast_assign (tp_assign (regs, regs)), +TP_printk () +) +#endif #ifndef OVERRIDE_32_sys_set_tid_address SC_TRACE_EVENT(sys_set_tid_address, TP_PROTO(int * tidptr),@@ -945,6 +963,15 @@ SC_TRACE_EVENT(sys_timer_create, TP_printk() )#endif +#ifndef OVERRIDE_32_sys_fstatfs64 +SC_TRACE_EVENT (sys_fstatfs64, + TP_PROTO(unsigned int fd, size_t sz, struct statfs64 * buf), +TP_ARGS (fd, sz, buf), + TP_STRUCT__entry(__field(unsigned int, fd) __field(size_t, sz) __field_hex(struct statfs64 *, buf)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(sz, sz) tp_assign(buf, buf)), +TP_printk () +) +#endif #ifndef OVERRIDE_32_sys_mq_getsetattr SC_TRACE_EVENT(sys_mq_getsetattr,instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.h +15
-0TP_PROTO(mqd_t mqdes, const struct mq_attr * u_mqstat, struct mq_attr * u_omqstat),@@ -1206,6 +1233,24 @@ SC_TRACE_EVENT(sys_rt_sigtimedwait, TP_printk() )#endif +#ifndef OVERRIDE_32_sys_pread64 +SC_TRACE_EVENT (sys_pread64, + TP_PROTO(unsigned int fd, const char * buf, size_t count, loff_t pos), +TP_ARGS (fd, buf, count, pos), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count) __field(loff_t, pos)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count) tp_assign(pos, pos)), +TP_printk () +) +#endif +#ifndef OVERRIDE_32_sys_pwrite64 +SC_TRACE_EVENT(sys_pwrite64, + TP_PROTO(unsigned int fd, const char * buf, size_t count, loff_t pos), + TP_ARGS(fd, buf, count, pos), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count) __field(loff_t, pos)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count,count)
tp_assign(pos, pos)),instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.h +9
-0+ TP_printk() +) +#endif #ifndef OVERRIDE_32_sys_sendfile SC_TRACE_EVENT(sys_sendfile, TP_PROTO(int out_fd, int in_fd, off_t * offset, size_t count),@@ -1674,6 +1719,15 @@ SC_TRACE_EVENT(sys_sendto, TP_printk() )#endif +#ifndef OVERRIDE_32_sys_recv +SC_TRACE_EVENT(sys_recv, + TP_PROTO(int fd, void * ubuf, size_t size, unsigned flags, struct sockaddr * addr, int * addr_len), + TP_ARGS(fd, ubuf, size, flags, addr, addr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, ubuf) __field(size_t, size) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int *, addr_len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(ubuf, ubuf) tp_assign(size,size)
tp_assign(flags, flags)tp_assign(addr, addr)tp_assign(addr_len, addr_len)),instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.h +15
-0+ TP_printk() +) +#endif #ifndef OVERRIDE_32_sys_recvfrom SC_TRACE_EVENT(sys_recvfrom, TP_PROTO(int fd, void * ubuf, size_t size, unsigned flags, struct sockaddr * addr, int * addr_len),@@ -1877,6 +1931,9 @@ TRACE_SYSCALL_TABLE(sys_swapoff, sys_swapoff, 115, 1)#ifndef OVERRIDE_TABLE_32_sys_sysinfo TRACE_SYSCALL_TABLE(sys_sysinfo, sys_sysinfo, 116, 1)#endif +#ifndef OVERRIDE_TABLE_32_sys_sigreturn +TRACE_SYSCALL_TABLE(sys_sigreturn, sys_sigreturn, 119, 1) +#endif #ifndef OVERRIDE_TABLE_32_sys_setdomainname TRACE_SYSCALL_TABLE(sys_setdomainname, sys_setdomainname, 121, 2)#endif @@ -1940,6 +1997,9 @@ TRACE_SYSCALL_TABLE(sys_poll, sys_poll, 168, 3)#ifndef OVERRIDE_TABLE_32_sys_getresgid16 TRACE_SYSCALL_TABLE(sys_getresgid16, sys_getresgid16, 171, 3)#endif +#ifndef OVERRIDE_TABLE_32_sys_rt_sigreturn +TRACE_SYSCALL_TABLE(sys_rt_sigreturn, sys_rt_sigreturn, 173, 1) +#endif #ifndef OVERRIDE_TABLE_32_sys_rt_sigaction TRACE_SYSCALL_TABLE(sys_rt_sigaction, sys_rt_sigaction, 174, 4)#endif @@ -1958,6 +2018,12 @@ TRACE_SYSCALL_TABLE(sys_rt_sigqueueinfo, sys_rt_sigqueueinfo, 178, 3)#ifndef OVERRIDE_TABLE_32_sys_rt_sigsuspend TRACE_SYSCALL_TABLE(sys_rt_sigsuspend, sys_rt_sigsuspend, 179, 2)#endif +#ifndef OVERRIDE_TABLE_32_sys_pread64 +TRACE_SYSCALL_TABLE(sys_pread64, sys_pread64, 180, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_pwrite64 +TRACE_SYSCALL_TABLE(sys_pwrite64, sys_pwrite64, 181, 4) +#endif #ifndef OVERRIDE_TABLE_32_sys_chown16TRACE_SYSCALL_TABLE (sys_chown16, sys_chown16,182 ,3 )#endif
instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.h +3
-0@@ -2096,6 +2162,9 @@ TRACE_SYSCALL_TABLE(sys_clock_getres, sys_clock_getres, 264, 2)#ifndef OVERRIDE_TABLE_32_sys_clock_nanosleep TRACE_SYSCALL_TABLE(sys_clock_nanosleep, sys_clock_nanosleep, 265, 4)#endif +#ifndef OVERRIDE_TABLE_32_sys_fstatfs64 +TRACE_SYSCALL_TABLE(sys_fstatfs64, sys_fstatfs64, 267, 3) +#endif #ifndef OVERRIDE_TABLE_32_sys_utimesTRACE_SYSCALL_TABLE (sys_utimes, sys_utimes,269 ,2 )#endif
instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.h +3
-1@@ -2144,6 +2213,9 @@ TRACE_SYSCALL_TABLE(sys_send, sys_send, 289, 4)#ifndef OVERRIDE_TABLE_32_sys_sendto TRACE_SYSCALL_TABLE(sys_sendto, sys_sendto, 290, 6)#endif +#ifndef OVERRIDE_TABLE_32_sys_recv +TRACE_SYSCALL_TABLE(sys_recv, sys_recv, 291, 6) +#endif #ifndef OVERRIDE_TABLE_32_sys_recvfrom TRACE_SYSCALL_TABLE(sys_recvfrom, sys_recvfrom, 292, 6)#endif --1.7.9.5
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/1 ARM: Resolve sys_unknown system calls
[Patch lttng-modules v2] ARM: Resolve sys_unknown system calls
The LTTng system call extractor relies on kallsyms. Not every system call is defined in the kernel with SYSCALL_DEFINE, so some system calls are missing in kallsyms and shown as sys_unknown by LTTng. Manually add these system calls in the override files for ARM:
- sys_recv
- sys_sigreturn
- sys_rt_sigreturn
- sys_pread64
- sys_prwite64
- sys_vfork
- sys_ftruncate64
- sys_fstatfs64
- sys_fallocate
--- .../syscalls/3.4.25/arm-32-syscalls-3.4.25 | 9 +++ .../arm-32-syscalls-3.4.25_integers_override.h | 25 +++++++- .../arm-32-syscalls-3.4.25_pointers_override.h | 66 ++++++++++++++++++-- 3 files changed, 93 insertions(+), 7 deletions(-)
instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +9 -0
@@ -80,6 +80,7 @@ syscall sys_wait4 nr 114 nbargs 4 types: (pid_t, int *, int, struct rusage *) ar syscall sys_swapoff nr 115 nbargs 1 types: (const char *) args: (specialfile) syscall sys_sysinfo nr 116 nbargs 1 types: (struct sysinfo *) args: (info) syscall sys_fsync nr 118 nbargs 1 types: (unsigned int) args: (fd) +syscall sys_sigreturn nr 119 nbargs 1 types: (struct pt_regs *) args: (regs) syscall sys_setdomainname nr 121 nbargs 2 types: (char *, int) args: (name, len) syscall sys_newuname nr 122 nbargs 1 types: (struct new_utsname *) args: (name) syscall sys_adjtimex nr 124 nbargs 1 types: (struct timex *) args: (txc_p)
@@ -125,18 +126,23 @@ syscall sys_poll nr 168 nbargs 3 types: (struct pollfd *, unsigned int, int) arg syscall sys_setresgid16 nr 170 nbargs 3 types: (old_gid_t, old_gid_t, old_gid_t) args: (rgid, egid, sgid) syscall sys_getresgid16 nr 171 nbargs 3 types: (old_gid_t *, old_gid_t *, old_gid_t *) args: (rgid, egid, sgid) syscall sys_prctl nr 172 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) +syscall sys_rt_sigreturn nr 173 nbargs 1 types: (struct pt_regs *) args: (regs) syscall sys_rt_sigaction nr 174 nbargs 4 types: (int, const struct sigaction *, struct sigaction *, size_t) args: (sig, act, oact, sigsetsize) syscall sys_rt_sigprocmask nr 175 nbargs 4 types: (int, sigset_t *, sigset_t *, size_t) args: (how, nset, oset, sigsetsize) syscall sys_rt_sigpending nr 176 nbargs 2 types: (sigset_t *, size_t) args: (set, sigsetsize) syscall sys_rt_sigtimedwait nr 177 nbargs 4 types: (const sigset_t *, siginfo_t *, const struct timespec *, size_t) args: (uthese, uinfo, uts, sigsetsize) syscall sys_rt_sigqueueinfo nr 178 nbargs 3 types: (pid_t, int, siginfo_t *) args: (pid, sig, uinfo) syscall sys_rt_sigsuspend nr 179 nbargs 2 types: (sigset_t *, size_t) args: (unewset, sigsetsize) +syscall sys_pread64 nr 180 nbargs 4 types: (unsigned int, const char *, size_t, loff_t) args: (fd, buf, count, pos) +syscall sys_pwrite64 nr 181 nbargs 4 types: (unsigned int, const char *, size_t, loff_t) args: (fd, buf, count, pos) syscall sys_chown16 nr 182 nbargs 3 types: (const char *, old_uid_t, old_gid_t) args: (filename, user, group) syscall sys_getcwd nr 183 nbargs 2 types: (char *, unsigned long) args: (buf, size) syscall sys_capget nr 184 nbargs 2 types: (cap_user_header_t, cap_user_data_t) args: (header, dataptr) syscall sys_capset nr 185 nbargs 2 types: (cap_user_header_t, const cap_user_data_t) args: (header, data) syscall sys_sendfile nr 187 nbargs 4 types: (int, int, off_t *, size_t) args: (out_fd, in_fd, offset, count) +syscall sys_vfork nr 190 nbargs 0 types: () args: () syscall sys_getrlimit nr 191 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) +syscall sys_ftruncate64 nr 194 nbargs 2 types: (unsigned int, loff_t) args: (fd, length) syscall sys_stat64 nr 195 nbargs 2 types: (const char *, struct stat64 *) args: (filename, statbuf) syscall sys_lstat64 nr 196 nbargs 2 types: (const char *, struct stat64 *) args: (filename, statbuf) syscall sys_fstat64 nr 197 nbargs 2 types: (unsigned long, struct stat64 *) args: (fd, statbuf)
@@ -202,6 +208,7 @@ syscall sys_clock_settime nr 262 nbargs 2 types: (const clockid_t, const struct syscall sys_clock_gettime nr 263 nbargs 2 types: (const clockid_t, struct timespec *) args: (which_clock, tp) syscall sys_clock_getres nr 264 nbargs 2 types: (const clockid_t, struct timespec *) args: (which_clock, tp) syscall sys_clock_nanosleep nr 265 nbargs 4 types: (const clockid_t, int, const struct timespec *, struct timespec *) args: (which_clock, flags, rqtp, rmtp) +syscall sys_fstatfs64 nr 267 nbargs 3 types: (unsigned int, size_t, struct statfs64 *) args: (fd, sz, buf) syscall sys_tgkill nr 268 nbargs 3 types: (pid_t, pid_t, int) args: (tgid, pid, sig) syscall sys_utimes nr 269 nbargs 2 types: (char *, struct timeval *) args: (filename, utimes) syscall sys_mq_open nr 274 nbargs 4 types: (const char *, int, umode_t, struct mq_attr *) args: (u_name, oflag, mode, u_attr)
@@ -221,6 +228,7 @@ syscall sys_getpeername nr 287 nbargs 3 types: (int, struct sockaddr *, int *) a syscall sys_socketpair nr 288 nbargs 4 types: (int, int, int, int *) args: (family, type, protocol, usockvec) syscall sys_send nr 289 nbargs 4 types: (int, void *, size_t, unsigned) args: (fd, buff, len, flags) syscall sys_sendto nr 290 nbargs 6 types: (int, void *, size_t, unsigned, struct sockaddr *, int) args: (fd, buff, len, flags, addr, addr_len) +syscall sys_recv nr 291 nbargs 6 types: (int, void *, size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr, addr_len) syscall sys_recvfrom nr 292 nbargs 6 types: (int, void *, size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr, addr_len) syscall sys_shutdown nr 293 nbargs 2 types: (int, int) args: (fd, how) syscall sys_setsockopt nr 294 nbargs 5 types: (int, int, int, char *, int) args: (fd, level, optname, optval, optlen)
@@ -273,6 +281,7 @@ syscall sys_utimensat nr 348 nbargs 4 types: (int, const char *, struct timespec syscall sys_signalfd nr 349 nbargs 3 types: (int, sigset_t *, size_t) args: (ufd, user_mask, sizemask) syscall sys_timerfd_create nr 350 nbargs 2 types: (int, int) args: (clockid, flags) syscall sys_eventfd nr 351 nbargs 1 types: (unsigned int) args: (count) +syscall sys_fallocate nr 352 nbargs 4 types: (int, int, loff_t, loff_t) args: (fd, mode, offset, len) syscall sys_timerfd_settime nr 353 nbargs 4 types: (int, int, const struct itimerspec *, struct itimerspec *) args: (ufd, flags, utmr, otmr) syscall sys_timerfd_gettime nr 354 nbargs 2 types: (int, struct itimerspec *) args: (ufd, otmr) syscall sys_signalfd4 nr 355 nbargs 4 types: (int, sigset_t *, size_t, int) args: (ufd, user_mask, sizemask, flags)
instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.h +24 -1
@@ -37,15 +37,38 @@ SC_TRACE_EVENT(sys_sync_file_range2, TP_printk() ) +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_vfork) + +SC_TRACE_EVENT(sys_ftruncate64, + TP_PROTO(unsigned int fd, loff_t length), + TP_ARGS(fd, length), + TP_STRUCT__entry(__field(unsigned int, fd) __field(loff_t, length)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(length, length)), + TP_printk() +) + +SC_TRACE_EVENT (sys_fallocate, + TP_PROTO(int fd, int mode, loff_t offset, loff_t len), +TP_ARGS (fd, mode, offset, len), + TP_STRUCT__entry(__field(int, fd) __field(int, mode) __field(loff_t, offset) __field(loff_t, len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(mode, mode) tp_assign(offset, offset) tp_assign(len, len)), +TP_printk () +) +#else /* CREATE_SYSCALL_TABLE */ #define OVVERRIDE_TABLE_32_sys_mmap TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) - +#define OVERRIDE_TABLE_32_sys_vfork +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vfork, 190, 0) +#define OVERRIDE_TABLE_32_sys_ftruncate64 +TRACE_SYSCALL_TABLE(sys_ftruncate64, sys_ftruncate64, 194, 2)#define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 TRACE_SYSCALL_TABLE(sys_arm_fadvise64_64, sys_arm_fadvise64_64, 270, 4)#define OVERRIDE_TABLE_32_sys_sync_file_range2 TRACE_SYSCALL_TABLE(sys_sync_file_range2, sys_sync_file_range2, 341, 4) +#define OVERRIDE_TABLE_32_sys_fallocate +TRACE_SYSCALL_TABLE(sys_fallocate, sys_fallocate, 352, 4)#endif /* CREATE_SYSCALL_TABLE */
instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.h +60 -6
82 lines not on this page · raw message
Signature · 1 line
1.7.9.5
A message that is not in the archive (sent off-list or not yet received): 20140414085656.GA32190@hal
----- Original Message -----
Quoted 9 lines
From: "Jan Glauber" <[email protected]>
To: "Mathieu Desnoyers" <[email protected]>
Cc: [email protected]
Sent: Monday, April 14, 2014 4:56:56 AM
Subject: [Patch lttng-modules v2] ARM: Resolvesys_unknownsystem calls[Patch lttng-modules v2] ARM: Resolve
sys_unknownsystem callsThe LTTng system call extractor relies on kallsyms.
How is the fact that the lttng syscall extractor relies on kallsyms relevant here ?
Quoted 3 lines
Not every system
call is defined in the kernel withSYSCALL_DEFINE, so some system calls are missing in kallsyms and shown assys_unknownby LTTng.
This is inaccurate. LTTng syscall extractor only uses kallsyms to get the __start_syscalls_metadata and __stop_syscalls_metadata symbols.
What is true here is that indeed, not every system call is defined using SYSCALL_DEFINE.
Quoted 12 lines
Manually
add these system calls in the override files for ARM:-
sys_recv
-sys_sigreturn
-sys_rt_sigreturn
-sys_pread64
-sys_prwite64
-sys_vfork
-sys_ftruncate64
-sys_fstatfs64
-sys_fallocate
The LTTng system call extractor (linux-link-trace-syscalls-as-data.patch and lttng-syscalls-extractor.c) output the system call details on the console. On ARM, this was used to initially generate arm-32-syscalls-3.4.25. If we look into your patch, we see that you are adding system calls to it. However, I doubt you generated your system call list from a 3.4.25 kernel. The file name should match the kernel from with the system call list has been generated, and should not be updated by hand.
Have you tried running the system call extractor on a more recent kernel to see if some of the unknown system calls have been defined with SYSCALL_DEFINE since 3.4.25 ? If they appeared in a more recent kernel, then there is no need to define them as overrides, just provide a new arm-*-syscalls-3.x.x description file generated by the lttng syscall extractor, and use lttng-syscalls-generate-headers.sh to regenerate syscall instrumentation headers. Overrides are only for the entries that are still missing from the arm-*-syscalls-3.x.x description file.
Thanks,
Mathieu
Quoted 277 lines
Signed-off-by Jan Glauber <[email protected]>--- .../syscalls/3.4.25/arm-32-syscalls-3.4.25 | 9 +++ .../arm-32-syscalls-3.4.25_integers_override.h | 25 +++++++- .../arm-32-syscalls-3.4.25_pointers_override.h | 66 ++++++++++++++++++-- 3 files changed, 93 insertions(+), 7 deletions(-)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -80,6 +80,7 @@ syscall sys_wait4 nr 114 nbargs 4 types: (pid_t, int *,int, struct rusage *) ar
syscallsys_swapoffnr 115 nbargs 1 types: (const char *) args:
(specialfile)
syscallsys_sysinfonr 116 nbargs 1 types: (struct sysinfo *) args: (info) syscallsys_fsyncnr 118 nbargs 1 types: (unsigned int) args: (fd)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +3
-0+syscall sys_sigreturn nr 119 nbargs 1 types: (struct pt_regs *) args: (regs) syscall sys_setdomainname nr 121 nbargs 2 types: (char *, int) args: (name, len) syscall sys_newuname nr 122 nbargs 1 types: (struct new_utsname *) args: (name) syscall sys_adjtimex nr 124 nbargs 1 types: (struct timex *) args: (txc_p)@@ -125,18 +126,23 @@ syscall sys_poll nr 168 nbargs 3 types: (struct pollfd *, unsigned int, int) arg syscall sys_setresgid16 nr 170 nbargs 3 types: (old_gid_t, old_gid_t, old_gid_t) args: (rgid, egid, sgid) syscall sys_getresgid16 nr 171 nbargs 3 types: (old_gid_t *, old_gid_t *, old_gid_t *) args: (rgid, egid, sgid) syscall sys_prctl nr 172 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) +syscall sys_rt_sigreturn nr 173 nbargs 1 types: (struct pt_regs *) args: (regs) syscall sys_rt_sigaction nr 174 nbargs 4 types: (int, const struct sigaction *, struct sigaction *, size_t) args: (sig, act, oact, sigsetsize) syscall sys_rt_sigprocmask nr 175 nbargs 4 types: (int, sigset_t *, sigset_t *, size_t) args: (how, nset, oset, sigsetsize) syscall sys_rt_sigpending nr 176 nbargs 2 types: (sigset_t *, size_t) args: (set, sigsetsize) syscall sys_rt_sigtimedwait nr 177 nbargs 4 types: (const sigset_t *, siginfo_t *, const struct timespec *, size_t) args: (uthese, uinfo, uts, sigsetsize) syscall sys_rt_sigqueueinfo nr 178 nbargs 3 types: (pid_t, int, siginfo_t *) args: (pid, sig, uinfo) syscall sys_rt_sigsuspend nr 179 nbargs 2 types: (sigset_t *, size_t) args: (unewset, sigsetsize) +syscall sys_pread64 nr 180 nbargs 4 types: (unsigned int, const char *,
size_t,loff_t) args: (fd, buf, count, pos)
+syscallsys_pwrite64nr 181 nbargs 4 types: (unsigned int, const char *,size_t,loff_t) args: (fd, buf, count, pos)
syscallsys_chown16nr 182 nbargs 3 types: (const char *,old_uid_t,old_gid_t) args: (filename, user, group)
syscallsys_getcwdnr 183 nbargs 2 types: (char *, unsigned long) args:
(buf, size)
syscallsys_capgetnr 184 nbargs 2 types: (cap_user_header_t,cap_user_data_t) args: (header, dataptr)
syscallsys_capsetnr 185 nbargs 2 types: (cap_user_header_t, constcap_user_data_t) args: (header, data)
syscallsys_sendfilenr 187 nbargs 4 types: (int, int,off_t*,size_t)
args: (out_fd,in_fd, offset, count)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +2
-0+syscall sys_vfork nr 190 nbargs 0 types: () args: () syscall sys_getrlimit nr 191 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) +syscall sys_ftruncate64 nr 194 nbargs 2 types: (unsigned int, loff_t) args:(fd, length)
syscallsys_stat64nr 195 nbargs 2 types: (const char *, struct stat64 *)
args: (filename, statbuf)
syscallsys_lstat64nr 196 nbargs 2 types: (const char *, struct stat64 *)
args: (filename, statbuf)
syscallsys_fstat64nr 197 nbargs 2 types: (unsigned long, struct stat64 *)
args: (fd, statbuf)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -202,6 +208,7 @@ syscall sys_clock_settime nr 262 nbargs 2 types: (const
clockid_t, const struct
syscallsys_clock_gettimenr 263 nbargs 2 types: (constclockid_t, struct timespec *) args: (which_clock, tp)
syscallsys_clock_getresnr 264 nbargs 2 types: (constclockid_t, struct timespec *) args: (which_clock, tp)
syscallsys_clock_nanosleepnr 265 nbargs 4 types: (constclockid_t, int, const struct timespec *, struct timespec *) args: (which_clock, flags, rqtp, rmtp)
+syscallsys_fstatfs64nr 267 nbargs 3 types: (unsigned int,size_t, struct statfs64 *) args: (fd, sz, buf)
syscallsys_tgkillnr 268 nbargs 3 types: (pid_t,pid_t, int) args: (tgid, pid, sig)
syscallsys_utimesnr 269 nbargs 2 types: (char *, struct timeval *) args:
(filename, utimes)
syscallsys_mq_opennr 274 nbargs 4 types: (const char *, int,umode_t, structmq_attr*) args: (u_name, oflag, mode,u_attr)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -221,6 +228,7 @@ syscall sys_getpeername nr 287 nbargs 3 types: (int,struct sockaddr *, int *) a
syscallsys_socketpairnr 288 nbargs 4 types: (int, int, int, int *) args:
(family, type, protocol, usockvec)
syscallsys_sendnr 289 nbargs 4 types: (int, void *,size_t, unsigned)
args: (fd, buff, len, flags)
syscallsys_sendtonr 290 nbargs 6 types: (int, void *,size_t, unsigned, struct sockaddr *, int) args: (fd, buff, len, flags, addr,addr_len)
+syscallsys_recvnr 291 nbargs 6 types: (int, void *,size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr,addr_len)
syscallsys_recvfromnr 292 nbargs 6 types: (int, void *,size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr,addr_len) syscallsys_shutdownnr 293 nbargs 2 types: (int, int) args: (fd, how) syscallsys_setsockoptnr 294 nbargs 5 types: (int, int, int, char *, int)
args: (fd, level, optname, optval, optlen)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -273,6 +281,7 @@ syscall sys_utimensat nr 348 nbargs 4 types: (int, constchar *, struct timespec
syscallsys_signalfdnr 349 nbargs 3 types: (int,sigset_t*,size_t) args:
(ufd,user_mask, sizemask)
syscallsys_timerfd_createnr 350 nbargs 2 types: (int, int) args: (clockid, flags)
syscallsys_eventfdnr 351 nbargs 1 types: (unsigned int) args: (count)
+syscallsys_fallocatenr 352 nbargs 4 types: (int, int,loff_t,loff_t)
args: (fd, mode, offset, len)
syscallsys_timerfd_settimenr 353 nbargs 4 types: (int, int, const struct itimerspec *, struct itimerspec *) args: (ufd, flags, utmr, otmr) syscallsys_timerfd_gettimenr 354 nbargs 2 types: (int, struct itimerspec *) args: (ufd, otmr)
syscallsys_signalfd4nr 355 nbargs 4 types: (int,sigset_t*,size_t, int)
args: (ufd,user_mask, sizemask, flags)
diff --gita/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.hb/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.hindex 895370f..14c78bc 100644
---a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.h
+++b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.hinstrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +24
-1@@ -37,15 +37,38 @@ SC_TRACE_EVENT(sys_sync_file_range2, TP_printk() ) +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_vfork) + +SC_TRACE_EVENT(sys_ftruncate64, + TP_PROTO(unsigned int fd, loff_t length), + TP_ARGS(fd, length), + TP_STRUCT__entry(__field(unsigned int, fd) __field(loff_t, length)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(length, length)), + TP_printk() +) + +SC_TRACE_EVENT(sys_fallocate, + TP_PROTO(int fd, int mode, loff_t offset, loff_t len), + TP_ARGS(fd, mode, offset, len), + TP_STRUCT__entry(__field(int, fd) __field(int, mode) __field(loff_t, offset) __field(loff_t, len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(mode, mode) tp_assign(offset, offset) tp_assign(len, len)), + TP_printk() +) + #else /* CREATE_SYSCALL_TABLE */ #define OVVERRIDE_TABLE_32_sys_mmap TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) - +#define OVERRIDE_TABLE_32_sys_vfork +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vfork, 190, 0) +#define OVERRIDE_TABLE_32_sys_ftruncate64 +TRACE_SYSCALL_TABLE(sys_ftruncate64, sys_ftruncate64, 194, 2) #define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 TRACE_SYSCALL_TABLE(sys_arm_fadvise64_64, sys_arm_fadvise64_64, 270, 4) #define OVERRIDE_TABLE_32_sys_sync_file_range2 TRACE_SYSCALL_TABLE(sys_sync_file_range2, sys_sync_file_range2, 341, 4) +#define OVERRIDE_TABLE_32_sys_fallocate +TRACE_SYSCALL_TABLE(sys_fallocate, sys_fallocate, 352, 4)#endif /*
CREATE_SYSCALL_TABLE*/diff --git
a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.hb/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.hindex 65131bb..7ed7429 100644
---a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.h
+++b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.hinstrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +60
-7@@ -1,7 +1,3 @@ - -#define OVERRIDE_TABLE_32_sys_mmap2 - - #ifndef CREATE_SYSCALL_TABLE SC_TRACE_EVENT(sys_mmap2,@@ -25,15 +21,73 @@ SC_TRACE_EVENT(sys_mmap2, TP_printk() ) +SC_TRACE_EVENT(sys_sigreturn, + TP_PROTO(struct pt_regs * regs), + TP_ARGS(regs), + TP_STRUCT__entry(__field_hex(struct pt_regs *, regs)), + TP_fast_assign(tp_assign(regs, regs)), + TP_printk() +) + +SC_TRACE_EVENT(sys_rt_sigreturn, + TP_PROTO(struct pt_regs * regs), + TP_ARGS(regs), + TP_STRUCT__entry(__field_hex(struct pt_regs *, regs)), + TP_fast_assign(tp_assign(regs, regs)), + TP_printk() +) + +SC_TRACE_EVENT(sys_fstatfs64, + TP_PROTO(unsigned int fd, size_t sz, struct statfs64 * buf), + TP_ARGS(fd, sz, buf), + TP_STRUCT__entry(__field(unsigned int, fd) __field(size_t, sz) __field_hex(struct statfs64 *, buf)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(sz, sz) tp_assign(buf, buf)), + TP_printk() +) + +SC_TRACE_EVENT(sys_pread64, + TP_PROTO(unsigned int fd, const char * buf, size_t count, loff_t pos), + TP_ARGS(fd, buf, count, pos), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count) __field(loff_t, pos)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count) tp_assign(pos, pos)), + TP_printk() +) + +SC_TRACE_EVENT(sys_pwrite64, + TP_PROTO(unsigned int fd, const char * buf, size_t count, loff_t pos), + TP_ARGS(fd, buf, count, pos), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count) __field(loff_t, pos)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count) tp_assign(pos, pos)), + TP_printk() +) + +SC_TRACE_EVENT(sys_recv, + TP_PROTO(int fd, void * ubuf, size_t size, unsigned flags, struct sockaddr * addr, int * addr_len), + TP_ARGS(fd, ubuf, size, flags, addr, addr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, ubuf) __field(size_t, size) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int *, addr_len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(ubuf, ubuf) tp_assign(size, size) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), + TP_printk() +) + #else /* CREATE_SYSCALL_TABLE */ #define OVERRIDE_TABLE_32_sys_execve TRACE_SYSCALL_TABLE(sys_execve, sys_execve, 11, 3) +#define OVERRIDE_TABLE_32_sys_sigreturn +TRACE_SYSCALL_TABLE(sys_sigreturn, sys_sigreturn, 119, 1) #define OVERRIDE_TABLE_32_sys_clone TRACE_SYSCALL_TABLE(sys_clone, sys_clone, 120, 5) +#define OVERRIDE_TABLE_32_sys_rt_sigreturn +TRACE_SYSCALL_TABLE(sys_rt_sigreturn, sys_rt_sigreturn, 173, 1) +#define OVERRIDE_TABLE_32_sys_pread64 +TRACE_SYSCALL_TABLE(sys_pread64, sys_pread64, 180, 4) +#define OVERRIDE_TABLE_32_sys_pwrite64 +TRACE_SYSCALL_TABLE(sys_pwrite64, sys_pwrite64, 181, 4) #define OVERRIDE_TABLE_32_sys_mmap2 TRACE_SYSCALL_TABLE(sys_mmap2, sys_mmap2, 192, 6) +#define OVERRIDE_TABLE_32_sys_fstatfs64 +TRACE_SYSCALL_TABLE(sys_fstatfs64, sys_fstatfs64, 267, 3) +#define OVERRIDE_TABLE_32_sys_recv +TRACE_SYSCALL_TABLE(sys_recv, sys_recv, 291, 6) #endif /* CREATE_SYSCALL_TABLE */ - - --1.7.9.5
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Mathieu Desnoyers
----- Original Message -----
Quoted 6 lines
From: "Jan Glauber" <[email protected]>
To: "Mathieu Desnoyers" <[email protected]>
Cc: [email protected]
Sent: Monday, April 14, 2014 4:56:56 AM
Subject: [Patch lttng-modules v2] ARM: Resolvesys_unknownsystem calls
Quoted 6 lines
Quoted 3 lines
[Patch lttng-modules v2] ARM: Resolve
sys_unknownsystem callsThe LTTng system call extractor relies on kallsyms.
How is the fact that the lttng syscall extractor relies on kallsyms relevant here ?
Because these "unknown" system calls are not described in between __start_syscalls_metadata and __stop_syscalls_metadata? I didn't dig to deep but I thought thats the reason LTTng system call extractor does not find these system calls. If I look for instance for sys_recv in my System.map:
$ grep __p_syscall_meta__recv System.map c069404c t __p_syscall_meta__recvmmsg c0694050 t __p_syscall_meta__recvmsg c0694068 t __p_syscall_meta__recvfrom
its not there. But I've not looked what creates the system call meta data entries, maybe its something different than the SYSCALL_DEFINE.
Quoted 23 lines
Quoted 3 lines
Not every system
call is defined in the kernel withSYSCALL_DEFINE, so some system calls are missing in kallsyms and shown assys_unknownby LTTng.This is inaccurate. LTTng syscall extractor only uses kallsyms to get the
__start_syscalls_metadataand__stop_syscalls_metadatasymbols.What is true here is that indeed, not every system call is defined using
SYSCALL_DEFINE.Quoted 12 lines
Manually
add these system calls in the override files for ARM:-
sys_recv
-sys_sigreturn
-sys_rt_sigreturn
-sys_pread64
-sys_prwite64
-sys_vfork
-sys_ftruncate64
-sys_fstatfs64
-sys_fallocate
Quoted 7 lines
The LTTng system call extractor (linux-link-trace-syscalls-as-data.patch and
lttng-syscalls-extractor.c) output the system call details on the console. On ARM, this was used to initially generate arm-32-syscalls-3.4.25. If we look into your patch, we see that you are adding system calls to it. However, I doubt you generated your system call list from a 3.4.25 kernel. The file name should match the kernel from with the system call list has been generated, and should not be updated by hand.
I'm still using the 3.4.25 kernel but I've added the unknown system calls manually to the arm-32-syscalls-3.4.25 file because I then could use the script to generate the defines. If you don't like these system calls added to the arm-32-syscalls-3.4.25 file I can also remove them, but I don't see the point since this file is incomplete because of the imperfect detection mechanism.
Quoted 8 lines
Have you tried running the system call extractor on a more recent kernel to see if some of the unknown system calls have been defined with
SYSCALL_DEFINEsince 3.4.25 ? If they appeared in a more recent kernel, then there is no need to define them as overrides, just provide a new arm-*-syscalls-3.x.x description file generated by the lttng syscall extractor, and uselttng-syscalls-generate-headers.shto regenerate syscall instrumentation headers. Overrides are only for the entries that are still missing from the arm-*-syscalls-3.x.x description file.
No. I'm currently stuck with that kernel version and I doubt the system call extractor wont find a system call like sys_recv on a newer kernel.
Regards, Jan
Quoted 287 lines
Thanks,
Mathieu
Quoted 277 lines
Signed-off-by Jan Glauber <[email protected]>--- .../syscalls/3.4.25/arm-32-syscalls-3.4.25 | 9 +++ .../arm-32-syscalls-3.4.25_integers_override.h | 25 +++++++- .../arm-32-syscalls-3.4.25_pointers_override.h | 66 ++++++++++++++++++-- 3 files changed, 93 insertions(+), 7 deletions(-)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -80,6 +80,7 @@ syscall sys_wait4 nr 114 nbargs 4 types: (pid_t, int *,int, struct rusage *) ar
syscallsys_swapoffnr 115 nbargs 1 types: (const char *) args:
(specialfile)
syscallsys_sysinfonr 116 nbargs 1 types: (struct sysinfo *) args: (info) syscallsys_fsyncnr 118 nbargs 1 types: (unsigned int) args: (fd)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +3
-0+syscall sys_sigreturn nr 119 nbargs 1 types: (struct pt_regs *) args: (regs) syscall sys_setdomainname nr 121 nbargs 2 types: (char *, int) args: (name, len) syscall sys_newuname nr 122 nbargs 1 types: (struct new_utsname *) args: (name) syscall sys_adjtimex nr 124 nbargs 1 types: (struct timex *) args: (txc_p)@@ -125,18 +126,23 @@ syscall sys_poll nr 168 nbargs 3 types: (struct pollfd *, unsigned int, int) arg syscall sys_setresgid16 nr 170 nbargs 3 types: (old_gid_t, old_gid_t, old_gid_t) args: (rgid, egid, sgid) syscall sys_getresgid16 nr 171 nbargs 3 types: (old_gid_t *, old_gid_t *, old_gid_t *) args: (rgid, egid, sgid) syscall sys_prctl nr 172 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) +syscall sys_rt_sigreturn nr 173 nbargs 1 types: (struct pt_regs *) args: (regs) syscall sys_rt_sigaction nr 174 nbargs 4 types: (int, const struct sigaction *, struct sigaction *, size_t) args: (sig, act, oact, sigsetsize) syscall sys_rt_sigprocmask nr 175 nbargs 4 types: (int, sigset_t *, sigset_t *, size_t) args: (how, nset, oset, sigsetsize) syscall sys_rt_sigpending nr 176 nbargs 2 types: (sigset_t *, size_t) args: (set, sigsetsize) syscall sys_rt_sigtimedwait nr 177 nbargs 4 types: (const sigset_t *, siginfo_t *, const struct timespec *, size_t) args: (uthese, uinfo, uts, sigsetsize) syscall sys_rt_sigqueueinfo nr 178 nbargs 3 types: (pid_t, int, siginfo_t *) args: (pid, sig, uinfo) syscall sys_rt_sigsuspend nr 179 nbargs 2 types: (sigset_t *, size_t) args: (unewset, sigsetsize) +syscall sys_pread64 nr 180 nbargs 4 types: (unsigned int, const char *,
size_t,loff_t) args: (fd, buf, count, pos)
+syscallsys_pwrite64nr 181 nbargs 4 types: (unsigned int, const char *,size_t,loff_t) args: (fd, buf, count, pos)
syscallsys_chown16nr 182 nbargs 3 types: (const char *,old_uid_t,old_gid_t) args: (filename, user, group)
syscallsys_getcwdnr 183 nbargs 2 types: (char *, unsigned long) args:
(buf, size)
syscallsys_capgetnr 184 nbargs 2 types: (cap_user_header_t,cap_user_data_t) args: (header, dataptr)
syscallsys_capsetnr 185 nbargs 2 types: (cap_user_header_t, constcap_user_data_t) args: (header, data)
syscallsys_sendfilenr 187 nbargs 4 types: (int, int,off_t*,size_t)
args: (out_fd,in_fd, offset, count)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +2
-0+syscall sys_vfork nr 190 nbargs 0 types: () args: () syscall sys_getrlimit nr 191 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) +syscall sys_ftruncate64 nr 194 nbargs 2 types: (unsigned int, loff_t) args:(fd, length)
syscallsys_stat64nr 195 nbargs 2 types: (const char *, struct stat64 *)
args: (filename, statbuf)
syscallsys_lstat64nr 196 nbargs 2 types: (const char *, struct stat64 *)
args: (filename, statbuf)
syscallsys_fstat64nr 197 nbargs 2 types: (unsigned long, struct stat64 *)
args: (fd, statbuf)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -202,6 +208,7 @@ syscall sys_clock_settime nr 262 nbargs 2 types: (const
clockid_t, const struct
syscallsys_clock_gettimenr 263 nbargs 2 types: (constclockid_t, struct timespec *) args: (which_clock, tp)
syscallsys_clock_getresnr 264 nbargs 2 types: (constclockid_t, struct timespec *) args: (which_clock, tp)
syscallsys_clock_nanosleepnr 265 nbargs 4 types: (constclockid_t, int, const struct timespec *, struct timespec *) args: (which_clock, flags, rqtp, rmtp)
+syscallsys_fstatfs64nr 267 nbargs 3 types: (unsigned int,size_t, struct statfs64 *) args: (fd, sz, buf)
syscallsys_tgkillnr 268 nbargs 3 types: (pid_t,pid_t, int) args: (tgid, pid, sig)
syscallsys_utimesnr 269 nbargs 2 types: (char *, struct timeval *) args:
(filename, utimes)
syscallsys_mq_opennr 274 nbargs 4 types: (const char *, int,umode_t, structmq_attr*) args: (u_name, oflag, mode,u_attr)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -221,6 +228,7 @@ syscall sys_getpeername nr 287 nbargs 3 types: (int,struct sockaddr *, int *) a
syscallsys_socketpairnr 288 nbargs 4 types: (int, int, int, int *) args:
(family, type, protocol, usockvec)
syscallsys_sendnr 289 nbargs 4 types: (int, void *,size_t, unsigned)
args: (fd, buff, len, flags)
syscallsys_sendtonr 290 nbargs 6 types: (int, void *,size_t, unsigned, struct sockaddr *, int) args: (fd, buff, len, flags, addr,addr_len)
+syscallsys_recvnr 291 nbargs 6 types: (int, void *,size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr,addr_len)
syscallsys_recvfromnr 292 nbargs 6 types: (int, void *,size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr,addr_len) syscallsys_shutdownnr 293 nbargs 2 types: (int, int) args: (fd, how) syscallsys_setsockoptnr 294 nbargs 5 types: (int, int, int, char *, int)
args: (fd, level, optname, optval, optlen)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -273,6 +281,7 @@ syscall sys_utimensat nr 348 nbargs 4 types: (int, constchar *, struct timespec
syscallsys_signalfdnr 349 nbargs 3 types: (int,sigset_t*,size_t) args:
(ufd,user_mask, sizemask)
syscallsys_timerfd_createnr 350 nbargs 2 types: (int, int) args: (clockid, flags)
syscallsys_eventfdnr 351 nbargs 1 types: (unsigned int) args: (count)
+syscallsys_fallocatenr 352 nbargs 4 types: (int, int,loff_t,loff_t)
args: (fd, mode, offset, len)
syscallsys_timerfd_settimenr 353 nbargs 4 types: (int, int, const struct itimerspec *, struct itimerspec *) args: (ufd, flags, utmr, otmr) syscallsys_timerfd_gettimenr 354 nbargs 2 types: (int, struct itimerspec *) args: (ufd, otmr)
syscallsys_signalfd4nr 355 nbargs 4 types: (int,sigset_t*,size_t, int)
args: (ufd,user_mask, sizemask, flags)
diff --gita/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.hb/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.hindex 895370f..14c78bc 100644
---a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.h
+++b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.hinstrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +24
-1@@ -37,15 +37,38 @@ SC_TRACE_EVENT(sys_sync_file_range2, TP_printk() ) +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_vfork) + +SC_TRACE_EVENT(sys_ftruncate64, + TP_PROTO(unsigned int fd, loff_t length), + TP_ARGS(fd, length), + TP_STRUCT__entry(__field(unsigned int, fd) __field(loff_t, length)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(length, length)), + TP_printk() +) + +SC_TRACE_EVENT(sys_fallocate, + TP_PROTO(int fd, int mode, loff_t offset, loff_t len), + TP_ARGS(fd, mode, offset, len), + TP_STRUCT__entry(__field(int, fd) __field(int, mode) __field(loff_t, offset) __field(loff_t, len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(mode, mode) tp_assign(offset, offset) tp_assign(len, len)), + TP_printk() +) + #else /* CREATE_SYSCALL_TABLE */ #define OVVERRIDE_TABLE_32_sys_mmap TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) - +#define OVERRIDE_TABLE_32_sys_vfork +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vfork, 190, 0) +#define OVERRIDE_TABLE_32_sys_ftruncate64 +TRACE_SYSCALL_TABLE(sys_ftruncate64, sys_ftruncate64, 194, 2) #define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 TRACE_SYSCALL_TABLE(sys_arm_fadvise64_64, sys_arm_fadvise64_64, 270, 4) #define OVERRIDE_TABLE_32_sys_sync_file_range2 TRACE_SYSCALL_TABLE(sys_sync_file_range2, sys_sync_file_range2, 341, 4) +#define OVERRIDE_TABLE_32_sys_fallocate +TRACE_SYSCALL_TABLE(sys_fallocate, sys_fallocate, 352, 4)#endif /*
CREATE_SYSCALL_TABLE*/diff --git
a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.hb/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.hindex 65131bb..7ed7429 100644
---a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.h
+++b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.hinstrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +60
-7@@ -1,7 +1,3 @@ - -#define OVERRIDE_TABLE_32_sys_mmap2 - - #ifndef CREATE_SYSCALL_TABLE SC_TRACE_EVENT(sys_mmap2,@@ -25,15 +21,73 @@ SC_TRACE_EVENT(sys_mmap2, TP_printk() ) +SC_TRACE_EVENT(sys_sigreturn, + TP_PROTO(struct pt_regs * regs), + TP_ARGS(regs), + TP_STRUCT__entry(__field_hex(struct pt_regs *, regs)), + TP_fast_assign(tp_assign(regs, regs)), + TP_printk() +) + +SC_TRACE_EVENT(sys_rt_sigreturn, + TP_PROTO(struct pt_regs * regs), + TP_ARGS(regs), + TP_STRUCT__entry(__field_hex(struct pt_regs *, regs)), + TP_fast_assign(tp_assign(regs, regs)), + TP_printk() +) + +SC_TRACE_EVENT(sys_fstatfs64, + TP_PROTO(unsigned int fd, size_t sz, struct statfs64 * buf), + TP_ARGS(fd, sz, buf), + TP_STRUCT__entry(__field(unsigned int, fd) __field(size_t, sz) __field_hex(struct statfs64 *, buf)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(sz, sz) tp_assign(buf, buf)), + TP_printk() +) + +SC_TRACE_EVENT(sys_pread64, + TP_PROTO(unsigned int fd, const char * buf, size_t count, loff_t pos), + TP_ARGS(fd, buf, count, pos), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count) __field(loff_t, pos)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count) tp_assign(pos, pos)), + TP_printk() +) + +SC_TRACE_EVENT(sys_pwrite64, + TP_PROTO(unsigned int fd, const char * buf, size_t count, loff_t pos), + TP_ARGS(fd, buf, count, pos), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count) __field(loff_t, pos)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count) tp_assign(pos, pos)), + TP_printk() +) + +SC_TRACE_EVENT(sys_recv, + TP_PROTO(int fd, void * ubuf, size_t size, unsigned flags, struct sockaddr * addr, int * addr_len), + TP_ARGS(fd, ubuf, size, flags, addr, addr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, ubuf) __field(size_t, size) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int *, addr_len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(ubuf, ubuf) tp_assign(size, size) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), + TP_printk() +) + #else /* CREATE_SYSCALL_TABLE */ #define OVERRIDE_TABLE_32_sys_execve TRACE_SYSCALL_TABLE(sys_execve, sys_execve, 11, 3) +#define OVERRIDE_TABLE_32_sys_sigreturn +TRACE_SYSCALL_TABLE(sys_sigreturn, sys_sigreturn, 119, 1) #define OVERRIDE_TABLE_32_sys_clone TRACE_SYSCALL_TABLE(sys_clone, sys_clone, 120, 5) +#define OVERRIDE_TABLE_32_sys_rt_sigreturn +TRACE_SYSCALL_TABLE(sys_rt_sigreturn, sys_rt_sigreturn, 173, 1) +#define OVERRIDE_TABLE_32_sys_pread64 +TRACE_SYSCALL_TABLE(sys_pread64, sys_pread64, 180, 4) +#define OVERRIDE_TABLE_32_sys_pwrite64 +TRACE_SYSCALL_TABLE(sys_pwrite64, sys_pwrite64, 181, 4) #define OVERRIDE_TABLE_32_sys_mmap2 TRACE_SYSCALL_TABLE(sys_mmap2, sys_mmap2, 192, 6) +#define OVERRIDE_TABLE_32_sys_fstatfs64 +TRACE_SYSCALL_TABLE(sys_fstatfs64, sys_fstatfs64, 267, 3) +#define OVERRIDE_TABLE_32_sys_recv +TRACE_SYSCALL_TABLE(sys_recv, sys_recv, 291, 6) #endif /* CREATE_SYSCALL_TABLE */ - - --1.7.9.5
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com
A message that is not in the archive (sent off-list or not yet received): 20140414133155.GA2531@hal
----- Original Message -----
Quoted 67 lines
From: "Jan Glauber" <[email protected]>
To: "Mathieu Desnoyers" <[email protected]>
Cc: [email protected]
Sent: Monday, April 14, 2014 9:31:58 AM
Subject: Re: [Patch lttng-modules v2] ARM: Resolvesys_unknownsystem callsQuoted 7 lines · Mathieu Desnoyers
----- Original Message -----
Quoted 6 lines
From: "Jan Glauber" <[email protected]>
To: "Mathieu Desnoyers" <[email protected]>
Cc: [email protected]
Sent: Monday, April 14, 2014 4:56:56 AM
Subject: [Patch lttng-modules v2] ARM: Resolvesys_unknownsystem callsQuoted 6 lines
Quoted 3 lines
[Patch lttng-modules v2] ARM: Resolve
sys_unknownsystem callsThe LTTng system call extractor relies on kallsyms.
How is the fact that the lttng syscall extractor relies on kallsyms relevant here ?
Because these "unknown" system calls are not described in between
__start_syscalls_metadataand__stop_syscalls_metadata? I didn't dig to deep but I thought thats the reason LTTng system call extractor does not find these system calls. If I look for instance forsys_recvin my System.map:$ grep __p_syscall_meta__recv System.map c069404c t __p_syscall_meta__recvmmsg c0694050 t __p_syscall_meta__recvmsg c0694068 t __p_syscall_meta__recvfromits not there. But I've not looked what creates the system call meta data entries, maybe its something different than the
SYSCALL_DEFINE.Quoted 23 lines
Quoted 3 lines
Not every system
call is defined in the kernel withSYSCALL_DEFINE, so some system calls are missing in kallsyms and shown assys_unknownby LTTng.This is inaccurate. LTTng syscall extractor only uses kallsyms to get the
__start_syscalls_metadataand__stop_syscalls_metadatasymbols.What is true here is that indeed, not every system call is defined using
SYSCALL_DEFINE.Quoted 12 lines
Manually
add these system calls in the override files for ARM:-
sys_recv
-sys_sigreturn
-sys_rt_sigreturn
-sys_pread64
-sys_prwite64
-sys_vfork
-sys_ftruncate64
-sys_fstatfs64
-sys_fallocateQuoted 8 lines
The LTTng system call extractor (linux-link-trace-syscalls-as-data.patch and
lttng-syscalls-extractor.c) output the system call details on the console. On ARM, this was used to initially generate arm-32-syscalls-3.4.25.
If we look into your patch, we see that you are adding system calls to it. However, I doubt you generated your system call list from a 3.4.25 kernel. The file name should match the kernel from with the system call list has been generated, and should not be updated by hand.
Quoted 6 lines
I'm still using the 3.4.25 kernel but I've added the unknown system calls manually to the arm-32-syscalls-3.4.25 file because I then could use the script to generate the defines. If you don't like these system calls added to the arm-32-syscalls-3.4.25 file I can also remove them, but I don't see the point since this file is incomplete because of the imperfect detection mechanism.
The real fix would be to submit changes to the upstream Linux kernel to implement the last system calls with SYSCALL_DEFINE.
I don't want to start mixing generated files with hand-editing, because it makes review and updates following upstream much more difficult.
Quoted 10 lines
Quoted 9 lines
Have you tried running the system call extractor on a more recent kernel to see if some of the unknown system calls have been defined with
SYSCALL_DEFINEsince 3.4.25 ? If they appeared in a more recent kernel, then there is no need to define them as overrides, just provide a new arm-*-syscalls-3.x.x description file generated by the lttng syscall extractor, and uselttng-syscalls-generate-headers.shto regenerate syscall instrumentation headers. Overrides are only for the entries that are still missing from the arm-*-syscalls-3.x.x description file.
Quoted 2 lines
No. I'm currently stuck with that kernel version and I doubt the system call extractor wont find a system call like
sys_recvon a newer kernel.
Indeed, sys_recv, sys_sigreturn, sys_rt_sigreturn are still not defined with SYSCALL_DEFINE. However, on a current 3.15-rc1 kernel, we find:
fs/read_write.c:SYSCALL_DEFINE4(pread64, .... fs/read_write.c:SYSCALL_DEFINE4(pwrite64, ...
kernel/fork.c:SYSCALL_DEFINE0(vfork)
fs/open.c:SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length) fs/statfs.c:SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user *, buf) fs/open.c:SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
The overrides should be limited to the system calls unavailable in the current kernel version. Please run the system call extractor on a newer kernel, so we can get some of the missing definitions, and then only provide overrides for the missing ones. Each override we add means an extra maintenance burden for each architecture, which we want to keep minimal.
Thanks,
Mathieu
Quoted 330 lines
Regards, Jan
Quoted 326 lines
Thanks,
Mathieu
Quoted 313 lines
Signed-off-by Jan Glauber <[email protected]>--- .../syscalls/3.4.25/arm-32-syscalls-3.4.25 | 9 +++ .../arm-32-syscalls-3.4.25_integers_override.h | 25 +++++++- .../arm-32-syscalls-3.4.25_pointers_override.h | 66 ++++++++++++++++++-- 3 files changed, 93 insertions(+), 7 deletions(-)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -80,6 +80,7 @@ syscall sys_wait4 nr 114 nbargs 4 types: (pid_t, int *,int, struct rusage *) ar
syscallsys_swapoffnr 115 nbargs 1 types: (const char *) args:
(specialfile)
syscallsys_sysinfonr 116 nbargs 1 types: (struct sysinfo *) args:
(info)
syscallsys_fsyncnr 118 nbargs 1 types: (unsigned int) args: (fd)
+syscallsys_sigreturnnr 119 nbargs 1 types: (structpt_regs*) args:
(regs)
syscallsys_setdomainnamenr 121 nbargs 2 types: (char *, int) args:
(name,
len)
syscallsys_newunamenr 122 nbargs 1 types: (structnew_utsname*) args:
(name)
syscallsys_adjtimexnr 124 nbargs 1 types: (struct timex *) args:
(txc_p)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -125,18 +126,23 @@ syscall sys_poll nr 168 nbargs 3 types: (structpollfd
*, unsigned int, int) arg
syscallsys_setresgid16nr 170 nbargs 3 types: (old_gid_t,old_gid_t,old_gid_t) args: (rgid, egid, sgid)
syscallsys_getresgid16nr 171 nbargs 3 types: (old_gid_t*,old_gid_t*,
old_gid_t*) args: (rgid, egid, sgid)
syscallsys_prctlnr 172 nbargs 5 types: (int, unsigned long, unsigned long,
unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5)
+syscallsys_rt_sigreturnnr 173 nbargs 1 types: (structpt_regs*) args:
(regs)
syscallsys_rt_sigactionnr 174 nbargs 4 types: (int, const struct sigaction
*, struct sigaction *,size_t) args: (sig, act, oact, sigsetsize) syscallsys_rt_sigprocmasknr 175 nbargs 4 types: (int,sigset_t*,sigset_t
*,size_t) args: (how, nset, oset, sigsetsize)
syscallsys_rt_sigpendingnr 176 nbargs 2 types: (sigset_t*,size_t) args:
(set, sigsetsize)
syscallsys_rt_sigtimedwaitnr 177 nbargs 4 types: (constsigset_t*,siginfo_t*, const struct timespec *,size_t) args: (uthese, uinfo, uts, sigsetsize)
syscallsys_rt_sigqueueinfonr 178 nbargs 3 types: (pid_t, int,siginfo_t*)
args: (pid, sig, uinfo)
syscallsys_rt_sigsuspendnr 179 nbargs 2 types: (sigset_t*,size_t) args:
(unewset, sigsetsize)
+syscallsys_pread64nr 180 nbargs 4 types: (unsigned int, const char *,size_t,loff_t) args: (fd, buf, count, pos)
+syscallsys_pwrite64nr 181 nbargs 4 types: (unsigned int, const char *,size_t,loff_t) args: (fd, buf, count, pos)
syscallsys_chown16nr 182 nbargs 3 types: (const char *,old_uid_t,old_gid_t) args: (filename, user, group)
syscallsys_getcwdnr 183 nbargs 2 types: (char *, unsigned long) args:
(buf, size)
syscallsys_capgetnr 184 nbargs 2 types: (cap_user_header_t,cap_user_data_t) args: (header, dataptr)
syscallsys_capsetnr 185 nbargs 2 types: (cap_user_header_t, constcap_user_data_t) args: (header, data)
syscallsys_sendfilenr 187 nbargs 4 types: (int, int,off_t*,size_t)
args: (out_fd,in_fd, offset, count)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +2
-0+syscall sys_vfork nr 190 nbargs 0 types: () args: () syscall sys_getrlimit nr 191 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) +syscall sys_ftruncate64 nr 194 nbargs 2 types: (unsigned int, loff_t)args:
(fd, length)
syscallsys_stat64nr 195 nbargs 2 types: (const char *, struct stat64 *)
args: (filename, statbuf)
syscallsys_lstat64nr 196 nbargs 2 types: (const char *, struct stat64 *)
args: (filename, statbuf)
syscallsys_fstat64nr 197 nbargs 2 types: (unsigned long, struct stat64 *)
args: (fd, statbuf)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -202,6 +208,7 @@ syscall sys_clock_settime nr 262 nbargs 2 types:(const
clockid_t, const struct
syscallsys_clock_gettimenr 263 nbargs 2 types: (constclockid_t, struct
timespec *) args: (which_clock, tp)
syscallsys_clock_getresnr 264 nbargs 2 types: (constclockid_t, struct timespec *) args: (which_clock, tp)
syscallsys_clock_nanosleepnr 265 nbargs 4 types: (constclockid_t, int,
const struct timespec *, struct timespec *) args: (which_clock, flags, rqtp, rmtp)
+syscallsys_fstatfs64nr 267 nbargs 3 types: (unsigned int,size_t, struct
statfs64 *) args: (fd, sz, buf)
syscallsys_tgkillnr 268 nbargs 3 types: (pid_t,pid_t, int) args:
(tgid,
pid, sig)
syscallsys_utimesnr 269 nbargs 2 types: (char *, struct timeval *) args:
(filename, utimes)
syscallsys_mq_opennr 274 nbargs 4 types: (const char *, int,umode_t, structmq_attr*) args: (u_name, oflag, mode,u_attr)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -221,6 +228,7 @@ syscall sys_getpeername nr 287 nbargs 3 types: (int,struct sockaddr *, int *) a
syscallsys_socketpairnr 288 nbargs 4 types: (int, int, int, int *) args:
(family, type, protocol, usockvec)
syscallsys_sendnr 289 nbargs 4 types: (int, void *,size_t, unsigned)
args: (fd, buff, len, flags)
syscallsys_sendtonr 290 nbargs 6 types: (int, void *,size_t, unsigned,
struct sockaddr *, int) args: (fd, buff, len, flags, addr,addr_len)
+syscallsys_recvnr 291 nbargs 6 types: (int, void *,size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr,addr_len)
syscallsys_recvfromnr 292 nbargs 6 types: (int, void *,size_t, unsigned,
struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr,addr_len) syscallsys_shutdownnr 293 nbargs 2 types: (int, int) args: (fd, how) syscallsys_setsockoptnr 294 nbargs 5 types: (int, int, int, char *, int)
args: (fd, level, optname, optval, optlen)instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +0
-0@@ -273,6 +281,7 @@ syscall sys_utimensat nr 348 nbargs 4 types: (int,const
char *, struct timespec
syscallsys_signalfdnr 349 nbargs 3 types: (int,sigset_t*,size_t) args:
(ufd,user_mask, sizemask)
syscallsys_timerfd_createnr 350 nbargs 2 types: (int, int) args:
(clockid,
flags)
syscallsys_eventfdnr 351 nbargs 1 types: (unsigned int) args: (count)
+syscallsys_fallocatenr 352 nbargs 4 types: (int, int,loff_t,loff_t)
args: (fd, mode, offset, len)
syscallsys_timerfd_settimenr 353 nbargs 4 types: (int, int, const struct
itimerspec *, struct itimerspec *) args: (ufd, flags, utmr, otmr) syscallsys_timerfd_gettimenr 354 nbargs 2 types: (int, struct itimerspec
*) args: (ufd, otmr)
syscallsys_signalfd4nr 355 nbargs 4 types: (int,sigset_t*,size_t, int)
args: (ufd,user_mask, sizemask, flags)
diff --gita/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.hb/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.hindex 895370f..14c78bc 100644
---a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.h
+++b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.hinstrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +24
-1@@ -37,15 +37,38 @@ SC_TRACE_EVENT(sys_sync_file_range2, TP_printk() ) +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_vfork) + +SC_TRACE_EVENT(sys_ftruncate64, + TP_PROTO(unsigned int fd, loff_t length), + TP_ARGS(fd, length), + TP_STRUCT__entry(__field(unsigned int, fd) __field(loff_t, length)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(length, length)), + TP_printk() +) + +SC_TRACE_EVENT(sys_fallocate, + TP_PROTO(int fd, int mode, loff_t offset, loff_t len), + TP_ARGS(fd, mode, offset, len), + TP_STRUCT__entry(__field(int, fd) __field(int, mode) __field(loff_t, offset) __field(loff_t, len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(mode, mode) tp_assign(offset, offset) tp_assign(len, len)), + TP_printk() +) + #else /* CREATE_SYSCALL_TABLE */ #define OVVERRIDE_TABLE_32_sys_mmap TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) - +#define OVERRIDE_TABLE_32_sys_vfork +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vfork, 190, 0) +#define OVERRIDE_TABLE_32_sys_ftruncate64 +TRACE_SYSCALL_TABLE(sys_ftruncate64, sys_ftruncate64, 194, 2) #define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 TRACE_SYSCALL_TABLE(sys_arm_fadvise64_64, sys_arm_fadvise64_64, 270, 4) #define OVERRIDE_TABLE_32_sys_sync_file_range2 TRACE_SYSCALL_TABLE(sys_sync_file_range2, sys_sync_file_range2, 341, 4) +#define OVERRIDE_TABLE_32_sys_fallocate +TRACE_SYSCALL_TABLE(sys_fallocate, sys_fallocate, 352, 4)#endif /*
CREATE_SYSCALL_TABLE*/diff --git
a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.hb/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.hindex 65131bb..7ed7429 100644
---a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.h
+++b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.hinstrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +42
-4@@ -1,7 +1,3 @@ - -#define OVERRIDE_TABLE_32_sys_mmap2 - - #ifndef CREATE_SYSCALL_TABLE SC_TRACE_EVENT(sys_mmap2,@@ -25,15 +21,73 @@ SC_TRACE_EVENT(sys_mmap2, TP_printk() ) +SC_TRACE_EVENT(sys_sigreturn, + TP_PROTO(struct pt_regs * regs), + TP_ARGS(regs), + TP_STRUCT__entry(__field_hex(struct pt_regs *, regs)), + TP_fast_assign(tp_assign(regs, regs)), + TP_printk() +) + +SC_TRACE_EVENT(sys_rt_sigreturn, + TP_PROTO(struct pt_regs * regs), + TP_ARGS(regs), + TP_STRUCT__entry(__field_hex(struct pt_regs *, regs)), + TP_fast_assign(tp_assign(regs, regs)), + TP_printk() +) + +SC_TRACE_EVENT(sys_fstatfs64, + TP_PROTO(unsigned int fd, size_t sz, struct statfs64 * buf), + TP_ARGS(fd, sz, buf), + TP_STRUCT__entry(__field(unsigned int, fd) __field(size_t, sz) __field_hex(struct statfs64 *, buf)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(sz, sz) tp_assign(buf, buf)), + TP_printk() +) + +SC_TRACE_EVENT(sys_pread64, + TP_PROTO(unsigned int fd, const char * buf, size_t count, loff_t pos), + TP_ARGS(fd, buf, count, pos), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count) __field(loff_t, pos)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count) tp_assign(pos, pos)), + TP_printk() +) + +SC_TRACE_EVENT(sys_pwrite64, + TP_PROTO(unsigned int fd, const char * buf, size_t count, loff_t pos), + TP_ARGS(fd, buf, count, pos), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count) __field(loff_t, pos)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count) tp_assign(pos, pos)), + TP_printk() +) + +SC_TRACE_EVENT(sys_recv, + TP_PROTO(int fd, void * ubuf, size_t size, unsigned flags, structsockaddr
* addr, int *addr_len),instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +2
-0+ TP_ARGS(fd, ubuf, size, flags, addr, addr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, ubuf)__field(size_t,
size)__field(unsigned, flags)__field_hex(struct sockaddr *, addr)__field_hex(int *, addr_len)),instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +1
-0+ TP_fast_assign(tp_assign(fd, fd) tp_assign(ubuf, ubuf) tp_assign(size,size)
tp_assign(flags, flags)tp_assign(addr, addr)tp_assign(addr_len, addr_len)),instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 +15
-3+ TP_printk() +) + #else /* CREATE_SYSCALL_TABLE */ #define OVERRIDE_TABLE_32_sys_execve TRACE_SYSCALL_TABLE(sys_execve, sys_execve, 11, 3) +#define OVERRIDE_TABLE_32_sys_sigreturn +TRACE_SYSCALL_TABLE(sys_sigreturn, sys_sigreturn, 119, 1) #define OVERRIDE_TABLE_32_sys_clone TRACE_SYSCALL_TABLE(sys_clone, sys_clone, 120, 5) +#define OVERRIDE_TABLE_32_sys_rt_sigreturn +TRACE_SYSCALL_TABLE(sys_rt_sigreturn, sys_rt_sigreturn, 173, 1) +#define OVERRIDE_TABLE_32_sys_pread64 +TRACE_SYSCALL_TABLE(sys_pread64, sys_pread64, 180, 4) +#define OVERRIDE_TABLE_32_sys_pwrite64 +TRACE_SYSCALL_TABLE(sys_pwrite64, sys_pwrite64, 181, 4) #define OVERRIDE_TABLE_32_sys_mmap2 TRACE_SYSCALL_TABLE(sys_mmap2, sys_mmap2, 192, 6) +#define OVERRIDE_TABLE_32_sys_fstatfs64 +TRACE_SYSCALL_TABLE(sys_fstatfs64, sys_fstatfs64, 267, 3) +#define OVERRIDE_TABLE_32_sys_recv +TRACE_SYSCALL_TABLE(sys_recv, sys_recv, 291, 6) #endif /* CREATE_SYSCALL_TABLE */ - - --Quoted 3 lines
1.7.9.5
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 13 lines · Mathieu Desnoyers
----- Original Message -----
Quoted 8 lines
From: "Jan Glauber" <[email protected]>
To: "Mathieu Desnoyers" <[email protected]>
Cc: [email protected]
Sent: Monday, April 14, 2014 9:31:58 AM
Subject: Re: [Patch lttng-modules v2] ARM: Resolvesys_unknownsystem callsNo. I'm currently stuck with that kernel version and I doubt the system call extractor wont find a system call like
sys_recvon a newer kernel.Indeed,
sys_recv,sys_sigreturn,sys_rt_sigreturnare still not defined withSYSCALL_DEFINE. However, on a current 3.15-rc1 kernel, we find:
Quoted 6 lines
fs/read_write.c:SYSCALL_DEFINE4(pread64, .... fs/read_write.c:SYSCALL_DEFINE4(pwrite64, ...
kernel/fork.c:SYSCALL_DEFINE0(vfork)
fs/open.c:SYSCALL_DEFINE2(ftruncate64, unsigned int, fd,loff_t, length) fs/statfs.c:SYSCALL_DEFINE3(fstatfs64, unsigned int, fd,size_t, sz, struct statfs64__user*, buf) fs/open.c:SYSCALL_DEFINE4(fallocate, int, fd, int, mode,loff_t, offset,loff_t, len)
Found the reason why pread64 and the above system calls were not available. The culprit is SYSCALL_DEFINE which in contrast to SYSCALL_DEFINEx define (notice the x at the end) never had the meta data included.
This was fixed accidently by Al Viro during 3.10 by killing SYSCALL_DEFINE in favor for the SYSCALL_DEFINEx variant (which adds the meta data).
x86_64 knows these system calls, because the list was extracted after the upstream change.
That leaves sys_recv and the sigreturns, I'll follow that up on lkml.
Quoted 6 lines
The overrides should be limited to the system calls unavailable in the current kernel version. Please run the system call extractor on a newer kernel, so we can get some of the missing definitions, and then only provide overrides for the missing ones. Each override we add means an extra maintenance burden for each architecture, which we want to keep minimal.
I don't want to go through this cumbersome extractor script madness again and I cannot run a newer kernel anyway. If you don't want to take the patch I'll leave it for now.
Regards, Jan
Quoted 4 lines
Thanks,
Mathieu