Bug 17714 - poll.c syscall testcase
Summary: poll.c syscall testcase
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:
Blocks:
 
Reported: 2014-12-15 11:43 UTC by Martin Cermak
Modified: 2015-01-12 16:49 UTC (History)
0 users

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


Attachments
proposed patch (956 bytes, patch)
2014-12-15 11:43 UTC, Martin Cermak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Cermak 2014-12-15 11:43:59 UTC
Created attachment 8015 [details]
proposed patch

Two issues wrt. syscall.epoll_pwait and related testcase:


1) in the syscalls.stp tapset, $events and $sigmask pointers from syscall.epoll_pwait have wrong values on s390 31-on-64. Following update fixes the issue for me and seems to test fine "everywhere".

=======
--- a/tapset/linux/syscalls.stp
+++ b/tapset/linux/syscalls.stp
@@ -857,14 +857,14 @@ probe syscall.epoll_pwait = kernel.function("compat_sys_epoll_pwait").call ?,
 {
        name = "epoll_pwait"
        epfd = __int32($epfd)
-       events_uaddr = $events
+       events_uaddr = @__pointer($events)
        maxevents = __int32($maxevents)
        timeout = __int32($timeout)
-       sigmask_uaddr = $sigmask
+       sigmask_uaddr = @__pointer($sigmask)
        sigsetsize = $sigsetsize
        argstr = sprintf("%d, %p, %d, %d, %p, %d",
-                        __int32($epfd), $events, __int32($maxevents),
-                        __int32($timeout), $sigmask, $sigsetsize)
+                        __int32($epfd), events_uaddr, __int32($maxevents),
+                        __int32($timeout), sigmask_uaddr, $sigsetsize)
 }
=======



2) Second problem is that on el5 x86_64, epoll_pwait() is not available, but SYS_epoll_pwait is defined. This is unlike other el5 arches, where SYS_epoll_pwait is not defined. This causes link time error and skipping the test on the platform in question. Using following wrapper works the issue around for me and seems to test fine "everywhere":

=======
#ifdef SYS_epoll_pwait                                                          
int __epoll_pwait(int epfd, struct epoll_event *events,                         
                  int maxevents, int timeout,                                   
                  const sigset_t *set)                                          
{                                                                               
    return syscall(__NR_epoll_pwait, epfd, events, maxevents, timeout,          
                   set, _NSIG / 8);                                             
}                                                                               
#endif
=======

Related testcases are then being updated like this:

=======
#ifdef SYS_epoll_pwait                                                          
  __epoll_pwait(fd, events, 17, 0, NULL);                                       
  //staptest// [[[[epoll_pwait (NNNN, XXXX, 17, 0, 0x0, NNNN) = 0!!!!ni_syscall () = -38 (ENOSYS)]]]]
                                                                                
  __epoll_pwait(fd, events, 17, 0, &sigs);                                      
  //staptest// [[[[epoll_pwait (NNNN, XXXX, 17, 0, XXXX, NNNN) = 0!!!!ni_syscall () = -38 (ENOSYS)]]]]

... stuff deleted ...

#endif
=======
Comment 1 Martin Cermak 2015-01-12 16:49:28 UTC
Fixed in commit 7e3ccdc5978b081c71bb568013d87d654bbe4dee