From: David Smith Date: Fri, 20 Jul 2012 19:46:42 +0000 (-0500) Subject: Fixed PR13451 by updating eventfd support in nd_syscalls.stp. X-Git-Tag: release-2.0~277 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=f6f8f0ec7363e99c5266d5e8ef1820acb1d35c6d;p=systemtap.git Fixed PR13451 by updating eventfd support in nd_syscalls.stp. * tapset/nd_syscalls.stp: Updated nd_syscall.eventfd probe aliase to handle sys_eventfd2(). * testsuite/systemtap.syscall/nd_syscall.exp (syscall_kfails): Removed eventfd kfail. --- diff --git a/tapset/nd_syscalls.stp b/tapset/nd_syscalls.stp index 9c1199597..7977b4383 100644 --- a/tapset/nd_syscalls.stp +++ b/tapset/nd_syscalls.stp @@ -914,9 +914,25 @@ probe nd_syscall.epoll_wait.return = kprobe.function("compat_sys_epoll_wait").re # eventfd _____________________________________________________ # long sys_eventfd(unsigned int count) -# -# FIXME: doesn't handle sys_eventfd2() -probe nd_syscall.eventfd = kprobe.function("sys_eventfd") ? +# SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) +probe nd_syscall.eventfd = __nd_syscall.eventfd2 !, + __nd_syscall.eventfd ? +{ +} +probe __nd_syscall.eventfd2 = kprobe.function("sys_eventfd2") +{ + asmlinkage() + flags = int_arg(2) + if (flags == 0) { + name = "eventfd" + argstr = sprint(uint_arg(1)) + } else { + name = "eventfd2" + argstr = sprintf("%d, %s", uint_arg(1), + _eventfd2_flag_str(flags)) + } +} +probe __nd_syscall.eventfd = kprobe.function("sys_eventfd") { name = "eventfd" // argstr = sprint($count) @@ -924,8 +940,19 @@ probe nd_syscall.eventfd = kprobe.function("sys_eventfd") ? flags = 0 argstr = sprint(uint_arg(1)) } -probe nd_syscall.eventfd.return = kprobe.function("sys_eventfd").return ? +probe nd_syscall.eventfd.return = __nd_syscall.eventfd2.return !, + __nd_syscall.eventfd.return ? +{ +} +probe __nd_syscall.eventfd2.return = kprobe.function("sys_eventfd2").return { + flags = @entry(__asmlinkage_int_arg(2)) + name = flags == 0 ? "eventfd" : "eventfd2" + retstr = returnstr(1) +} +probe __nd_syscall.eventfd.return = kprobe.function("sys_eventfd").return +{ + flags = 0 name = "eventfd" retstr = returnstr(1) } diff --git a/testsuite/systemtap.syscall/nd_syscall.exp b/testsuite/systemtap.syscall/nd_syscall.exp index 8ef803bba..e566d511e 100644 --- a/testsuite/systemtap.syscall/nd_syscall.exp +++ b/testsuite/systemtap.syscall/nd_syscall.exp @@ -3,7 +3,6 @@ source $srcdir/$subdir/test.tcl proc syscall_kfails {NAME} { switch $NAME { - "eventfd" { return 13452 } "inotify" { return 13453 } "pipe" { return 13454 } "signalfd" { return 13455 }