From: Martin Cermak Date: Thu, 22 Dec 2016 13:12:06 +0000 (+0100) Subject: PR20333/bdflush X-Git-Tag: release-3.1~514 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=527cf6a789ceab264fe3e8790ec0c1efc41113e3;p=systemtap.git PR20333/bdflush --- diff --git a/tapset/linux/nd_syscalls.stp b/tapset/linux/nd_syscalls.stp index 12c58da1e..9e171c251 100644 --- a/tapset/linux/nd_syscalls.stp +++ b/tapset/linux/nd_syscalls.stp @@ -1,24 +1,4 @@ -# bdflush ____________________________________________________ -# long sys_bdflush(int func, long data) -probe nd_syscall.bdflush = kprobe.function("sys_bdflush") ? -{ - name = "bdflush" - asmlinkage() - func = int_arg(1) - data = long_arg(2) - if ((func >= 2) && (func % 2 == 0)) - data_str = sprintf("%p", data) - else - data_str = sprintf("%d", data) - argstr = sprintf("%d, %s", func, data_str) -} -probe nd_syscall.bdflush.return = kprobe.function("sys_bdflush").return ? -{ - name = "bdflush" - retstr = returnstr(1) -} - # bind _______________________________________________________ # long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen) probe nd_syscall.bind = __nd_syscall.bind ?, __nd_syscall.socketcall.bind ?, diff --git a/tapset/linux/sysc_bdflush.stp b/tapset/linux/sysc_bdflush.stp new file mode 100644 index 000000000..bed156693 --- /dev/null +++ b/tapset/linux/sysc_bdflush.stp @@ -0,0 +1,54 @@ +# bdflush ____________________________________________________ +# long sys_bdflush(int func, long data) + +@define _SYSCALL_BDFLUSH_NAME +%( + name = "bdflush" +%) + +@define _SYSCALL_BDFLUSH_ARGSTR +%( + argstr = sprintf("%d, %s", func, data_str) +%) + +probe syscall.bdflush = dw_syscall.bdflush !, nd_syscall.bdflush {} +probe syscall.bdflush.return = dw_syscall.bdflush.return !, nd_syscall.bdflush.return {} + +# dw_bdflush _____________________________________________________ + +probe dw_syscall.bdflush = kernel.function("sys_bdflush").call ? +{ + @_SYSCALL_BDFLUSH_NAME + func = $func + data = $data + if (($func >= 2) && ($func % 2 == 0)) + data_str = sprintf("%p", $data) + else + data_str = sprintf("%d", $data) + @_SYSCALL_BDFLUSH_ARGSTR +} +probe dw_syscall.bdflush.return = kernel.function("sys_bdflush").return ? +{ + @_SYSCALL_BDFLUSH_NAME + retstr = return_str(1, $return) +} + +# nd_bdflush _____________________________________________________ + +probe nd_syscall.bdflush = kprobe.function("sys_bdflush") ? +{ + @_SYSCALL_BDFLUSH_NAME + asmlinkage() + func = int_arg(1) + data = long_arg(2) + if ((func >= 2) && (func % 2 == 0)) + data_str = sprintf("%p", data) + else + data_str = sprintf("%d", data) + @_SYSCALL_BDFLUSH_ARGSTR +} +probe nd_syscall.bdflush.return = kprobe.function("sys_bdflush").return ? +{ + @_SYSCALL_BDFLUSH_NAME + retstr = returnstr(1) +} diff --git a/tapset/linux/syscalls.stp b/tapset/linux/syscalls.stp index fab6baece..a6680d39a 100644 --- a/tapset/linux/syscalls.stp +++ b/tapset/linux/syscalls.stp @@ -1,23 +1,4 @@ -# bdflush ____________________________________________________ -# long sys_bdflush(int func, long data) -probe syscall.bdflush = kernel.function("sys_bdflush").call ? -{ - name = "bdflush" - func = $func - data = $data - if (($func >= 2) && ($func % 2 == 0)) - data_str = sprintf("%p", $data) - else - data_str = sprintf("%d", $data) - argstr = sprintf("%d, %s", func, data_str) -} -probe syscall.bdflush.return = kernel.function("sys_bdflush").return ? -{ - name = "bdflush" - retstr = return_str(1, $return) -} - # bind _______________________________________________________ # long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen) probe syscall.bind = __syscall.bind ?, __syscall.socketcall.bind ?,