diff options
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/ChangeLog | 87 | ||||
-rw-r--r-- | tapset/argv.stp | 48 | ||||
-rw-r--r-- | tapset/aux_syscalls.stp | 27 | ||||
-rw-r--r-- | tapset/context.stp | 16 | ||||
-rw-r--r-- | tapset/ctime.stp | 2 | ||||
-rw-r--r-- | tapset/dev.stp | 33 | ||||
-rw-r--r-- | tapset/i686/registers.stp | 36 | ||||
-rw-r--r-- | tapset/inet.stp | 12 | ||||
-rw-r--r-- | tapset/memory.stp | 3 | ||||
-rw-r--r-- | tapset/nd_syscalls.stp | 2 | ||||
-rw-r--r-- | tapset/nfs.stp | 162 | ||||
-rw-r--r-- | tapset/nfs_proc.stp | 3 | ||||
-rw-r--r-- | tapset/ppc64/registers.stp | 108 | ||||
-rw-r--r-- | tapset/rpc.stp | 167 | ||||
-rw-r--r-- | tapset/s390x/syscalls.stp | 2 | ||||
-rw-r--r-- | tapset/signal.stp | 22 | ||||
-rw-r--r-- | tapset/syscalls.stp | 114 | ||||
-rw-r--r-- | tapset/syscalls2.stp | 14 | ||||
-rw-r--r-- | tapset/task.stp | 3 | ||||
-rw-r--r-- | tapset/x86_64/registers.stp | 20 |
20 files changed, 610 insertions, 271 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 4b37471c..7365d4c9 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,90 @@ +2008-06-23 Zhaolei <zhaolei@cn.fujitsu.com> + + * syscalls.stp: Add sys_mknodat. + +2008-06-20 wcohen <wcohen@redhat.com> + + * dev.stp: New. + +2008-06-19 Zhaolei <zhaolei@cn.fujitsu.com> + + * aux_syscalls.stp: Output unknown bits in _stp_lookup_or_str. + +2008-06-17 Zhaolei <zhaolei@cn.fujitsu.com> + + * syscalls.stp: Add sys_linkat. + +2008-06-17 Zhaolei <zhaolei@cn.fujitsu.com> + + * aux_syscalls.stp (__fork_flags): Add termination signal. + +2008-06-13 Josh Stone <joshua.i.stone@intel.com> + + * aux_syscalls.stp, ctime.stp, inet.stp, memory.stp, + s390x/syscalls.stp, {i686,x86_64,ppc64}/registers.stp: Add + 'pure' to embedded-C functions that deserve it. + +2008-06-13 Zhaolei <zhaolei@cn.fujitsu.com> + + * syscalls.stp: Add sys_fchownat. + +2008-06-12 Will Cohen <wcohen@redhat.com> + + * tasks.stp: Add user_mode. + +2008-06-11 Zhaolei <zhaolei@cn.fujitsu.com> + + * syscalls.stp: Add sys_fchmodat. + +2008-06-10 Zhaolei <zhaolei@cn.fujitsu.com> + + * syscalls.stp: Add sys_faccessat. + +2008-06-10 Zhaolei <zhaolei@cn.fujitsu.com> + + * syscalls.stp(syscall.mkdirat): Use _dfd_str() to add support + for AT_FDCWD. + +2008-06-10 Frank Ch. Eigler <fche@elastic.org> + + PR 6470. + * argv.stp: New tapset. + +2008-06-09 David Smith <dsmith@redhat.com> + + * x86_64/registers.stp (syscall_nr): Added syscall_nr function. + * i686/registers.stp (syscall_nr): Ditto. + +2008-06-04 Zhaolei <zhaolei@cn.fujitsu.com> + + * syscalls2.stp: Add sys_unshare. + +2008-06-03 Zhaolei <zhaolei@cn.fujitsu.com> + + * aux_syscalls.stp (__fork_flags): Support for new clone flags + before linux-2.6.25. + +2008-05-26 Mark Wielaard <mwielaard@redhat.com> + + * task.stp : Only include fdtable.h for kernel versions > 2.6.25. + +2008-05-26 Wenji Huang <wenji.huang@oracle.com> + + * task.stp : Include fdtable.h for 2.6.26. + +2008-05-26 Wenji Huang <wenji.huang@oracle.com> + + * signal.stp (send.*): Correct for 2.6.26. + +2008-05-23 Frank Ch. Eigler <fche@elastic.org> + + * nfs.stp (*): Similarly convert kernel?,module? -> kernel!,module. + +2008-05-23 Frank Ch. Eigler <fche@elastic.org> + + * rpc.stp (*): Convert kernel?,module? -> kernel!,module probe points. + (rpc_create_task): Make conditional on kernel <= 2.6.18. + 2008-05-21 Frank Ch. Eigler <fche@elastic.org> PR 6538 diff --git a/tapset/argv.stp b/tapset/argv.stp new file mode 100644 index 00000000..c941bfc5 --- /dev/null +++ b/tapset/argv.stp @@ -0,0 +1,48 @@ +// argument vector tapset +// Copyright (C) 2008 Red Hat Inc. +// +// This file is part of systemtap, and is free software. You can +// redistribute it and/or modify it under the terms of the GNU General +// Public License (GPL); either version 2, or (at your option) any +// later version. + + +global argc = $# +global argv %( $# >= 1 %? [$#] %: [1] %) + +probe begin(-1) { + %( $# == 0 %? argv[0] = "nothing"; delete argv[0] %) # ensure argv is set sometime + %( $# >= 1 %? argv[1]=@1 %) + %( $# >= 2 %? argv[2]=@2 %) + %( $# >= 3 %? argv[3]=@3 %) + %( $# >= 4 %? argv[4]=@4 %) + %( $# >= 5 %? argv[5]=@5 %) + %( $# >= 6 %? argv[6]=@6 %) + %( $# >= 7 %? argv[7]=@7 %) + %( $# >= 8 %? argv[8]=@8 %) + %( $# >= 9 %? argv[9]=@9 %) + %( $# >= 10 %? argv[10]=@10 %) + %( $# >= 11 %? argv[11]=@11 %) + %( $# >= 12 %? argv[12]=@12 %) + %( $# >= 13 %? argv[13]=@13 %) + %( $# >= 14 %? argv[14]=@14 %) + %( $# >= 15 %? argv[15]=@15 %) + %( $# >= 16 %? argv[16]=@16 %) + %( $# >= 17 %? argv[17]=@17 %) + %( $# >= 18 %? argv[18]=@18 %) + %( $# >= 19 %? argv[19]=@19 %) + %( $# >= 20 %? argv[20]=@20 %) + %( $# >= 21 %? argv[21]=@21 %) + %( $# >= 22 %? argv[22]=@22 %) + %( $# >= 23 %? argv[23]=@23 %) + %( $# >= 24 %? argv[24]=@24 %) + %( $# >= 25 %? argv[25]=@25 %) + %( $# >= 26 %? argv[26]=@26 %) + %( $# >= 27 %? argv[27]=@27 %) + %( $# >= 28 %? argv[28]=@28 %) + %( $# >= 29 %? argv[29]=@29 %) + %( $# >= 30 %? argv[30]=@30 %) + %( $# >= 31 %? argv[31]=@31 %) + %( $# >= 32 %? argv[32]=@32 %) + %( $# >= 33 %? warn(sprintf("argv is limited to 32 arguments")) %) +} diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index ec7fdcb0..f79acaf0 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -1548,7 +1548,7 @@ void _stp_lookup_str(const _stp_val_array * const array, long val, char *ptr, in } void _stp_lookup_or_str(const _stp_val_array * const array, long val, char *ptr, int len) { - int i = 0, flag = 0; + int i = 0, flag = 0, slen; if (val == 0) { _stp_lookup_str(array, val, ptr, len); @@ -1560,12 +1560,15 @@ void _stp_lookup_or_str(const _stp_val_array * const array, long val, char *ptr, if (flag) strlcat(ptr, "|", len); strlcat(ptr, array[i].name, len); + val &= (~array[i].val); flag = 1; } i++; } - if (flag == 0) { - int slen = strlen(ptr); + if (val) { + if (flag) + strlcat(ptr, "|", len); + slen = strlen(ptr); _stp_snprintf(ptr + slen, len - slen, "0x%lx", val); } } @@ -1686,18 +1689,32 @@ const _stp_val_array const _stp_fork_list[] = { V(CLONE_CHILD_SETTID), V(CLONE_STOPPED), #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) + V(CLONE_NEWUTS), V(CLONE_NEWIPC), #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) V(CLONE_NEWUSER), #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) + V(CLONE_NEWPID), + V(CLONE_NEWNET), +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) + V(CLONE_IO), +#endif {0, NULL} }; %} function __fork_flags:string(flags:long) %{ /* pure */ - _stp_lookup_or_str(_stp_fork_list, THIS->flags, THIS->__retvalue, MAXSTRINGLEN); + _stp_lookup_or_str(_stp_fork_list, THIS->flags & ~0xff, THIS->__retvalue, MAXSTRINGLEN); + if ( THIS->flags & 0xff ) { + /* flags contains the termination signal */ + if (*THIS->__retvalue) + strlcat(THIS->__retvalue, "|", MAXSTRINGLEN); + _stp_lookup_str(_stp_signal_list, THIS->flags & 0xff, THIS->__retvalue, MAXSTRINGLEN); + } %} %{ @@ -1779,7 +1796,7 @@ function _mmap_flags:string(flags:long) # old mmap functions passed in a struct like this. # function get_mmap_args:string (args:long) -%{ +%{ /* pure */ #if defined (__x86_64__) || defined (__ia64__) struct mmap_arg_struct { unsigned int addr; diff --git a/tapset/context.stp b/tapset/context.stp index dc560316..10c52226 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -136,6 +136,22 @@ function probemod:string () %{ /* pure */ } %} +function registers_valid:long () %{ /* pure */ + THIS->__retvalue = (CONTEXT->regs != NULL); +%} + +function user_mode:long () %{ /* pure */ /* currently a user-mode address? */ + if (CONTEXT->regs) { +#if defined(__i386__) || defined(__x86_64__) + THIS->__retvalue = (uint64_t) user_mode_vm (CONTEXT->regs); +#else + THIS->__retvalue = (uint64_t) user_mode (CONTEXT->regs); +#endif + } else { + THIS->__retvalue = 0; + } +%} + function is_return:long () %{ /* pure */ if (CONTEXT->pi) THIS->__retvalue = 1; diff --git a/tapset/ctime.stp b/tapset/ctime.stp index 96af4d47..d907c2db 100644 --- a/tapset/ctime.stp +++ b/tapset/ctime.stp @@ -41,7 +41,7 @@ */ function ctime:string(epochsecs:long) -%{ +%{ /* pure */ #define SECSPERMIN 60L #define MINSPERHOUR 60L diff --git a/tapset/dev.stp b/tapset/dev.stp new file mode 100644 index 00000000..80449324 --- /dev/null +++ b/tapset/dev.stp @@ -0,0 +1,33 @@ +// Device numbering tapset +// Copyright (C) 2008 Red Hat Corp. +// +// This file is part of systemtap, and is free software. You can +// redistribute it and/or modify it under the terms of the GNU General +// Public License (GPL); either version 2, or (at your option) any +// later version. + +%{ +#include <linux/kdev_t.h> +%} + +function MAJOR:long(dev:long) +%{ /* pure */ + THIS->__retvalue = MAJOR(THIS->dev); +%} + + +function MINOR:long(dev:long) +%{ /* pure */ + THIS->__retvalue = MINOR(THIS->dev); +%} + + +function MKDEV:long(major:long, minor:long) +%{ /* pure */ + THIS->__retvalue = MKDEV(THIS->major,THIS->minor); +%} + +function usrdev2kerndev:long(dev:long) +%{ /* pure */ + THIS->__retvalue = new_decode_dev(THIS->dev); +%} diff --git a/tapset/i686/registers.stp b/tapset/i686/registers.stp index db532f7a..c4c84814 100644 --- a/tapset/i686/registers.stp +++ b/tapset/i686/registers.stp @@ -1,4 +1,4 @@ -global _reg_offsets, _stp_regs_registered +global _reg_offsets, _stp_regs_registered, _sp_offset, _ss_offset function _stp_register_regs() { /* Same order as pt_regs */ @@ -16,19 +16,21 @@ function _stp_register_regs() { _reg_offsets["eip"] = 44 _reg_offsets["ip"] = 44 _reg_offsets["xcs"] = 48 _reg_offsets["cs"] = 48 _reg_offsets["eflags"] = 52 _reg_offsets["flags"] = 52 - _reg_offsets["esp"] = 56 _reg_offsets["sp"] = 56 sp_offset = 56 - _reg_offsets["xss"] = 60 _reg_offsets["ss"] = 60 ss_offset = 60 + _reg_offsets["esp"] = 56 _reg_offsets["sp"] = 56 + _reg_offsets["xss"] = 60 _reg_offsets["ss"] = 60 + _sp_offset = 56 + _ss_offset = 60 _stp_regs_registered = 1 } -function _stp_get_register_by_offset:long (offset:long) %{ +function _stp_get_register_by_offset:long (offset:long) %{ /* pure */ long value; memcpy(&value, ((char *)CONTEXT->regs) + THIS->offset, sizeof(value)); THIS->__retvalue = value; %} -function _stp_probing_kernel:long () %{ +function _stp_probing_kernel:long () %{ /* pure */ THIS->__retvalue = !user_mode(CONTEXT->regs); %} @@ -36,12 +38,12 @@ function _stp_probing_kernel:long () %{ * esp and ss aren't saved on a breakpoint in kernel mode, so * the pre-trap stack pointer is ®s->sp. */ -function _stp_kernel_sp:long (sp_offset:long) %{ +function _stp_kernel_sp:long (sp_offset:long) %{ /* pure */ THIS->__retvalue = ((long) CONTEXT->regs) + THIS->sp_offset; %} /* Assume ss register hasn't changed since we took the trap. */ -function _stp_kernel_ss:long () %{ +function _stp_kernel_ss:long () %{ /* pure */ unsigned short ss; asm volatile("movw %%ss, %0" : : "m" (ss)); THIS->__retvalue = ss; @@ -49,6 +51,10 @@ function _stp_kernel_ss:long () %{ /* Return the named register value as a signed value. */ function register:long (name:string) { + if (!registers_valid()) { + error("cannot access CPU registers in this context") + return 0 + } if (!_stp_regs_registered) _stp_register_regs() offset = _reg_offsets[name] @@ -57,9 +63,9 @@ function register:long (name:string) { return 0 } if (_stp_probing_kernel()) { - if (offset == sp_offset) - return _stp_kernel_sp(sp_offset) - else if (offset == ss_offset) + if (offset == _sp_offset) + return _stp_kernel_sp(_sp_offset) + else if (offset == _ss_offset) return _stp_kernel_ss() } return _stp_get_register_by_offset(offset) @@ -74,7 +80,7 @@ function u_register:long (name:string) { } /* Return the value of function arg #argnum (1=first arg) as a signed value. */ -function _stp_arg:long (argnum:long) %{ +function _stp_arg:long (argnum:long) %{ /* pure */ long val; int n, nr_regargs, result; @@ -192,11 +198,15 @@ function fastcall() %{ CONTEXT->regparm = _STP_REGPARM | 3; %} -function regparm(n) %{ +function regparm(n:long) %{ if (THIS->n < 0 || THIS->n > 3) { snprintf(CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer), "For i386, regparm value must be in the range 0-3."); CONTEXT->last_error = CONTEXT->error_buffer; } else - CONTEXT->regparm = _STP_REGPARM | (int) n; + CONTEXT->regparm = _STP_REGPARM | (int) THIS->n; %} + +function syscall_nr:long() { + return register("orig_ax") +} diff --git a/tapset/inet.stp b/tapset/inet.stp index 0fdd4bab..8681fa2c 100644 --- a/tapset/inet.stp +++ b/tapset/inet.stp @@ -1,8 +1,8 @@ /* Some functions from libc <arpa/inet.h> */ -function htonll:long (x:long) %{ THIS->__retvalue = (int64_t) cpu_to_be64 ((u64) THIS->x); %} -function htonl:long (x:long) %{ THIS->__retvalue = (int64_t) cpu_to_be32 ((u32) THIS->x); %} -function htons:long (x:long) %{ THIS->__retvalue = (int64_t) cpu_to_be16 ((u16) THIS->x); %} -function ntohll:long (x:long) %{ THIS->__retvalue = (int64_t) be64_to_cpu ((u64) THIS->x); %} -function ntohl:long (x:long) %{ THIS->__retvalue = (int64_t) be32_to_cpu ((u32) THIS->x); %} -function ntohs:long (x:long) %{ THIS->__retvalue = (int64_t) be16_to_cpu ((u16) THIS->x); %} +function htonll:long (x:long) %{ /* pure */ THIS->__retvalue = (int64_t) cpu_to_be64 ((u64) THIS->x); %} +function htonl:long (x:long) %{ /* pure */ THIS->__retvalue = (int64_t) cpu_to_be32 ((u32) THIS->x); %} +function htons:long (x:long) %{ /* pure */ THIS->__retvalue = (int64_t) cpu_to_be16 ((u16) THIS->x); %} +function ntohll:long (x:long) %{ /* pure */ THIS->__retvalue = (int64_t) be64_to_cpu ((u64) THIS->x); %} +function ntohl:long (x:long) %{ /* pure */ THIS->__retvalue = (int64_t) be32_to_cpu ((u32) THIS->x); %} +function ntohs:long (x:long) %{ /* pure */ THIS->__retvalue = (int64_t) be16_to_cpu ((u16) THIS->x); %} diff --git a/tapset/memory.stp b/tapset/memory.stp index 630e8984..a2d9cc19 100644 --- a/tapset/memory.stp +++ b/tapset/memory.stp @@ -46,8 +46,7 @@ probe vm.pagefault.return = kernel.function("__handle_mm_fault@mm/memory.c").ret } /* Return which node the given address belongs to in a NUMA system */ -function addr_to_node:long(addr:long) /* pure */ -%{ +function addr_to_node:long(addr:long) %{ /* pure */ int nid; int pfn = __pa(THIS->addr) >> PAGE_SHIFT; for_each_online_node(nid) diff --git a/tapset/nd_syscalls.stp b/tapset/nd_syscalls.stp index 5697cd21..5a258e75 100644 --- a/tapset/nd_syscalls.stp +++ b/tapset/nd_syscalls.stp @@ -46,7 +46,7 @@ probe nd_syscall.accept = kernel.function("sys_accept") ? { asmlinkage() sockfd = int_arg(1) addr_uaddr = pointer_arg(2) - addrlen_uaddr = int_arg(3) + addrlen_uaddr = pointer_arg(3) argstr = sprintf("%d, %p, %p", sockfd, addr_uaddr, addrlen_uaddr) } probe nd_syscall.accept.return = kernel.function("sys_accept").return ? { diff --git a/tapset/nfs.stp b/tapset/nfs.stp index ba6bde5f..474b091f 100644 --- a/tapset/nfs.stp +++ b/tapset/nfs.stp @@ -305,9 +305,9 @@ probe nfs.fop.entries = nfs.fop.llseek, nfs.fop.open, nfs.fop.flush, nfs.fop.release, + %( kernel_v <= "2.6.18" %? nfs.fop.sendfile, %) nfs.fop.fsync, - nfs.fop.lock, - nfs.fop.sendfile + nfs.fop.lock { } @@ -320,9 +320,9 @@ probe nfs.fop.return = nfs.fop.llseek.return, nfs.fop.open.return, nfs.fop.flush.return, nfs.fop.release.return, + %( kernel_v <= "2.6.18" %? nfs.fop.sendfile.return, %) nfs.fop.fsync.return, - nfs.fop.lock.return, - nfs.fop.sendfile.return + nfs.fop.lock.return { } @@ -344,8 +344,8 @@ probe nfs.fop.return = nfs.fop.llseek.return, * The offset is set to the size of the file plus offset bytes. * */ -probe nfs.fop.llseek = kernel.function ("nfs_file_llseek") ?, - module("nfs").function("nfs_file_llseek") ? +probe nfs.fop.llseek = kernel.function ("nfs_file_llseek") !, + module("nfs").function("nfs_file_llseek") { dev = __file_dev($filp) ino = __file_ino($filp) @@ -360,8 +360,8 @@ probe nfs.fop.llseek = kernel.function ("nfs_file_llseek") ?, argstr = sprintf("%d, %d", offset, origin) } -probe nfs.fop.llseek.return = kernel.function ("nfs_file_llseek").return ?, - module("nfs").function("nfs_file_llseek").return ? +probe nfs.fop.llseek.return = kernel.function ("nfs_file_llseek").return !, + module("nfs").function("nfs_file_llseek").return { name = "nfs.fop.llseek.return" retstr = sprintf("%d", $return) @@ -429,8 +429,8 @@ probe nfs.fop.write.return = vfs.do_sync_write.return * * jiffies - read_cache_jiffies > attrtimeo */ -probe nfs.fop.aio_read = kernel.function ("nfs_file_read") ?, - module("nfs").function("nfs_file_read") ? +probe nfs.fop.aio_read = kernel.function ("nfs_file_read") !, + module("nfs").function("nfs_file_read") { dev = __file_dev($iocb->ki_filp) ino = __file_ino($iocb->ki_filp) @@ -464,8 +464,8 @@ probe nfs.fop.aio_read = kernel.function ("nfs_file_read") ?, } -probe nfs.fop.aio_read.return = kernel.function ("nfs_file_read").return ?, - module("nfs").function("nfs_file_read").return ? +probe nfs.fop.aio_read.return = kernel.function ("nfs_file_read").return !, + module("nfs").function("nfs_file_read").return { name = "nfs.fop.aio_read.return" retstr = sprintf("%d", $return) @@ -490,8 +490,8 @@ probe nfs.fop.aio_read.return = kernel.function ("nfs_file_read").return ?, * file_name : file name * */ -probe nfs.fop.aio_write = kernel.function("nfs_file_write") ?, - module("nfs").function("nfs_file_write") ? +probe nfs.fop.aio_write = kernel.function("nfs_file_write") !, + module("nfs").function("nfs_file_write") { dev = __file_dev($iocb->ki_filp) ino = __file_ino($iocb->ki_filp) @@ -517,8 +517,8 @@ probe nfs.fop.aio_write = kernel.function("nfs_file_write") ?, units = "bytes" } -probe nfs.fop.aio_write.return = kernel.function("nfs_file_write").return ?, - module("nfs").function("nfs_file_write").return ? +probe nfs.fop.aio_write.return = kernel.function("nfs_file_write").return !, + module("nfs").function("nfs_file_write").return { name = "nfs.fop.aio_write.return" retstr = sprintf("%d", $return) @@ -551,8 +551,8 @@ probe nfs.fop.aio_write.return = kernel.function("nfs_file_write").return ?, * * jiffies - read_cache_jiffies > attrtimeo */ -probe nfs.fop.mmap = kernel.function("nfs_file_mmap") ?, - module("nfs").function("nfs_file_mmap") ? +probe nfs.fop.mmap = kernel.function("nfs_file_mmap") !, + module("nfs").function("nfs_file_mmap") { dev = __file_dev($file) ino = __file_ino($file) @@ -574,8 +574,8 @@ probe nfs.fop.mmap = kernel.function("nfs_file_mmap") ?, argstr = sprintf("0x%x, 0x%x, 0x%x", vm_start, vm_end, vm_flags) } -probe nfs.fop.mmap.return = kernel.function("nfs_file_mmap").return ?, - module("nfs").function("nfs_file_mmap").return ? +probe nfs.fop.mmap.return = kernel.function("nfs_file_mmap").return !, + module("nfs").function("nfs_file_mmap").return { name = "nfs.fop.mmap.return" retstr = sprintf("%d", $return) @@ -593,8 +593,8 @@ probe nfs.fop.mmap.return = kernel.function("nfs_file_mmap").return ?, * flag : file flag * i_size : file length in bytes */ -probe nfs.fop.open = kernel.function("nfs_file_open") ?, - module("nfs").function("nfs_file_open") ? +probe nfs.fop.open = kernel.function("nfs_file_open") !, + module("nfs").function("nfs_file_open") { dev = __file_dev($filp) ino = $inode->i_ino @@ -610,8 +610,8 @@ probe nfs.fop.open = kernel.function("nfs_file_open") ?, argstr = sprintf("%d,%d, %s", flag, ino, filename) } -probe nfs.fop.open.return = kernel.function("nfs_file_open").return ?, - module("nfs").function("nfs_file_open").return ? +probe nfs.fop.open.return = kernel.function("nfs_file_open").return !, + module("nfs").function("nfs_file_open").return { name = "nfs.fop.open.return" retstr = sprintf("%d", $return) @@ -628,8 +628,8 @@ probe nfs.fop.open.return = kernel.function("nfs_file_open").return ?, * mode : file mode * ndirty : number of dirty page */ -probe nfs.fop.flush = kernel.function("nfs_file_flush") ?, - module("nfs").function("nfs_file_flush") ? +probe nfs.fop.flush = kernel.function("nfs_file_flush") !, + module("nfs").function("nfs_file_flush") { dev = __file_dev($file) ino = __file_ino($file) @@ -643,8 +643,8 @@ probe nfs.fop.flush = kernel.function("nfs_file_flush") ?, argstr = sprintf("%d",ino) } -probe nfs.fop.flush.return = kernel.function("nfs_file_flush").return ?, - module("nfs").function("nfs_file_flush").return ? +probe nfs.fop.flush.return = kernel.function("nfs_file_flush").return !, + module("nfs").function("nfs_file_flush").return { name = "nfs.fop.flush.return" retstr = sprintf("%d",$return) @@ -660,8 +660,8 @@ probe nfs.fop.flush.return = kernel.function("nfs_file_flush").return ?, * ino : inode number * mode : file mode */ -probe nfs.fop.release = kernel.function("nfs_file_release") ?, - module("nfs").function("nfs_file_release") ? +probe nfs.fop.release = kernel.function("nfs_file_release") !, + module("nfs").function("nfs_file_release") { dev = __file_dev($filp) ino = $inode->i_ino @@ -674,8 +674,8 @@ probe nfs.fop.release = kernel.function("nfs_file_release") ?, argstr = sprintf("%d" , ino) } -probe nfs.fop.release.return = kernel.function("nfs_file_release").return ?, - module("nfs").function("nfs_file_release").return ? +probe nfs.fop.release.return = kernel.function("nfs_file_release").return !, + module("nfs").function("nfs_file_release").return { name = "nfs.fop.release.return" retstr = sprintf("%d", $return) @@ -691,8 +691,8 @@ probe nfs.fop.release.return = kernel.function("nfs_file_release").return ?, * ino : inode number * ndirty : number of dirty pages */ -probe nfs.fop.fsync = kernel.function("nfs_fsync") ?, - module("nfs").function("nfs_fsync") ? +probe nfs.fop.fsync = kernel.function("nfs_fsync") !, + module("nfs").function("nfs_fsync") { dev = __file_dev($file) ino = __file_ino($file) @@ -705,8 +705,8 @@ probe nfs.fop.fsync = kernel.function("nfs_fsync") ?, argstr = sprintf("%d",ino) } -probe nfs.fop.fsync.return = kernel.function("nfs_fsync").return ?, - module("nfs").function("nfs_fsync").return ? +probe nfs.fop.fsync.return = kernel.function("nfs_fsync").return !, + module("nfs").function("nfs_fsync").return { name = "nfs.fop.fsync.return" retstr = sprintf("%d", $return) @@ -727,8 +727,8 @@ probe nfs.fop.fsync.return = kernel.function("nfs_fsync").return ?, * fl_start : starting offset of locked region * fl_end : ending offset of locked region */ -probe nfs.fop.lock = kernel.function("nfs_lock") ?, - module("nfs").function("nfs_lock") ? +probe nfs.fop.lock = kernel.function("nfs_lock") !, + module("nfs").function("nfs_lock") { dev = __file_dev($filp) ino = __file_ino($filp) @@ -747,8 +747,8 @@ probe nfs.fop.lock = kernel.function("nfs_lock") ?, argstr = sprintf("%d,%d",cmd,i_mode) } -probe nfs.fop.lock.return = kernel.function("nfs_lock").return ?, - module("nfs").function("nfs_lock").return ? +probe nfs.fop.lock.return = kernel.function("nfs_lock").return !, + module("nfs").function("nfs_lock").return { name = "nfs.fop.lock.return" retstr = sprintf("%d",$return) @@ -773,8 +773,9 @@ probe nfs.fop.lock.return = kernel.function("nfs_lock").return ?, * * jiffies - read_cache_jiffies > attrtimeo */ -probe nfs.fop.sendfile = kernel.function("nfs_file_sendfile") ?, - module("nfs").function("nfs_file_sendfile") ? +%( kernel_v <= "2.6.18" %? +probe nfs.fop.sendfile = kernel.function("nfs_file_sendfile") !, + module("nfs").function("nfs_file_sendfile") { dev = __file_dev($filp) @@ -796,8 +797,8 @@ probe nfs.fop.sendfile = kernel.function("nfs_file_sendfile") ?, units = "bytes" } -probe nfs.fop.sendfile.return = kernel.function("nfs_file_sendfile").return ?, - module("nfs").function("nfs_file_sendfile").return ? +probe nfs.fop.sendfile.return = kernel.function("nfs_file_sendfile").return !, + module("nfs").function("nfs_file_sendfile").return { name = "nfs.fop.sendfile.return" retstr = sprintf("%d", $return) @@ -807,6 +808,7 @@ probe nfs.fop.sendfile.return = kernel.function("nfs_file_sendfile").return ?, units = "bytes" } } +%) /*probe nfs.fop.check_flags * @@ -816,8 +818,8 @@ probe nfs.fop.sendfile.return = kernel.function("nfs_file_sendfile").return ?, * Arguments: * flag : file flag */ -probe nfs.fop.check_flags = kernel.function("nfs_check_flags") ?, - module("nfs").function("nfs_check_flags") ? +probe nfs.fop.check_flags = kernel.function("nfs_check_flags") !, + module("nfs").function("nfs_check_flags") { flag = $flags @@ -825,8 +827,8 @@ probe nfs.fop.check_flags = kernel.function("nfs_check_flags") ?, argstr = sprintf("%d",flag) } -probe nfs.fop.check_flags.return = kernel.function("nfs_check_flags").return ?, - module("nfs").function("nfs_check_flags").return ? +probe nfs.fop.check_flags.return = kernel.function("nfs_check_flags").return !, + module("nfs").function("nfs_check_flags").return { name = "nfs.fop.check_flags.return" retstr = sprintf("%d",$return) @@ -871,8 +873,8 @@ probe nfs.aop.return = nfs.aop.readpage.return, * rsize : read size (in bytes) * size : number of pages to be read in this execution */ -probe nfs.aop.readpage = kernel.function ("nfs_readpage") ?, - module("nfs").function ("nfs_readpage") ? +probe nfs.aop.readpage = kernel.function ("nfs_readpage") !, + module("nfs").function ("nfs_readpage") { __page = $page dev = __page_dev(__page) @@ -896,8 +898,8 @@ probe nfs.aop.readpage = kernel.function ("nfs_readpage") ?, units = "pages" } -probe nfs.aop.readpage.return = kernel.function ("nfs_readpage").return ?, - module("nfs").function ("nfs_readpage").return ? +probe nfs.aop.readpage.return = kernel.function ("nfs_readpage").return !, + module("nfs").function ("nfs_readpage").return { name = "nfs.aop.readpage.return" retstr = sprintf("%d", $return) @@ -918,8 +920,8 @@ probe nfs.aop.readpage.return = kernel.function ("nfs_readpage").return ?, * rsize : read size (in bytes) * size : number of pages attempted to read in this execution */ -probe nfs.aop.readpages = kernel.function ("nfs_readpages") ?, - module("nfs").function ("nfs_readpages") ? +probe nfs.aop.readpages = kernel.function ("nfs_readpages") !, + module("nfs").function ("nfs_readpages") { dev = $mapping->host->i_sb->s_dev ino = $mapping->host->i_ino @@ -937,8 +939,8 @@ probe nfs.aop.readpages = kernel.function ("nfs_readpages") ?, units = "pages" } -probe nfs.aop.readpages.return = kernel.function ("nfs_readpages").return ?, - module("nfs").function ("nfs_readpages").return ? +probe nfs.aop.readpages.return = kernel.function ("nfs_readpages").return !, + module("nfs").function ("nfs_readpages").return { name = "nfs.aop.readpages.return" retstr = sprintf("%d", $return) @@ -960,8 +962,8 @@ probe nfs.aop.readpages.return = kernel.function ("nfs_readpages").return ?, * page_flag : page flags */ probe nfs.aop.set_page_dirty = - kernel.function ("__set_page_dirty_nobuffers") ?, - module("nfs").function ("__set_page_dirty_nobuffers") ? + kernel.function ("__set_page_dirty_nobuffers") !, + module("nfs").function ("__set_page_dirty_nobuffers") { /* dev = $mapping->host->i_sb->s_dev devname = __find_bdevname(dev, $mapping->host->i_sb->s_bdev) @@ -975,8 +977,8 @@ probe nfs.aop.set_page_dirty = } probe nfs.aop.set_page_dirty.return = - kernel.function ("__set_page_dirty_nobuffers") .return?, - module("nfs").function ("__set_page_dirty_nobuffers").return ? + kernel.function ("__set_page_dirty_nobuffers") .return !, + module("nfs").function ("__set_page_dirty_nobuffers").return { name = "nfs.aop.set_page_dirty.return" retstr = sprintf("%d", $return) @@ -1003,8 +1005,8 @@ probe nfs.aop.set_page_dirty.return = * wsize : write size * size : number of pages to be written in this execution */ -probe nfs.aop.writepage = kernel.function ("nfs_writepage") ?, - module("nfs").function ("nfs_writepage") ? +probe nfs.aop.writepage = kernel.function ("nfs_writepage") !, + module("nfs").function ("nfs_writepage") { __page = $page dev = __page_dev(__page) @@ -1033,8 +1035,8 @@ probe nfs.aop.writepage = kernel.function ("nfs_writepage") ?, units = "pages" } -probe nfs.aop.writepage.return = kernel.function ("nfs_writepage").return ?, - module("nfs").function ("nfs_writepage").return ? +probe nfs.aop.writepage.return = kernel.function ("nfs_writepage").return !, + module("nfs").function ("nfs_writepage").return { name = "nfs.aop.writepage.return" retstr = sprintf("%d", $return) @@ -1053,8 +1055,8 @@ probe nfs.aop.writepage.return = kernel.function ("nfs_writepage").return ?, * nr_to_write : number of pages attempted to be written in this execution * size : number of pages attempted to be written in this execution */ -probe nfs.aop.writepages = kernel.function ("nfs_writepages") ?, - module("nfs").function ("nfs_writepages") ? +probe nfs.aop.writepages = kernel.function ("nfs_writepages") !, + module("nfs").function ("nfs_writepages") { dev = $mapping->host->i_sb->s_dev ino = $mapping->host->i_ino @@ -1073,8 +1075,8 @@ probe nfs.aop.writepages = kernel.function ("nfs_writepages") ?, units = "pages" } -probe nfs.aop.writepages.return = kernel.function ("nfs_writepages").return ?, - module("nfs").function ("nfs_writepages").return ? +probe nfs.aop.writepages.return = kernel.function ("nfs_writepages").return !, + module("nfs").function ("nfs_writepages").return { name = "nfs.aop.writepages.return" retstr = sprintf("%d", $return) @@ -1099,8 +1101,8 @@ probe nfs.aop.writepages.return = kernel.function ("nfs_writepages").return ?, in the page frame * size : write bytes */ -probe nfs.aop.prepare_write= kernel.function ("nfs_prepare_write") ?, - module("nfs").function ("nfs_prepare_write") ? +probe nfs.aop.prepare_write= kernel.function ("nfs_prepare_write") !, + module("nfs").function ("nfs_prepare_write") { __page = $page dev = __page_dev(__page) @@ -1120,8 +1122,8 @@ probe nfs.aop.prepare_write= kernel.function ("nfs_prepare_write") ?, } probe nfs.aop.prepare_write.return = - kernel.function ("nfs_prepare_write").return ?, - module("nfs").function ("nfs_prepare_write").return ? + kernel.function ("nfs_prepare_write").return !, + module("nfs").function ("nfs_prepare_write").return { name = "nfs.aop.prepare_write.return" retstr = sprintf("%d", $return) @@ -1147,8 +1149,8 @@ probe nfs.aop.prepare_write.return = in the page frame * size : write bytes */ -probe nfs.aop.commit_write= kernel.function ("nfs_commit_write") ?, - module("nfs").function ("nfs_commit_write") ? +probe nfs.aop.commit_write= kernel.function ("nfs_commit_write") !, + module("nfs").function ("nfs_commit_write") { __page = $page dev = __page_dev(__page) @@ -1174,8 +1176,8 @@ probe nfs.aop.commit_write= kernel.function ("nfs_commit_write") ?, probe nfs.aop.commit_write.return= - kernel.function ("nfs_commit_write").return ?, - module("nfs").function ("nfs_commit_write").return? + kernel.function ("nfs_commit_write").return !, + module("nfs").function ("nfs_commit_write").return { name = "nfs.aop.commit_write.return" retstr = sprintf("%d", $return) @@ -1194,8 +1196,8 @@ probe nfs.aop.commit_write.return= in the page frame * size : release pages */ -probe nfs.aop.release_page = kernel.function ("nfs_release_page") ?, - module("nfs").function ("nfs_release_page")? +probe nfs.aop.release_page = kernel.function ("nfs_release_page") !, + module("nfs").function ("nfs_release_page") { __page = $page dev = __page_dev(__page) @@ -1212,8 +1214,8 @@ probe nfs.aop.release_page = kernel.function ("nfs_release_page") ?, } -probe nfs.aop.release_page.return = kernel.function ("nfs_release_page").return ?, - module("nfs").function ("nfs_release_page").return? +probe nfs.aop.release_page.return = kernel.function ("nfs_release_page").return !, + module("nfs").function ("nfs_release_page").return { name = "nfs.aop.release_page.return" retstr = sprintf("%d", $return) diff --git a/tapset/nfs_proc.stp b/tapset/nfs_proc.stp index 2dc7e659..6ffdf646 100644 --- a/tapset/nfs_proc.stp +++ b/tapset/nfs_proc.stp @@ -559,6 +559,9 @@ probe nfs.proc.commit.return = nfs.proc3.commit.return, nfs.proc4.commit.return {} +// XXX: on kernels > 2.6.18 (?), module("nfs") -> module("nfsd") and +// function("nfsN...") becomes function("nfsdN..."). PR3833. + probe nfs.proc3.commit = kernel.function ("nfs3_proc_commit")?, module("nfs").function("nfs3_proc_commit")? { diff --git a/tapset/ppc64/registers.stp b/tapset/ppc64/registers.stp index d3605c05..6a8ae279 100644 --- a/tapset/ppc64/registers.stp +++ b/tapset/ppc64/registers.stp @@ -58,7 +58,11 @@ function _stp_register_regs() { _stp_regs_registered = 1 } -function _stp_get_register_by_offset:long (offset:long) %{ +function probing_32bit_app() %{ /* pure */ + THIS->__retvalue = _stp_probing_32bit_app(CONTEXT->regs); +%} + +function _stp_get_register_by_offset:long (offset:long) %{ /* pure */ long value; memcpy(&value, ((char *)CONTEXT->regs) + THIS->offset, sizeof(value)); THIS->__retvalue = value; @@ -70,14 +74,11 @@ function _stp_sign_extend32:long (value:long) { return value } -function _stp_probing_32bit_app() %{ - if (!(CONTEXT->regs)) - return 0; - return (user_mode(CONTEXT->regs) && - test_tsk_thread_flag(current, TIF_32BIT)); -%} - function _stp_register:long (name:string, sign_extend:long) { + if (!registers_valid()) { + error("cannot access CPU registers in this context") + return 0 + } if (!_stp_regs_registered) _stp_register_regs() offset = _reg_offsets[name] @@ -86,7 +87,7 @@ function _stp_register:long (name:string, sign_extend:long) { return 0 } value = _stp_get_register_by_offset(offset) - if (_stp_probing_32bit_app()) { + if (probing_32bit_app()) { if (sign_extend) value = _stp_sign_extend32(value) else @@ -114,66 +115,39 @@ function u_register:long (name:string) { * If sign_extend=1 and (truncate=1 or the probepoint we've hit is in a * 32-bit app), sign-extend the 32-bit value. */ -function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) %{ - long val; - int n; - size_t argsz = sizeof(long); - - THIS->__retvalue = 0; - if (!CONTEXT->regs) { - snprintf(CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer), - "cannot access function args in this context"); - CONTEXT->last_error = CONTEXT->error_buffer; - return; - } - if (THIS->argnum < 1) - goto bad_argnum; - n = (int) THIS->argnum; - - switch (n) { - case 1: - val = u_register("r3"); - break; - case 2: - val = u_register("r4"); - break; - case 3: - val = u_register("r5"); - break; - case 4: - val = u_register("r6"); - break; - case 5: - val = u_register("r7"); - break; - case 6: - val = u_register("r8"); - break; - case 7: - val = u_register("r9"); - break; - case 8: - val = u_register("r10"); - break; - default: - goto bad_argnum; +function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) { + val = 0 + if (argnum < 1 || argnum > 8) { + error(sprintf("Cannot access arg(%d)", argnum)) + return 0 } - if (THIS->truncate || argsz == sizeof(int)) { - if (THIS->sign_extend) - THIS->__retvalue = (int64_t) _stp_sign_extend32(val); + + if (argnum == 1) + val = u_register("r3") + else if (argnum == 2) + val = u_register("r4") + else if (argnum == 3) + val = u_register("r5") + else if (argnum == 4) + val = u_register("r6") + else if (argnum == 5) + val = u_register("r7") + else if (argnum == 6) + val = u_register("r8") + else if (argnum == 7) + val = u_register("r9") + else (argnum == 8) + val = u_register("r10") + + if (truncate) { + if (sign_extend) + val = _stp_sign_extend32(val) else /* High bits may be garbage. */ - THIS->__retvalue = (int64_t) (val & 0xffffffff); - } else - THIS->__retvalue = (int64_t) val; - return; - -bad_argnum: - snprintf(CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer), - "cannot access arg(%lld)", THIS->argnum); - CONTEXT->last_error = CONTEXT->error_buffer; - return; -%} + val = (val & 0xffffffff); + } + return val; +} /* Return the value of function arg #argnum (1=first arg) as a signed int. */ function int_arg:long (argnum:long) { @@ -194,7 +168,7 @@ function ulong_arg:long (argnum:long) { } function longlong_arg:long (argnum:long) { - if (_stp_probing_32bit_app()) { + if (probing_32bit_app()) { lowbits = _stp_arg(argnum, 0, 1) highbits = _stp_arg(argnum+1, 0, 1) return ((highbits << 32) | lowbits) diff --git a/tapset/rpc.stp b/tapset/rpc.stp index 537bf348..f97117b5 100644 --- a/tapset/rpc.stp +++ b/tapset/rpc.stp @@ -1,6 +1,7 @@ // rpc tapset // Copyright (C) 2006 IBM Corp. // Copyright (C) 2007 Bull S.A.S +// Copyright (C) 2008 Red Hat // // This file is part of systemtap, and is free software. You can // redistribute it and/or modify it under the terms of the GNU General @@ -79,8 +80,9 @@ probe sunrpc.clnt.create_client = _sunrpc.clnt.create_client.* prog, vers, prot, port, authflavor) } -probe _sunrpc.clnt.create_client.part1 = kernel.function("rpc_create_client") ?, - module("sunrpc").function("rpc_create_client") ? +%( kernel_v <= "2.6.18" %? +probe _sunrpc.clnt.create_client.part1 = kernel.function("rpc_create_client") !, + module("sunrpc").function("rpc_create_client") { name = "sunrpc.clnt.create_client" %( kernel_v >= "2.6.10" %? @@ -95,9 +97,10 @@ probe _sunrpc.clnt.create_client.part1 = kernel.function("rpc_create_client") ?, authflavor = $flavor %) } +%) -probe _sunrpc.clnt.create_client.part2 = kernel.function("rpc_new_client") ?, - module("sunrpc").function("rpc_new_client") ? +probe _sunrpc.clnt.create_client.part2 = kernel.function("rpc_new_client") !, + module("sunrpc").function("rpc_new_client") { name = "sunrpc.clnt.new_client" progname = kernel_string($program->name) @@ -106,21 +109,23 @@ probe _sunrpc.clnt.create_client.part2 = kernel.function("rpc_new_client") ?, authflavor = $flavor } -probe sunrpc.clnt.create_client.return = _sunrpc.clnt.create_client.return.* +probe sunrpc.clnt.create_client.return = _sunrpc.clnt.create_client.return.* { retstr = returnstr(2) } +%( kernel_v <= "2.6.18" %? probe _sunrpc.clnt.create_client.return.part1 = - kernel.function("rpc_create_client").return ?, - module("sunrpc").function("rpc_create_client").return ? + kernel.function("rpc_create_client").return !, + module("sunrpc").function("rpc_create_client").return { name = "sunrpc.clnt.create_client.return" } +%) probe _sunrpc.clnt.create_client.return.part2 = - kernel.function("rpc_new_client").return ?, - module("sunrpc").function("rpc_new_client").return ? + kernel.function("rpc_new_client").return !, + module("sunrpc").function("rpc_new_client").return { name = "sunrpc.clnt.new_client.return" } @@ -138,8 +143,8 @@ probe _sunrpc.clnt.create_client.return.part2 = * @port: the port number * @authflavor: the authentication flavor */ -probe sunrpc.clnt.clone_client = kernel.function("rpc_clone_client") ?, - module("sunrpc").function("rpc_clone_client") ? +probe sunrpc.clnt.clone_client = kernel.function("rpc_clone_client") !, + module("sunrpc").function("rpc_clone_client") { servername = kernel_string($clnt->cl_server) progname = kernel_string($clnt->cl_protname) @@ -155,8 +160,8 @@ probe sunrpc.clnt.clone_client = kernel.function("rpc_clone_client") ?, } probe sunrpc.clnt.clone_client.return = - kernel.function("rpc_clone_client").return ?, - module("sunrpc").function("rpc_clone_client").return ? + kernel.function("rpc_clone_client").return !, + module("sunrpc").function("rpc_clone_client").return { name = "sunrpc.clnt.clone_client.return" retstr = returnstr(2) @@ -188,8 +193,8 @@ probe sunrpc.clnt.clone_client.return = * @om_rtt: the RPC RTT jiffies * @om_execute: the RPC execution jiffies */ -probe sunrpc.clnt.shutdown_client = kernel.function("rpc_shutdown_client") ?, - module("sunrpc").function("rpc_shutdown_client") ? +probe sunrpc.clnt.shutdown_client = kernel.function("rpc_shutdown_client") !, + module("sunrpc").function("rpc_shutdown_client") { servername = kernel_string($clnt->cl_server) progname = kernel_string($clnt->cl_protname) @@ -220,8 +225,8 @@ probe sunrpc.clnt.shutdown_client = kernel.function("rpc_shutdown_client") ?, } probe sunrpc.clnt.shutdown_client.return = - kernel.function("rpc_shutdown_client").return ?, - module("sunrpc").function("rpc_shutdown_client").return ? + kernel.function("rpc_shutdown_client").return !, + module("sunrpc").function("rpc_shutdown_client").return { name = "sunrpc.clnt.shutdown_client.return" retstr = returnstr(1) @@ -242,8 +247,8 @@ probe sunrpc.clnt.shutdown_client.return = * @vers: the version of new RPC program */ probe sunrpc.clnt.bind_new_program = - kernel.function("rpc_bind_new_program") ?, - module("sunrpc").function("rpc_bind_new_program") ? + kernel.function("rpc_bind_new_program") !, + module("sunrpc").function("rpc_bind_new_program") { servername = kernel_string($old->cl_server) old_progname = kernel_string($old->cl_protname) @@ -259,8 +264,8 @@ probe sunrpc.clnt.bind_new_program = } probe sunrpc.clnt.bind_new_program.return = - kernel.function("rpc_bind_new_program").return ?, - module("sunrpc").function("rpc_bind_new_program").return ? + kernel.function("rpc_bind_new_program").return !, + module("sunrpc").function("rpc_bind_new_program").return { name = "sunrpc.clnt.bind_new_program.return" retstr = returnstr(2) @@ -282,8 +287,8 @@ probe sunrpc.clnt.bind_new_program.return = * @proc: the procedure number in this RPC call * @flags: flags */ -probe sunrpc.clnt.call_sync = kernel.function("rpc_call_sync") ?, - module("sunrpc").function("rpc_call_sync") ? +probe sunrpc.clnt.call_sync = kernel.function("rpc_call_sync") !, + module("sunrpc").function("rpc_call_sync") { servername = kernel_string($clnt->cl_server) progname = kernel_string($clnt->cl_protname) @@ -306,8 +311,8 @@ probe sunrpc.clnt.call_sync = kernel.function("rpc_call_sync") ?, vers, procname, flags) } -probe sunrpc.clnt.call_sync.return = kernel.function("rpc_call_sync").return ?, - module("sunrpc").function("rpc_call_sync").return ? +probe sunrpc.clnt.call_sync.return = kernel.function("rpc_call_sync").return !, + module("sunrpc").function("rpc_call_sync").return { name = "sunrpc.clnt.call_sync.return" retstr = returnstr(1) @@ -329,8 +334,8 @@ probe sunrpc.clnt.call_sync.return = kernel.function("rpc_call_sync").return ?, * @proc: the procedure number in this RPC call * @flags: flags */ -probe sunrpc.clnt.call_async = kernel.function("rpc_call_async") ?, - module("sunrpc").function("rpc_call_async") ? +probe sunrpc.clnt.call_async = kernel.function("rpc_call_async") !, + module("sunrpc").function("rpc_call_async") { servername = kernel_string($clnt->cl_server) progname = kernel_string($clnt->cl_protname) @@ -354,8 +359,8 @@ probe sunrpc.clnt.call_async = kernel.function("rpc_call_async") ?, } probe sunrpc.clnt.call_async.return = - kernel.function("rpc_call_async").return ?, - module("sunrpc").function("rpc_call_async").return ? + kernel.function("rpc_call_async").return !, + module("sunrpc").function("rpc_call_async").return { name = "sunrpc.clnt.call_async.return" retstr = returnstr(1) @@ -374,8 +379,8 @@ probe sunrpc.clnt.call_async.return = * @tk_priority: the task priority * @tk_runstate: the task run status */ -probe sunrpc.clnt.restart_call = kernel.function("rpc_restart_call") ?, - module("sunrpc").function("rpc_restart_call") ? +probe sunrpc.clnt.restart_call = kernel.function("rpc_restart_call") !, + module("sunrpc").function("rpc_restart_call") { servername = kernel_string($task->tk_client->cl_server) prog = prog_from_clnt($task->tk_client) @@ -391,8 +396,8 @@ probe sunrpc.clnt.restart_call = kernel.function("rpc_restart_call") ?, } probe sunrpc.clnt.restart_call.return = - kernel.function("rpc_restart_call").return ?, - module("sunrpc").function("rpc_restart_call").return ? + kernel.function("rpc_restart_call").return !, + module("sunrpc").function("rpc_restart_call").return { name = "sunrpc.clnt.restart_call.return" } @@ -434,8 +439,8 @@ probe sunrpc.svc.return = * @prot: the IP protocol number * @port: the port number */ -probe sunrpc.svc.register = kernel.function("svc_register") ?, - module("sunrpc").function("svc_register") ? +probe sunrpc.svc.register = kernel.function("svc_register") !, + module("sunrpc").function("svc_register") { sv_name = kernel_string($serv->sv_name) progname = kernel_string($serv->sv_program->pg_name) @@ -447,8 +452,8 @@ probe sunrpc.svc.register = kernel.function("svc_register") ?, argstr = sprintf("%s %s %d %d", sv_name, progname, prot, port) } -probe sunrpc.svc.register.return = kernel.function("svc_register").return ?, - module("sunrpc").function("svc_register").return ? +probe sunrpc.svc.register.return = kernel.function("svc_register").return !, + module("sunrpc").function("svc_register").return { name = "sunrpc.svc.register.return" retstr = returnstr(1) @@ -465,8 +470,8 @@ probe sunrpc.svc.register.return = kernel.function("svc_register").return ?, * @pg_nvers: the number of supported versions * @bufsize: the buffer size */ -probe sunrpc.svc.create = kernel.function("svc_create") ?, - module("sunrpc").function("svc_create") ? +probe sunrpc.svc.create = kernel.function("svc_create") !, + module("sunrpc").function("svc_create") { progname = kernel_string($prog->pg_name) prog = $prog->pg_prog @@ -477,8 +482,8 @@ probe sunrpc.svc.create = kernel.function("svc_create") ?, argstr = sprintf("%s %d %d %d", progname, prog, pg_nvers, bufsize) } -probe sunrpc.svc.create.return = kernel.function("svc_create").return ?, - module("sunrpc").function("svc_create").return ? +probe sunrpc.svc.create.return = kernel.function("svc_create").return !, + module("sunrpc").function("svc_create").return { name = "sunrpc.svc.create.return" retstr = returnstr(2) @@ -499,8 +504,8 @@ probe sunrpc.svc.create.return = kernel.function("svc_create").return ?, * @rpcbadfmt: the count of requests dropped for bad formats * @rpcbadauth: the count of requests drooped for authentication failure */ -probe sunrpc.svc.destroy = kernel.function("svc_destroy") ?, - module("sunrpc").function("svc_destroy") ? +probe sunrpc.svc.destroy = kernel.function("svc_destroy") !, + module("sunrpc").function("svc_destroy") { sv_name = kernel_string($serv->sv_name) /* service name */ sv_progname = kernel_string($serv->sv_program->pg_name) @@ -518,8 +523,8 @@ probe sunrpc.svc.destroy = kernel.function("svc_destroy") ?, argstr = sprintf("%s %d %d", sv_name, sv_prog, sv_nrthreads) } -probe sunrpc.svc.destroy.return = kernel.function("svc_destroy").return ?, - module("sunrpc").function("svc_destroy").return ? +probe sunrpc.svc.destroy.return = kernel.function("svc_destroy").return !, + module("sunrpc").function("svc_destroy").return { name = "sunrpc.svc.destroy.return" } @@ -539,8 +544,8 @@ probe sunrpc.svc.destroy.return = kernel.function("svc_destroy").return ?, * @rq_proc: the procedure number in the request * @rq_prot: the IP protocol of the reqeust */ -probe sunrpc.svc.process = kernel.function("svc_process") ?, - module("sunrpc").function("svc_process") ? +probe sunrpc.svc.process = kernel.function("svc_process") !, + module("sunrpc").function("svc_process") { %( kernel_v >= "2.6.19" %? sv_name = kernel_string($rqstp->rq_server->sv_name) /* service name */ @@ -563,8 +568,8 @@ probe sunrpc.svc.process = kernel.function("svc_process") ?, rq_xid, rq_prog, rq_vers, rq_proc) } -probe sunrpc.svc.process.return = kernel.function("svc_process").return ?, - module("sunrpc").function("svc_process").return ? +probe sunrpc.svc.process.return = kernel.function("svc_process").return !, + module("sunrpc").function("svc_process").return { name = "sunrpc.svc.process.return" retstr = returnstr(1) @@ -583,8 +588,8 @@ probe sunrpc.svc.process.return = kernel.function("svc_process").return ?, * @rq_proc: the procedure number in the request * @rq_prot: the IP protocol of the reqeust */ -probe sunrpc.svc.authorise = kernel.function("svc_authorise")?, - module("sunrpc").function("svc_authorise")? +probe sunrpc.svc.authorise = kernel.function("svc_authorise") !, + module("sunrpc").function("svc_authorise") { sv_name = kernel_string($rqstp->rq_server->sv_name) peer_ip = addr_from_rqst($rqstp) @@ -599,8 +604,8 @@ probe sunrpc.svc.authorise = kernel.function("svc_authorise")?, rq_vers, rq_proc, rq_prot) } -probe sunrpc.svc.authorise.return = kernel.function("svc_authorise").return ?, - module("sunrpc").function("svc_authorise").return ? +probe sunrpc.svc.authorise.return = kernel.function("svc_authorise").return !, + module("sunrpc").function("svc_authorise").return { name = "sunrpc.svc.authorise.return" retstr = returnstr(1) @@ -616,8 +621,8 @@ probe sunrpc.svc.authorise.return = kernel.function("svc_authorise").return ?, * @sv_nrthreads:the number of concurrent threads * @timeout: the timeout of waiting for data */ -probe sunrpc.svc.recv = kernel.function("svc_recv")?, - module("sunrpc").function("svc_recv")? +probe sunrpc.svc.recv = kernel.function("svc_recv") !, + module("sunrpc").function("svc_recv") { %( kernel_v >= "2.6.19" %? sv_name = kernel_string($rqstp->rq_server->sv_name) @@ -634,8 +639,8 @@ probe sunrpc.svc.recv = kernel.function("svc_recv")?, argstr = sprintf("%s %d", sv_name, timeout) } -probe sunrpc.svc.recv.return = kernel.function("svc_recv").return ?, - module("sunrpc").function("svc_recv").return ? +probe sunrpc.svc.recv.return = kernel.function("svc_recv").return !, + module("sunrpc").function("svc_recv").return { name = "sunrpc.svc.recv.return" retstr = returnstr(1) @@ -654,8 +659,8 @@ probe sunrpc.svc.recv.return = kernel.function("svc_recv").return ?, * @rq_proc: the procedure number in the request * @rq_prot: the IP protocol of the reqeust */ -probe sunrpc.svc.send = kernel.function("svc_send")?, - module("sunrpc").function("svc_send")? +probe sunrpc.svc.send = kernel.function("svc_send") !, + module("sunrpc").function("svc_send") { sv_name = kernel_string($rqstp->rq_server->sv_name) peer_ip = addr_from_rqst($rqstp) @@ -670,8 +675,8 @@ probe sunrpc.svc.send = kernel.function("svc_send")?, rq_xid, rq_prog, rq_vers, rq_proc, rq_prot) } -probe sunrpc.svc.send.return = kernel.function("svc_send").return ?, - module("sunrpc").function("svc_send").return ? +probe sunrpc.svc.send.return = kernel.function("svc_send").return !, + module("sunrpc").function("svc_send").return { name = "sunrpc.svc.send.return" retstr = returnstr(1) @@ -690,8 +695,8 @@ probe sunrpc.svc.send.return = kernel.function("svc_send").return ?, * @rq_proc: the procedure number in the request * @rq_prot: the IP protocol of the reqeust */ -probe sunrpc.svc.drop = kernel.function("svc_drop")?, - module("sunrpc").function("svc_drop")? +probe sunrpc.svc.drop = kernel.function("svc_drop") !, + module("sunrpc").function("svc_drop") { sv_name = kernel_string($rqstp->rq_server->sv_name) peer_ip = addr_from_rqst($rqstp) @@ -706,8 +711,8 @@ probe sunrpc.svc.drop = kernel.function("svc_drop")?, rq_xid, rq_prog, rq_vers, rq_proc, rq_prot) } -probe sunrpc.svc.drop.return = kernel.function("svc_drop").return ?, - module("sunrpc").function("svc_drop").return ? +probe sunrpc.svc.drop.return = kernel.function("svc_drop").return !, + module("sunrpc").function("svc_drop").return { name = "sunrpc.svc.drop.return" } @@ -741,8 +746,8 @@ probe sunrpc.sched.return = * @prot: the IP protocol in the RPC call * @tk_flags: the flags of the task */ -probe sunrpc.sched.new_task = kernel.function("rpc_new_task") ?, - module("sunrpc").function("rpc_new_task") ? +probe sunrpc.sched.new_task = kernel.function("rpc_new_task") !, + module("sunrpc").function("rpc_new_task") { xid = xid_from_clnt($clnt) prog = prog_from_clnt($clnt) @@ -754,8 +759,8 @@ probe sunrpc.sched.new_task = kernel.function("rpc_new_task") ?, argstr = sprintf("%d %d %d %d %d", xid, prog, vers, prot, flags) } -probe sunrpc.sched.new_task.return = kernel.function("rpc_new_task").return ?, - module("sunrpc").function("rpc_new_task").return ? +probe sunrpc.sched.new_task.return = kernel.function("rpc_new_task").return !, + module("sunrpc").function("rpc_new_task").return { name = "sunrpc.sched.new_task.return" retstr = returnstr(2) @@ -772,8 +777,8 @@ probe sunrpc.sched.new_task.return = kernel.function("rpc_new_task").return ?, * @prot: the IP protocol in the RPC call * @tk_flags: the flags of the task */ -probe sunrpc.sched.release_task = kernel.function("rpc_release_task") ?, - module("sunrpc").function("rpc_release_task") ? +probe sunrpc.sched.release_task = kernel.function("rpc_release_task") !, + module("sunrpc").function("rpc_release_task") { xid = xid_from_clnt($task->tk_client) prog = prog_from_clnt($task->tk_client) @@ -786,8 +791,8 @@ probe sunrpc.sched.release_task = kernel.function("rpc_release_task") ?, } probe sunrpc.sched.release_task.return = - kernel.function("rpc_release_task").return ?, - module("sunrpc").function("rpc_release_task").return ? + kernel.function("rpc_release_task").return !, + module("sunrpc").function("rpc_release_task").return { name = "sunrpc.sched.release_task.return" } @@ -805,8 +810,8 @@ probe sunrpc.sched.release_task.return = * @tk_pid: the debugging id of the task * @tk_flags: the flags of the task */ -probe sunrpc.sched.execute = kernel.function("__rpc_execute") ?, - module("sunrpc").function("__rpc_execute") ? +probe sunrpc.sched.execute = kernel.function("__rpc_execute") !, + module("sunrpc").function("__rpc_execute") { xid = xid_from_clnt($task->tk_client) prog = prog_from_clnt($task->tk_client) @@ -820,8 +825,8 @@ probe sunrpc.sched.execute = kernel.function("__rpc_execute") ?, tk_pid, tk_flags) } -probe sunrpc.sched.execute.return = kernel.function("__rpc_execute").return ?, - module("sunrpc").function("__rpc_execute").return ? +probe sunrpc.sched.execute.return = kernel.function("__rpc_execute").return !, + module("sunrpc").function("__rpc_execute").return { name = "sunrpc.sched.execute.return" @@ -845,8 +850,8 @@ probe sunrpc.sched.execute.return = kernel.function("__rpc_execute").return ?, * @tk_flags: the flags of the task * @delay: the time delayed */ -probe sunrpc.sched.delay = kernel.function("rpc_delay") ?, - module("sunrpc").function("rpc_delay") ? +probe sunrpc.sched.delay = kernel.function("rpc_delay") !, + module("sunrpc").function("rpc_delay") { xid = xid_from_clnt($task->tk_client) prog = prog_from_clnt($task->tk_client) @@ -861,8 +866,8 @@ probe sunrpc.sched.delay = kernel.function("rpc_delay") ?, prot, tk_pid, tk_flags, delay) } -probe sunrpc.sched.delay.return = kernel.function("rpc_delay").return ?, - module("sunrpc").function("rpc_delay").return ? +probe sunrpc.sched.delay.return = kernel.function("rpc_delay").return !, + module("sunrpc").function("rpc_delay").return { name = "sunrpc.sched.delay.return" } diff --git a/tapset/s390x/syscalls.stp b/tapset/s390x/syscalls.stp index 39236d79..07cb0577 100644 --- a/tapset/s390x/syscalls.stp +++ b/tapset/s390x/syscalls.stp @@ -103,7 +103,7 @@ probe syscall.sysctl32.return = kernel.function("sys32_sysctl").return ? { /* compat */ function get_32mmap_args:string (args:long) -%{ +%{ /* pure */ struct mmap_arg_struct_emu31 { u32 addr; u32 len; diff --git a/tapset/signal.stp b/tapset/signal.stp index 72ba9520..4fec7c13 100644 --- a/tapset/signal.stp +++ b/tapset/signal.stp @@ -37,8 +37,7 @@ */ probe signal.send = _signal.send.* { - sig=$sig - sig_name = _signal_name($sig) + sig_name = _signal_name(sig) sig_pid = task_pid(task) pid_name = task_execname(task) @@ -53,25 +52,35 @@ probe signal.send = _signal.send.* probe _signal.send.part1 = kernel.function("__group_send_sig_info") { name = "__group_send_sig_info" + sig = $sig task = $p sinfo = $info shared = 1 send2queue = 0 } +%( kernel_v <= "2.6.25" %? probe _signal.send.part2 = kernel.function("send_group_sigqueue") { name = "send_group_sigqueue" + sig = $sig task = $p sinfo = 0 # $q->info shared = 1 send2queue = 1 } +%) probe _signal.send.part3 = kernel.function("send_sigqueue") { name = "send_sigqueue" +%( kernel_v > "2.6.25" %? + task = $t + sig = $q->info->si_signo +%: task = $p + sig = $sig +%) sinfo = 0 # $q->info shared = 0 send2queue = 1 @@ -80,6 +89,7 @@ probe _signal.send.part3 = kernel.function("send_sigqueue") probe _signal.send.part4 = kernel.function("specific_send_sig_info") { name = "specific_send_sig_info" + sig = $sig task = $t sinfo = $info shared = 0 @@ -121,6 +131,7 @@ probe _signal.send.part4.return = kernel.function("specific_send_sig_info").retu send2queue = 0 } +%( kernel_v <= "2.6.25" %? /* * - return 0 if the signal is either sucessfully added into the * sigqueue of receiving process or a SI_TIMER entry is already @@ -135,6 +146,7 @@ probe _signal.send.part2.return = kernel.function("send_group_sigqueue").return shared = 1 send2queue = 1 } +%) /* * - return 0 if the signal is either sucessfully added into the @@ -224,7 +236,7 @@ probe signal.check_ignored = kernel.function("sig_ignored") sig_name = _signal_name($sig) } -probe signal.check_ignored.return = kernel.function("sig_ignored").return +probe signal.check_ignored.return = kernel.function("sig_ignored").return ? { name = "sig_ignored" retstr = returnstr(1) @@ -336,7 +348,7 @@ probe signal.systkill.return = syscall.tkill.return */ probe signal.send_sig_queue = kernel.function("send_sigqueue"), - kernel.function("send_group_sigqueue") + kernel.function("send_group_sigqueue") ? { sig = $sig sig_name = _signal_name($sig) @@ -347,7 +359,7 @@ probe signal.send_sig_queue = probe signal.send_sig_queue.return = kernel.function("send_sigqueue").return, - kernel.function("send_group_sigqueue").return + kernel.function("send_group_sigqueue").return ? { retstr = returnstr(1) } diff --git a/tapset/syscalls.stp b/tapset/syscalls.stp index d394208f..11c2bdf7 100644 --- a/tapset/syscalls.stp +++ b/tapset/syscalls.stp @@ -630,7 +630,8 @@ probe syscall.exit = kernel.function("do_exit") { status = $code argstr = sprint($code) } -probe syscall.exit.return = end {} +# sys_exit() never returns, and is blacklisted for return probes, +# so no alias here. See bz6588. # exit_group _________________________________________________ # void sys_exit_group(int error_code) @@ -640,8 +641,26 @@ probe syscall.exit_group = kernel.function("sys_exit_group") { status = $error_code argstr = sprint($error_code) } +# sys_exit_group() never returns, and is blacklisted for return probes, +# so no alias here. See bz6588. -probe syscall.exit_group.return = end {} +# faccessat __________________________________________________ +# new function with 2.6.16 +# long sys_faccessat(int dfd, const char __user *filename, int mode) +probe syscall.faccessat = kernel.function("sys_faccessat") ? { + name = "faccessat" + dfd = $dfd + dfd_str = _dfd_str($dfd) + filename = $filename + filename_str = user_string($filename) + mode = $mode + mode_str = _access_mode_str($mode) + argstr = sprintf("%s, %s, %s", dfd_str, user_string_quoted($filename), mode_str) +} +probe syscall.faccessat.return = kernel.function("sys_faccessat").return ? { + name = "faccessat" + retstr = returnstr(1) +} %(arch != "x86_64" %? # fadvise64 __________________________________________________ @@ -736,6 +755,24 @@ probe syscall.fchmod.return = kernel.function("sys_fchmod").return { retstr = returnstr(1) } +# fchmodat ___________________________________________________ +# new function with 2.6.16 +# long sys_fchmodat(int dfd, const char __user *filename, +# mode_t mode) +probe syscall.fchmodat = kernel.function("sys_fchmodat") ? { + name = "fchmodat" + dfd = $dfd + dfd_str = _dfd_str($dfd) + filename = $filename + filename_str = user_string($filename) + mode = $mode + argstr = sprintf("%s, %s, %#o", dfd_str, user_string_quoted($filename), $mode) +} +probe syscall.fchmodat.return = kernel.function("sys_fchmodat").return ? { + name = "fchmodat" + retstr = returnstr(1) +} + # fchown _____________________________________________________ # long sys_fchown(unsigned int fd, uid_t user, gid_t group) probe syscall.fchown = kernel.function("sys_fchown") { @@ -764,6 +801,28 @@ probe syscall.fchown16.return = kernel.function("sys_fchown16").return ? { retstr = returnstr(1) } +# fchownat ___________________________________________________ +# new function with 2.6.16 +# long sys_fchownat(int dfd, const char __user *filename, +# uid_t user, gid_t group, int flag) +probe syscall.fchownat = kernel.function("sys_fchownat") ? { + name = "fchownat" + dfd = $dfd + dfd_str = _dfd_str($dfd) + filename = $filename + filename_str = user_string($filename) + user = __int32($user) + group = __int32($group) + flag = $flag + flag_str = _at_flag_str($flag) + argstr = sprintf("%s, %s, %d, %d, %s", + dfd_str, user_string_quoted($filename), user, group, flag_str) +} +probe syscall.fchownat.return = kernel.function("sys_fchownat").return ? { + name = "fchownat" + retstr = returnstr(1) +} + # fcntl ______________________________________________________ # long sys_fcntl(int fd, unsigned int cmd, unsigned long arg) # long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg) @@ -2013,6 +2072,7 @@ probe syscall.lchown16.return = kernel.function("sys_lchown16").return ? { name = "lchown16" retstr = returnstr(1) } + # lgetxattr __________________________________________________ # ssize_t sys_lgetxattr(char __user *path, # char __user *name, @@ -2035,6 +2095,7 @@ probe syscall.lgetxattr.return = kernel.function("sys_lgetxattr").return { name = "lgetxattr" retstr = returnstr(1) } + # link _______________________________________________________ # long sys_link(const char __user * oldname, # const char __user * newname) @@ -2051,6 +2112,32 @@ probe syscall.link.return = kernel.function("sys_link").return { retstr = returnstr(1) } +# linkat _____________________________________________________ +# new function with 2.6.16 +# long sys_linkat(int olddfd, const char __user *oldname, +# int newdfd, const char __user *newname, int flags) +probe syscall.linkat = kernel.function("sys_linkat") ? { + name = "linkat" + olddfd = $olddfd + olddfd_str = _dfd_str($olddfd) + oldname = $oldname + oldname_str = user_string($oldname) + newdfd = $newdfd + newdfd_str = _dfd_str($newdfd) + newname = $newname + newname_str = user_string($newname) + flags = $flags + flags_str = _at_flag_str($flags) + argstr = sprintf("%s, %s, %s, %s, %s", + olddfd_str, user_string_quoted($oldname), + newdfd_str, user_string_quoted($newname), + flags_str) +} +probe syscall.linkat.return = kernel.function("sys_linkat").return ? { + name = "linkat" + retstr = returnstr(1) +} + # listen _____________________________________________________ # long sys_listen(int fd, int backlog) probe syscall.listen = kernel.function("sys_listen") ? { @@ -2328,7 +2415,7 @@ probe syscall.mkdirat = kernel.function("sys_mkdirat") ? { dirfd = $dfd pathname = user_string($pathname) mode = $mode - argstr = sprintf("%d, %s, %#o", $dfd, user_string_quoted($pathname), $mode) + argstr = sprintf("%s, %s, %#o", _dfd_str($dfd), user_string_quoted($pathname), $mode) } probe syscall.mkdirat.return = kernel.function("sys_mkdirat").return ? { name = "mkdirat" @@ -2350,6 +2437,27 @@ probe syscall.mknod.return = kernel.function("sys_mknod").return { retstr = returnstr(1) } +# mknodat ____________________________________________________ +# new function with 2.6.16 +# long sys_mknodat(int dfd, const char __user *filename, +# int mode, unsigned dev) +probe syscall.mknodat = kernel.function("sys_mknodat") ? { + name = "mknodat" + dfd = $dfd + dfd_str = _dfd_str($dfd) + filename = $filename + filename_str = user_string($filename) + mode = $mode + mode_str = _mknod_mode_str($mode) + dev = $dev + argstr = sprintf("%s, %s, %s, %p", + dfd_str, user_string_quoted($filename), mode_str, $dev) +} +probe syscall.mknodat.return = kernel.function("sys_mknodat").return ? { + name = "mknodat" + retstr = returnstr(1) +} + # mlock ______________________________________________________ # # long sys_mlock(unsigned long start, size_t len) diff --git a/tapset/syscalls2.stp b/tapset/syscalls2.stp index 0db50347..98bdc95f 100644 --- a/tapset/syscalls2.stp +++ b/tapset/syscalls2.stp @@ -2853,6 +2853,20 @@ probe syscall.unlink.return = kernel.function("sys_unlink").return { name = "unlink" retstr = returnstr(1) } + +# unshare ____________________________________________________ +# new function with 2.6.16 +# long sys_unshare(unsigned long unshare_flags) +probe syscall.unshare = kernel.function("sys_unshare") ? { + name = "unshare" + unshare_flags = $unshare_flags + argstr = __fork_flags(unshare_flags) +} +probe syscall.unshare.return = kernel.function("sys_unshare").return ? { + name = "unshare" + retstr = returnstr(1) +} + # uselib _____________________________________________________ # # asmlinkage long diff --git a/tapset/task.stp b/tapset/task.stp index a15888f8..d89729e8 100644 --- a/tapset/task.stp +++ b/tapset/task.stp @@ -9,6 +9,9 @@ %{ #include <linux/version.h> #include <linux/file.h> +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) +#include <linux/fdtable.h> +#endif %} // Return the task_struct representing the current process diff --git a/tapset/x86_64/registers.stp b/tapset/x86_64/registers.stp index a5aba55a..99c39e18 100644 --- a/tapset/x86_64/registers.stp +++ b/tapset/x86_64/registers.stp @@ -38,7 +38,7 @@ function _stp_register_regs() { _stp_regs_registered = 1 } -function _stp_get_register_by_offset:long (offset:long) %{ +function _stp_get_register_by_offset:long (offset:long) %{ /* pure */ long value; memcpy(&value, ((char *)CONTEXT->regs) + THIS->offset, sizeof(value)); THIS->__retvalue = value; @@ -48,12 +48,16 @@ function _stp_get_register_by_offset:long (offset:long) %{ * _stp_sign_extend32() is callable from a script function. * __stp_sign_extend32() (in regs.c) is callable from a C function. */ -function _stp_sign_extend32:long (value:long) %{ +function _stp_sign_extend32:long (value:long) %{ /* pure */ THIS->__retvalue = __stp_sign_extend32(THIS->value); %} function _stp_register:long (name:string, sign_extend:long) { reg32 = 0 + if (!registers_valid()) { + error("cannot access CPU registers in this context") + return 0 + } if (!_stp_regs_registered) _stp_register_regs() offset = _reg_offsets[name] @@ -94,7 +98,7 @@ function u_register:long (name:string) { * If sign_extend=1 and (truncate=1 or the probepoint we've hit is in a * 32-bit app), sign-extend the 32-bit value. */ -function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) %{ +function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) %{ /* pure */ long val; int result, n, nr_regargs; size_t argsz = sizeof(long); @@ -166,7 +170,7 @@ deref_fault: /* branched to from deref() */ } %} -function probing_32bit_app() %{ +function probing_32bit_app() %{ /* pure */ THIS->__retvalue = _stp_probing_32bit_app(CONTEXT->regs); %} @@ -227,7 +231,7 @@ function asmlinkage() { function fastcall() { } -function regparm(n) %{ +function regparm(n:long) %{ if (_stp_probing_32bit_app(CONTEXT->regs) && (THIS->n < 0 || THIS->n > 3)) { snprintf(CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer), @@ -239,5 +243,9 @@ function regparm(n) %{ "For x86_64, regparm value must be in the range 0-6."); CONTEXT->last_error = CONTEXT->error_buffer; } else - CONTEXT->regparm = _STP_REGPARM | (int) n; + CONTEXT->regparm = _STP_REGPARM | (int) THIS->n; %} + +function syscall_nr:long() { + return _stp_register("orig_ax", 1) +} |