diff options
author | Mark Wielaard <mjw@redhat.com> | 2010-03-20 22:43:51 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2010-03-21 17:34:41 +0100 |
commit | c01a52256bfbd9a3d2873b2d48f7f94177d14641 (patch) | |
tree | 7767a9acc35a98e93f4d05fdd63db3d83ab3bbdf /tapset/aux_syscalls.stp | |
parent | 9d2d9895621fdfe5c73034039183fc2fc31a1495 (diff) | |
download | systemtap-steved-c01a52256bfbd9a3d2873b2d48f7f94177d14641.tar.gz systemtap-steved-c01a52256bfbd9a3d2873b2d48f7f94177d14641.tar.xz systemtap-steved-c01a52256bfbd9a3d2873b2d48f7f94177d14641.zip |
Add support for eventfd2 to syscall.stp tapset.
* tapset/aux_syscalls.stp (_eventfd2_flag_str): New utility function.
* tapset/syscalls.stp (syscall.eventfd[.return]): Add alternatives to
handle eventfd2.
* testsuite/systemtap.syscall/eventfd.c: New test.
Diffstat (limited to 'tapset/aux_syscalls.stp')
-rw-r--r-- | tapset/aux_syscalls.stp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index 15a70484..5377bafd 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -1645,6 +1645,29 @@ function _epoll_create1_flag_str:string(f:long) #endif %} +%{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +#include <linux/eventfd.h> +#endif +%} +function _eventfd2_flag_str:string(f:long) +%{ /* pure */ + long flags = THIS->f; + char *str = THIS->__retvalue; + int len; + +#if defined(EFD_CLOEXEC) && defined(EFD_NONBLOCK) + if (flags & EFD_NONBLOCK) + strlcat(str, "EFD_NONBLOCK|", MAXSTRINGLEN); + if (flags & EFD_CLOEXEC) + strlcat(str, "EFD_CLOEXEC|", MAXSTRINGLEN); +#endif + + len = strlen(str); + if (len) + str[strlen(str)-1] = 0; +%} + function _dup3_flag_str:string(f:long) %{ /* pure */ #ifdef O_CLOEXEC |