Bug 13454 - nd_syscall tapset needs to handle sys_pipe2 and pipe0/pipe1
Summary: nd_syscall tapset needs to handle sys_pipe2 and pipe0/pipe1
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: tapsets (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on: 11424
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-29 19:23 UTC by Mark Wielaard
Modified: 2012-07-24 13:16 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2011-11-29 19:23:13 UTC
tapset/nd_syscalls2.stp has:

# FIXME: needs to handle sys_pipe2
# FIXME: needs to support pipe0/pipe1
Comment 1 David Smith 2011-11-30 18:38:48 UTC
From syscalls2.stp:

----
# pipe _______________________________________________________                  
#                                                                               
# asmlinkage int                                                                
# sys_pipe(unsigned long __user * fildes)                                       
#                                                                               
# SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)                      
# pipe2() was added to Linux in version 2.6.27.                                 
probe syscall.pipe = kernel.function("sys_pipe2").call !,                       
                     kernel.function("sys_ia64_pipe").call ?,                   
                     kernel.function("sys_pipe").call                           
----

The reason why it is done this way is that in the kernel
sys_pipe is just a wrapper around sys_pipe2.  This way we
ignore the sys_pipe call, and only catch the sys_pipe2 call on
kernels with sys_pipe2.

Unfortunately, as bug #11424 notes, '!' (optional and sufficient) doesn't work
for kprobe.function probes.  So, the above logic will be difficult to duplicate
in tapset/nd_syscalls2.stp.
Comment 2 David Smith 2012-07-24 13:16:19 UTC
Now that bug #11424 and bug #14378 are fixed, this bug can be addressed.

Fixed in commit b1047bc.