diff options
-rw-r--r-- | tapset/ChangeLog | 9 | ||||
-rw-r--r-- | tapset/aux_syscalls.stp | 55 | ||||
-rw-r--r-- | tapset/s390x/syscalls.stp | 54 | ||||
-rw-r--r-- | tapset/syscalls.stp | 12 | ||||
-rw-r--r-- | tapset/syscalls2.stp | 4 | ||||
-rw-r--r-- | tapset/x86_64/syscalls.stp | 50 |
6 files changed, 128 insertions, 56 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 1730d04b..0102599d 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,12 @@ +2007-08-15 Martin Hunt <hunt@redhat.com> + + * x86_64/syscalls.stp: Add support for sys32_mmap[2], + sys32_vm86_warning, and sys32_pipe. + * s390x/syscalls.stp (get_mmap_args): Move to aux_syscalls. + * aux_syscalls.stp (get_mmap_args): Moved here. + * syscalls.stp: Add sys32_alarm. + * syscalls2.stp: Add sys32_uname. + 2007-08-15 Frank Ch. Eigler <fche@elastic.org> * context.stp (cpuid, cpu): Use smp_processor_id(). diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index a59050e0..4450ff70 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -1638,3 +1638,58 @@ function _shmat_flags_str(f) { if(f & 0100000) bs="SHM_EXEC|".bs return substr(bs,0,strlen(bs)-1) } + +function get_mmap_args:string (args:long) +%{ + struct mmap_arg_struct { + unsigned long addr; + unsigned long len; + unsigned long prot; + unsigned long flags; + unsigned long fd; + unsigned long offset; + }a; + + char proto[60]; + char flags[256]; + + if(_stp_copy_from_user((char *)&a, + (char *)THIS->args, sizeof(a))== 0){ + + /* _mprotect_prot_str */ + proto[0] = '\0'; + if(a.prot){ + if(a.prot & 1) strcat (proto, "PROT_READ|"); + if(a.prot & 2) strcat (proto, "PROT_WRITE|"); + if(a.prot & 4) strcat (proto, "PROT_EXEC|"); + } else { + strcat (proto, "PROT_NONE"); + } + if (proto[0] != '\0') proto[strlen(proto)-1] = '\0'; + + /* _mmap_flags */ + flags[0]='\0'; + if (a.flags & 1) strcat (flags, "MAP_SHARED|"); + if (a.flags & 2) strcat (flags, "MAP_PRIVATE|"); + if (a.flags & 0x10) strcat (flags, "MAP_FIXED|"); + if (a.flags & 0x20) strcat (flags, "MAP_ANONYMOUS|"); + if (a.flags & 0x100) strcat (flags, "MAP_GROWSDOWN|"); + if (a.flags & 0x800) strcat (flags, "MAP_DENYWRITE|"); + if (a.flags & 0x1000) strcat (flags, "MAP_EXECUTABLE|"); + if (a.flags & 0x2000) strcat (flags, "MAP_LOCKED|"); + if (a.flags & 0x4000) strcat (flags, "MAP_NORESERVE|"); + if (a.flags & 0x8000) strcat (flags, "MAP_POPULATE|"); + if (a.flags & 0x10000) strcat (flags, "MAP_NONBLOCK|"); + if (flags[0] != '\0') flags[strlen(flags)-1] = '\0'; + + sprintf(THIS->__retvalue,"0x%lx, %ld, %s, %s, %ld, %ld", + a.addr, + a.len, + proto, + flags, + a.fd, + a.offset); + }else{ + strlcpy (THIS->__retvalue, "UNKNOWN", MAXSTRINGLEN); + } +%} diff --git a/tapset/s390x/syscalls.stp b/tapset/s390x/syscalls.stp index a544e463..39236d79 100644 --- a/tapset/s390x/syscalls.stp +++ b/tapset/s390x/syscalls.stp @@ -100,60 +100,6 @@ probe syscall.sysctl32.return = kernel.function("sys32_sysctl").return ? { retstr = returnstr(1) } -function get_mmap_args:string (args:long) -%{ - struct mmap_arg_struct { - unsigned long addr; - unsigned long len; - unsigned long prot; - unsigned long flags; - unsigned long fd; - unsigned long offset; - }a; - - char proto[60]; - char flags[256]; - - if(_stp_copy_from_user((char *)&a, - (char *)THIS->args, sizeof(a))== 0){ - - /* _mprotect_prot_str */ - proto[0] = '\0'; - if(a.prot){ - if(a.prot & 1) strcat (proto, "PROT_READ|"); - if(a.prot & 2) strcat (proto, "PROT_WRITE|"); - if(a.prot & 4) strcat (proto, "PROT_EXEC|"); - } else { - strcat (proto, "PROT_NONE"); - } - if (proto[0] != '\0') proto[strlen(proto)-1] = '\0'; - - /* _mmap_flags */ - flags[0]='\0'; - if (a.flags & 1) strcat (flags, "MAP_SHARED|"); - if (a.flags & 2) strcat (flags, "MAP_PRIVATE|"); - if (a.flags & 0x10) strcat (flags, "MAP_FIXED|"); - if (a.flags & 0x20) strcat (flags, "MAP_ANONYMOUS|"); - if (a.flags & 0x100) strcat (flags, "MAP_GROWSDOWN|"); - if (a.flags & 0x800) strcat (flags, "MAP_DENYWRITE|"); - if (a.flags & 0x1000) strcat (flags, "MAP_EXECUTABLE|"); - if (a.flags & 0x2000) strcat (flags, "MAP_LOCKED|"); - if (a.flags & 0x4000) strcat (flags, "MAP_NORESERVE|"); - if (a.flags & 0x8000) strcat (flags, "MAP_POPULATE|"); - if (a.flags & 0x10000) strcat (flags, "MAP_NONBLOCK|"); - if (flags[0] != '\0') flags[strlen(flags)-1] = '\0'; - - sprintf(THIS->__retvalue,"0x%lx, %ld, %s, %s, %ld, %ld", - a.addr, - a.len, - proto, - flags, - a.fd, - a.offset); - }else{ - strlcpy (THIS->__retvalue, "UNKNOWN", MAXSTRINGLEN); - } -%} /* compat */ function get_32mmap_args:string (args:long) diff --git a/tapset/syscalls.stp b/tapset/syscalls.stp index d92cde83..502019b4 100644 --- a/tapset/syscalls.stp +++ b/tapset/syscalls.stp @@ -127,12 +127,20 @@ probe syscall.compat_adjtimex.return = kernel.function("compat_sys_adjtimex").re # alarm ______________________________________________________ # unsigned long sys_alarm (unsigned int seconds) -probe syscall.alarm = kernel.function("sys_alarm") ? { +# long sys32_alarm(unsigned int seconds) +# +probe syscall.alarm = + kernel.function("sys_alarm") ?, + kernel.function("sys32_alarm") ? +{ name = "alarm" seconds = $seconds argstr = sprint($seconds) } -probe syscall.alarm.return = kernel.function("sys_alarm").return ? { +probe syscall.alarm.return = + kernel.function("sys_alarm").return ?, + kernel.function("sys32_alarm").return ? +{ name = "alarm" retstr = returnstr(1) } diff --git a/tapset/syscalls2.stp b/tapset/syscalls2.stp index 6c14dc96..796607fc 100644 --- a/tapset/syscalls2.stp +++ b/tapset/syscalls2.stp @@ -2680,10 +2680,13 @@ probe syscall.umount.return = kernel.function("sys_umount").return { # long sys_newuname(struct new_utsname __user * name) # int sys_olduname(struct oldold_utsname __user * name) # int sys32_olduname(struct oldold_utsname __user * name) +# long sys32_uname(struct old_utsname __user * name) +# probe syscall.uname = kernel.function("sys_uname") ?, kernel.function("sys_olduname") ?, kernel.function("sys32_olduname") ?, + kernel.function("sys32_uname") ?, kernel.function("sys_newuname") ? { name = "uname" @@ -2694,6 +2697,7 @@ probe syscall.uname.return = kernel.function("sys_uname").return ?, kernel.function("sys_olduname").return ?, kernel.function("sys32_olduname").return ?, + kernel.function("sys32_uname").return ?, kernel.function("sys_newuname").return ? { name = "uname" diff --git a/tapset/x86_64/syscalls.stp b/tapset/x86_64/syscalls.stp index 32a43cc1..1b39e04e 100644 --- a/tapset/x86_64/syscalls.stp +++ b/tapset/x86_64/syscalls.stp @@ -82,4 +82,54 @@ probe syscall.mmap.return = kernel.function("sys_mmap").return ? { name = "mmap" retstr = returnstr(2) } +# +# sys32_mmap(struct mmap_arg_struct __user *arg) +# +probe syscall.mmap32 = kernel.function("sys32_mmap") { + name = "mmap" + argstr = get_mmap_args($arg) +} + +probe syscall.mmap32.return = kernel.function("sys32_mmap").return { + name = "mmap" + retstr = returnstr(2) +} +# sys32_mmap2(unsigned long addr, unsigned long len, +# unsigned long prot, unsigned long flags, +# unsigned long fd, unsigned long pgoff) +# +probe syscall.mmap2 = kernel.function("sys32_mmap2") { + name = "mmap2" + argstr = sprintf("%p, %d, %s, %s, %d, %d", $addr, $len, + _mprotect_prot_str($prot), _mmap_flags($flags), $fd, $pgoff) +} + +probe syscall.mmap2.return = kernel.function("sys32_mmap2").return { + name = "mmap2" + retstr = returnstr(2) +} + +# vm86_warning _____________________________________________________ +# +# long sys32_vm86_warning(void) +# +probe syscall.vm86_warning = kernel.function("sys32_vm86_warning") { + name = "vm86_warning" +} +probe syscall.vm86_warning.return = kernel.function("sys32_vm86_warning").return { + name = "wm86_warning" + retstr = returnstr(1) +} +# pipe _______________________________________________________ +# +# long sys32_pipe(int __user *fd) +# +probe syscall.pipe32 = kernel.function("sys32_pipe") { + name = "pipe" + argstr = sprintf("%p", fd) +} +probe syscall.pipe32.return = kernel.function("sys32_pipe").return { + name = "pipe" + retstr = returnstr(1) +} |