diff options
author | Jim Keniston <jkenisto@us.ibm.com> | 2008-09-15 02:29:29 -0700 |
---|---|---|
committer | Jim Keniston <jkenisto@us.ibm.com> | 2008-09-15 02:29:29 -0700 |
commit | 553987ef137f6d80b6133a97864942f865e60ece (patch) | |
tree | 5b471373c3640a8f30141a604667910e3d69aaee /tapset | |
parent | c79cd4b878c3d4e66fd9203107b078734cfbe0a1 (diff) | |
parent | 8844346125b135280bee9fee12cbdbceb750d898 (diff) | |
download | systemtap-steved-553987ef137f6d80b6133a97864942f865e60ece.tar.gz systemtap-steved-553987ef137f6d80b6133a97864942f865e60ece.tar.xz systemtap-steved-553987ef137f6d80b6133a97864942f865e60ece.zip |
Merge branch 'master' of ssh://kenistoj@sources.redhat.com/git/systemtap
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/ChangeLog | 15 | ||||
-rw-r--r-- | tapset/aux_syscalls.stp | 190 | ||||
-rw-r--r-- | tapset/syscalls.stp | 20 | ||||
-rw-r--r-- | tapset/syscalls2.stp | 12 | ||||
-rw-r--r-- | tapset/vfs.stp | 4 | ||||
-rw-r--r-- | tapset/x86_64/syscalls.stp | 1 |
6 files changed, 70 insertions, 172 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 97801a20..46e15fd6 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,18 @@ +2008-09-17 Mark Wielaard <mjw@redhat.com> + + * aux_syscalls.stp: Removed commented out code. Removed unneeded + unpure embedded C-code. + +2008-09-15 Mark Wielaard <mjw@redhat.com> + + * x86_64/syscalls.stp (syscall.vm86_warning): Add argstr. + +2008-09-15 Mark Wielaard <mjw@redhat.com> + + * vfs.stp: Fix 2.6.27 detection. + * syscall.stp: Likewise. + * syscall2.stp: Likewise. + 2008-09-12 Wenji Huang <wenji.huang@oracle.com> * signal.stp: Initialize __sig in a function. diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index f79acaf0..6ef9ed1e 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -134,13 +134,10 @@ function _struct_compat_utimbuf_modtime:long(uaddr:long) #endif %} -%{ -#define STP_UTIME_NOW ((1l << 30) - 1l) -#define STP_UTIME_OMIT ((1l << 30) - 2l) -%} - function _struct_timespec_u:string(uaddr:long, n:long) %{ /* pure */ +#define STP_UTIME_NOW ((1l << 30) - 1l) +#define STP_UTIME_OMIT ((1l << 30) - 2l) int n = (int)THIS->n; struct timespec ts[n]; char *ptr = (char *)(unsigned long)THIS->uaddr; @@ -168,10 +165,14 @@ function _struct_timespec_u:string(uaddr:long, n:long) } } } +#undef STP_UTIME_NOW +#undef STP_UTIME_OMIT %} function _struct_compat_timespec_u:string(uaddr:long, n:long) %{ /* pure */ #ifdef CONFIG_COMPAT +#define STP_UTIME_NOW ((1l << 30) - 1l) +#define STP_UTIME_OMIT ((1l << 30) - 2l) int n = (int)THIS->n; struct compat_timespec ts[n]; char *ptr = (char *)(unsigned long)THIS->uaddr; @@ -199,6 +200,8 @@ function _struct_compat_timespec_u:string(uaddr:long, n:long) } } } +#undef STP_UTIME_NOW +#undef STP_UTIME_OMIT #endif %} @@ -256,16 +259,31 @@ function _struct_compat_itimerval_u:string(uaddr:long) #endif %} - %{ -#include <linux/version.h> +// Needed for function _struct_sockaddr_u. Unfortunately cannot be +// inlined into the function since these header files define static +// functions themselves. #include <linux/socket.h> #include <linux/in.h> +#include <linux/netlink.h> +%} + +function _struct_sockaddr_u:string(uaddr:long, len:long) +%{ /* pure */ +#include <linux/version.h> #include <linux/in6.h> #include <linux/un.h> -#include <linux/netlink.h> #include <linux/if_packet.h> + char *ptr = (char *)(unsigned long)THIS->uaddr; + if (ptr == NULL) + strlcpy (THIS->__retvalue, "NULL", MAXSTRINGLEN); + else { + char buf[128]; + size_t len = THIS->len < 128 ? THIS->len : 128; + if(_stp_copy_from_user(buf, ptr, len)) + strlcpy (THIS->__retvalue, "[...]", MAXSTRINGLEN); + else { #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) #define LPORT (inet->inet.num) #define DADDR (&inet->inet.daddr) @@ -274,10 +292,9 @@ function _struct_compat_itimerval_u:string(uaddr:long) #define DADDR (&inet->daddr) #endif -//FIXME. Not done yet. - -void _stp_sockaddr_str(char *str, const int strlen, char *buf, int len) -{ + //FIXME. Not done yet. + char *str = THIS->__retvalue; + const int strlen = MAXSTRINGLEN; struct sockaddr *sa = (struct sockaddr *)buf; if ((sa->sa_family == AF_INET)&&(len == sizeof(struct sockaddr_in))) { @@ -321,29 +338,15 @@ void _stp_sockaddr_str(char *str, const int strlen, char *buf, int len) { if (len >= sizeof(sa_family_t)) { - snprintf(str, strlen, "{unknown sockaddr with sa=%d, salen=%d}", sa->sa_family, len); + snprintf(str, strlen, "{unknown sockaddr with sa=%d, salen=%d}", sa->sa_family, (int) len); } else { - snprintf(str, strlen, "{unknown sockaddr with salen=%d}", len); + snprintf(str, strlen, "{unknown sockaddr with salen=%d}", (int)len); } } -} -%} - -function _struct_sockaddr_u:string(uaddr:long, len:long) -%{ /* pure */ - char *ptr = (char *)(unsigned long)THIS->uaddr; - if (ptr == NULL) - strlcpy (THIS->__retvalue, "NULL", MAXSTRINGLEN); - else { - char buf[128]; - size_t len = THIS->len < 128 ? THIS->len : 128; - if(_stp_copy_from_user(buf, ptr, len)) - strlcpy (THIS->__retvalue, "[...]", MAXSTRINGLEN); - else - _stp_sockaddr_str(THIS->__retvalue, MAXSTRINGLEN, buf, len); } +} %} function _struct_rlimit_u:string(uaddr:long) @@ -519,124 +522,6 @@ function __get_compat_argv:string(a:long, first:long) %} /* - * Return a integer member value of struct - * timezone user space pointer parameter - * CALLERS: - * syscall.gettimeofday - * syscall.settimeofday - */ -/* -function __uget_tz_m:long(u_addr:long,member:long) -%{ - struct timezone tz; - char *ptr = (char *)(unsigned long)THIS->u_addr; - size_t sz = sizeof(struct timezone); - - if(copy_from_user(&tz,ptr,sz)) - THIS->__retvalue = -EFAULT; - else if(THIS->member == 0) - THIS->__retvalue = tz.tz_minuteswest; - else - THIS->__retvalue = tz.tz_dsttime; -%} -*/ -/* - * Return integer member value of struct - * timex user space pointer parameter - * CALLERS: - * syscall.adjtimex - */ -/* -function __uget_timex_m:long(u_addr:long,member:long) -%{ - struct timex tx; - char *ptr = (char *)(unsigned long)THIS->u_addr; - size_t sz = sizeof(struct timex); - - if(copy_from_user(&tx,ptr,sz)) { - THIS->__retvalue = -EFAULT; - } else - switch(THIS->member) { - case 0: THIS->__retvalue = tx.modes; - break; - case 1: THIS->__retvalue = tx.offset; - break; - case 2: THIS->__retvalue = tx.freq; - break; - case 3: THIS->__retvalue = tx.maxerror; - break; - case 4: THIS->__retvalue = tx.esterror; - break; - case 5: THIS->__retvalue = tx.status; - break; - case 6: THIS->__retvalue = tx.constant; - break; - case 7: THIS->__retvalue = tx.precision; - break; - case 8: THIS->__retvalue = tx.tolerance; - break; - case 9: THIS->__retvalue = tx.time.tv_sec; - break; - case 10: THIS->__retvalue = tx.time.tv_usec; - break; - case 11: THIS->__retvalue = tx.tick; - break; - default: THIS->__retvalue = -1; - } -%} -*/ -/* - * Return the clock_t member value of the - * struct tms user space pointer parameter - * CALLERS: - * syscall.times - */ -/* -%{ #include <linux/times.h> %} -function __uget_tms_m:long(u_addr:long,member:long) -%{ - struct tms tms; - char *ptr = (char *)(unsigned long)THIS->u_addr; - size_t sz = sizeof(struct tms); - - if(copy_from_user(&tms,ptr,sz)) - THIS->__retvalue = -EFAULT; - switch(THIS->member) { - case 0: THIS->__retvalue = tms.tms_utime; - break; - case 1: THIS->__retvalue = tms.tms_stime; - break; - case 2: THIS->__retvalue = tms.tms_cutime; - break; - case 3: THIS->__retvalue = tms.tms_cstime; - break; - default: THIS->__retvalue = -1; - } -%} -*/ -/* - * Return a time_t / long member value of the - * struct timespec user space pointer parameter - * CALLERS: - * syscall.nanosleep - */ -/* -function __uget_ts_m:long(u_addr:long,member:long) -%{ - struct timespec ts; - char *ptr = (char *)(unsigned long)THIS->u_addr; - size_t sz = sizeof(struct timespec); - - if(copy_from_user(&ts,ptr,sz)) - THIS->__retvalue = -EFAULT; - else if(THIS->member == 0) - THIS->__retvalue = ts.tv_sec; - else - THIS->__retvalue = ts.tv_nsec; -%} -*/ - -/* * Return the symbolic string representation * of the struct timex.mode member of adjtimex * consult `man adjtimex` for more information @@ -915,13 +800,10 @@ function _recvflags_str(f) { return substr(bs,0,strlen(bs)-1) } -%{ -#include <linux/mman.h> -%} - /* `man mlockall` for more information */ function _mlockall_flags_str:string(flags:long) %{ /* pure */ + #include <linux/mman.h> int len; long f = THIS->flags; char *str = THIS->__retvalue; @@ -973,11 +855,9 @@ function _shutdown_how_str(how) { return sprintf("UNKNOWN VALUE: %d", how) } -%{ -#include <linux/reboot.h> -%} function _reboot_magic_str:string(magic:long) %{ /* pure */ + #include <linux/reboot.h> int magic = (int)THIS->magic; switch (magic) { case LINUX_REBOOT_MAGIC1: @@ -1756,6 +1636,7 @@ function _shmat_flags_str:string(f:long) %{ +#include <linux/mman.h> const _stp_val_array const _stp_mprotect_list[] = { {0, "PROT_NONE"}, V(PROT_READ), @@ -1772,6 +1653,7 @@ function _mprotect_prot_str:string(prot:long) %} %{ +#include <linux/mman.h> const _stp_val_array const _stp_mmap_list[] = { V(MAP_SHARED), V(MAP_PRIVATE), diff --git a/tapset/syscalls.stp b/tapset/syscalls.stp index 7fd942af..89b3c730 100644 --- a/tapset/syscalls.stp +++ b/tapset/syscalls.stp @@ -1715,7 +1715,7 @@ probe syscall.getuid.return = # void __user *value, size_t size) probe syscall.getxattr = kernel.function("sys_getxattr") { name = "getxattr" -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path = user_string($pathname) %: path = user_string($path) @@ -1725,7 +1725,7 @@ probe syscall.getxattr = kernel.function("sys_getxattr") { value_uaddr = $value size = $size argstr = sprintf("%s, %s, %p, %d", -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? user_string_quoted($pathname), %: user_string_quoted($path), @@ -1763,7 +1763,7 @@ probe syscall.inotify_add_watch = kernel.function("sys_inotify_add_watch") ? { name = "inotify_add_watch" fd = $fd mask = $mask -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path_uaddr = $pathname path = user_string($pathname) argstr = sprintf("%d, %s, %d", $fd, user_string_quoted($pathname), $mask) @@ -2096,7 +2096,7 @@ probe syscall.lchown16.return = kernel.function("sys_lchown16").return ? { # probe syscall.lgetxattr = kernel.function("sys_lgetxattr") { name = "lgetxattr" -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path = user_string($pathname) %: path = user_string($path) @@ -2106,7 +2106,7 @@ probe syscall.lgetxattr = kernel.function("sys_lgetxattr") { value_uaddr = $value size = $size argstr = sprintf("%s, %s, %p, %d", -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? user_string_quoted($pathname), %: user_string_quoted($path), @@ -2181,7 +2181,7 @@ probe syscall.listxattr = kernel.function("sys_listxattr") { name = "listxattr" list_uaddr = $list size = $size -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path_uaddr = $pathname path = user_string($pathname) argstr = sprintf("%s, %p, %d", user_string_quoted($pathname), $list, $size) @@ -2203,7 +2203,7 @@ probe syscall.llistxattr = kernel.function("sys_llistxattr") { name = "llistxattr" list_uaddr = $list size = $size -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path_uaddr = $pathname path = user_string($pathname) argstr = sprintf("%s, %p, %d", user_string_quoted($pathname), $list, $size) @@ -2262,7 +2262,7 @@ probe syscall.lremovexattr = kernel.function("sys_lremovexattr") { name = "lremovexattr" name_uaddr = $name name2 = user_string($name) -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path_uaddr = $pathname path = user_string($pathname) argstr = sprintf("%s, %s", user_string_quoted($pathname), user_string_quoted($name)) @@ -2302,7 +2302,7 @@ probe syscall.lseek.return = kernel.function("sys_lseek").return { # probe syscall.lsetxattr = kernel.function("sys_lsetxattr") { name = "lsetxattr" -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path_uaddr = $pathname path = user_string($pathname) %: @@ -2315,7 +2315,7 @@ probe syscall.lsetxattr = kernel.function("sys_lsetxattr") { size = $size flags = $flags argstr = sprintf("%s, %s, %p, %d, %d", -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? user_string_quoted($pathname), %: user_string_quoted($path), diff --git a/tapset/syscalls2.stp b/tapset/syscalls2.stp index 57d190e3..28691a66 100644 --- a/tapset/syscalls2.stp +++ b/tapset/syscalls2.stp @@ -625,7 +625,7 @@ probe syscall.readlinkat = kernel.function("sys_readlinkat") ? { dfd = $dfd buf_uaddr = $buf bufsiz = $bufsiz -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path = user_string($pathname) argstr = sprintf("%s, %s, %p, %d", _dfd_str($dfd), user_string_quoted($pathname), $buf, $bufsiz) %: @@ -812,7 +812,7 @@ probe syscall.remap_file_pages.return = probe syscall.removexattr = kernel.function("sys_removexattr") { name = "removexattr" name_str = user_string($name) -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path = user_string($pathname) argstr = sprintf("%s, %s", user_string_quoted($pathname), user_string_quoted($name)) @@ -1990,7 +1990,7 @@ probe syscall.setuid.return = # probe syscall.setxattr = kernel.function("sys_setxattr") { name = "setxattr" -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path_uaddr = $pathname path = user_string($pathname) %: @@ -2003,7 +2003,7 @@ probe syscall.setxattr = kernel.function("sys_setxattr") { size = $size flags = $flags argstr = sprintf("%s, %s, %p, %d, %d", -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? user_string_quoted($pathname), %: user_string_quoted($path), @@ -2398,7 +2398,7 @@ probe syscall.statfs = { name = "statfs" buf_uaddr = $buf -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path = user_string($pathname) argstr = sprintf("%s, %p", user_string_quoted($pathname), $buf) %: @@ -2427,7 +2427,7 @@ probe syscall.statfs64 = name = "statfs" sz = $sz buf_uaddr = $buf -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? path = user_string($pathname) argstr = sprintf("%s, %d, %p", user_string_quoted($pathname), $sz, $buf) %: diff --git a/tapset/vfs.stp b/tapset/vfs.stp index 1ea8fc8e..7f2312db 100644 --- a/tapset/vfs.stp +++ b/tapset/vfs.stp @@ -744,7 +744,7 @@ probe vfs.do_mpage_readpage.return = kernel.function ("do_mpage_readpage").retur units = "pages" } -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? probe vfs.add_to_page_cache = kernel.function ("add_to_page_cache_locked") %: probe vfs.add_to_page_cache = kernel.function ("add_to_page_cache") @@ -761,7 +761,7 @@ probe vfs.add_to_page_cache = kernel.function ("add_to_page_cache") argstr = sprintf("%d, %d", ino, index) } -%( kernel_v > "2.6.26" %? +%( kernel_v >= "2.6.27" %? probe vfs.add_to_page_cache.return = kernel.function ("add_to_page_cache_locked").return %: probe vfs.add_to_page_cache.return = kernel.function ("add_to_page_cache").return diff --git a/tapset/x86_64/syscalls.stp b/tapset/x86_64/syscalls.stp index c9ab617f..ad16878f 100644 --- a/tapset/x86_64/syscalls.stp +++ b/tapset/x86_64/syscalls.stp @@ -120,6 +120,7 @@ probe syscall.mmap2.return = kernel.function("sys32_mmap2").return { # probe syscall.vm86_warning = kernel.function("sys32_vm86_warning") { name = "vm86_warning" + argstr = "" } probe syscall.vm86_warning.return = kernel.function("sys32_vm86_warning").return { name = "wm86_warning" |