This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM port of testsuite and general testsuite fixes


I finished analyzing the six remaining syscalls test failures that
I had: acct, forkwait, mmap, net1, openclose, and stat.

I fixed "acct" by setting CONFIG_BSD_PROCESS_ACCT=y in my kernel's
.config file.

Two others I've fixed too, "net1" and "stat".  They needed changes
to tapset's syscall*.stp files.  Patch below.  ARM has old ABI
functions that wrapper and convert the older calls to the new
calls.  Normally the sys_oabi_* routines call their equivalent sys_*
routines so most all work.  However, this isn't true for the OABI
stat calls which call vfs_* versions directly.  I added those.  I
also made a couple of gratuitous changes to "send" and "sendfile".
A reviewer should feel free to reject them if they don't think
they're right.

However, the remaining three tests still fail for me.

The "forkwait" test fails simply because the test's output is
returning "fork" when the script is expecting "clone".  I've looked
at the test code, the tapset code, and the kernel code.  As far as
I can tell, "fork" is the right answer for the test as written.
The function "do_fork" is called with SIGCHLD (17) as the first
parameter.  This should decode by tapset/syscalls.stp as "fork", not
"clone" and that's what's happening.  The forkwait.c test I feel is
broken and should be expecting "fork".  Why isn't this test failing
for other platforms?  Am I misunderstanding the code or is it some
other difference?

The "mmap" test fails because the test can't put a kprobe on
"sys_mmap2".  On ARM, this is an assembly function that does not
have any DWARF information.  What's the best way to deal with this?
I suppose I could add the DWARF information for the function in its
assembly file.  Is this considered the best solution?  A possibility
without changing kernel code is to use "do_mmap2" instead of
"sys_mmap2".  Would that be preferred?  (If I follow how things
work, the latter would get messy because not everyone has do_mmap2
and leaving sys_mmap2 hook would then cause double outputs for
systems with both.)

The "openclose" test fails because the test
"open ("foobar2", O_RDWR|O_DIRECT) = -22 (EINVAL)" fails.  My guess
is that this test fails because I'm running on an NFS file system
and O_DIRECT must be forbidden for that file system type.  Would
that make sense?  If so, what's the best way to fix this test?
Remove this test case line that expects O_DIRECT to always work?

Quentin







Index: systemtap-20070602/tapset/syscalls.stp
===================================================================
--- systemtap-20070602/tapset/syscalls.stp	(.../vendor/usr/src)	(revision 218)
+++ systemtap-20070602/tapset/syscalls.stp	(.../branches/kprobes/usr/src)	(revision 218)
@@ -642,7 +642,11 @@ probe syscall.fchown16.return = kernel.f

# fcntl ______________________________________________________
# long sys_fcntl(int fd, unsigned int cmd, unsigned long arg)
-probe syscall.fcntl = kernel.function("sys_fcntl") {
+# long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
+probe syscall.fcntl = + kernel.function("sys_fcntl") ?,
+ kernel.function("sys_fcntl64") ?
+{
name = "fcntl"
fd = $fd
cmd = $cmd
@@ -650,7 +654,10 @@ probe syscall.fcntl = kernel.function("s
arg = $arg
argstr = sprintf("%d, %s, %p", $fd, cmd_str, $arg)
}
-probe syscall.fcntl.return = kernel.function("sys_fcntl").return {
+probe syscall.fcntl.return = + kernel.function("sys_fcntl").return ?,
+ kernel.function("sys_fcntl64").return ?
+{
name = "fcntl"
retstr = returnstr(1)
}
@@ -783,6 +790,8 @@ probe syscall.fsetxattr.return = kernel.
# long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf)
# long sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf)
# long sys_newfstat(unsigned int fd, struct stat __user * statbuf)
+# long sys_oabi_fstat64(char __user * filename,
+# struct oldabi_stat64 __user * statbuf)
# long compat_sys_newfstat(unsigned int fd, struct compat_stat __user * statbuf)
#
probe syscall.fstat = @@ -790,7 +799,8 @@ probe syscall.fstat = kernel.function("sys_fstat64") ?,
kernel.function("sys32_fstat64") ?,
kernel.function("sys_newfstat") ?,
- kernel.function("compat_sys_newfstat") ? + kernel.function("sys_oabi_fstat64") ?,
+ kernel.function("compat_sys_newfstat") ?
{
name = "fstat"
filedes = $fd
@@ -802,6 +812,7 @@ probe syscall.fstat.return = kernel.function("sys_fstat64").return ?,
kernel.function("sys32_fstat64").return ?,
kernel.function("sys_newfstat").return ?,
+ kernel.function("sys_oabi_fstat64").return ?,
kernel.function("compat_sys_newfstat").return ?
{
name = "fstat"
@@ -1806,13 +1817,16 @@ probe syscall.lsetxattr.return = kernel.
# long compat_sys_newlstat(char __user * filename, struct compat_stat __user *statbuf)
# long sys32_lstat64(char * filename, struct stat64 __user *statbuf)
# long sys_lstat64(char __user * filename, struct stat64 __user * statbuf)
+# long sys_oabi_lstat64(char __user * filename,
+# struct oldabi_stat64 __user * statbuf)
#
probe syscall.lstat = kernel.function("sys_lstat") ?,
kernel.function("sys_newlstat") ?,
kernel.function("compat_sys_newlstat") ?,
kernel.function("sys32_lstat64") ?,
- kernel.function("sys_lstat64") ?
+ kernel.function("sys_lstat64") ?,
+ kernel.function("sys_oabi_lstat64") ?
{
name = "lstat"
path = user_string($filename)
@@ -1824,7 +1838,8 @@ probe syscall.lstat.return = kernel.function("sys_newlstat").return ?,
kernel.function("compat_sys_newlstat").return ?,
kernel.function("sys32_lstat64").return ?,
- kernel.function("sys_lstat64").return ?
+ kernel.function("sys_lstat64").return ?,
+ kernel.function("sys_oabi_lstat64").return ?
{ name = "lstat"
retstr = returnstr(1)
Index: systemtap-20070602/tapset/syscalls2.stp
===================================================================
--- systemtap-20070602/tapset/syscalls2.stp (.../vendor/usr/src) (revision 218)
+++ systemtap-20070602/tapset/syscalls2.stp (.../branches/kprobes/usr/src) (revision 218)
@@ -1036,12 +1036,10 @@ probe syscall.semtimedop.return = kernel
# send _______________________________________________________
#
# asmlinkage long
-# sys_sendto(int fd,
+# sys_send(int fd,
# void __user * buff,
# size_t len,
-# unsigned flags,
-# struct sockaddr __user *addr,
-# int addr_len)
+# unsigned flags)
#
probe syscall.send = kernel.function("sys_sendto") {
name = "send"
@@ -1050,10 +1048,7 @@ probe syscall.send = kernel.function("sy
len = $len
flags = $flags
flags_str = _send_flags_str($flags)
- to_uaddr = $addr
- tolen = $addr_len
- argstr = sprintf("%d, %p, %s, %p, %d", $fd, buf_uaddr,
- flags_str, to_uaddr, $addr_len)
+ argstr = sprintf("%d, %p, %s", $fd, buf_uaddr, flags_str)
}
probe syscall.send.return = kernel.function("sys_sendto").return {
name = "send"
@@ -1066,7 +1061,10 @@ probe syscall.send.return = kernel.funct
# off_t __user *offset,
# size_t count)
#
-probe syscall.sendfile = kernel.function("sys_sendfile") ?, kernel.function("sys_sendfile64") ? {
+probe syscall.sendfile =
+ kernel.function("sys_sendfile") ?,
+ kernel.function("sys_sendfile64") ?
+{
name = "sendfile"
out_fd = $out_fd
in_fd = $in_fd
@@ -1075,7 +1073,10 @@ probe syscall.sendfile = kernel.function
argstr = sprintf("%d, %d, %p, %d", $out_fd, $in_fd, offset_uaddr,
$count)
}
-probe syscall.sendfile.return = kernel.function("sys_sendfile").return ?, kernel.function("sys_sendfile64").return ? {
+probe syscall.sendfile.return =
+ kernel.function("sys_sendfile").return ?,
+ kernel.function("sys_sendfile64").return ?
+{
name = "sendfile"
retstr = returnstr(1)
}
@@ -1838,12 +1839,14 @@ probe syscall.ssetmask.return = kernel.f
# long sys_stat(char __user * filename, struct __old_stat __user * statbuf)
# long sys32_stat64(char __user * filename, struct stat64 __user *statbuf)
# long sys_stat64(char __user * filename, struct stat64 __user * statbuf)
+# long sys_oabi_stat64(char __user * filename, struct oldabi_stat64 __user * statbuf)
# long compat_sys_newstat(char __user * filename, struct compat_stat __user *statbuf)
probe syscall.stat = kernel.function("sys_stat") ?, kernel.function("sys_newstat") ?,
kernel.function("sys32_stat64") ?,
kernel.function("sys_stat64") ?,
+ kernel.function("sys_oabi_stat64") ?,
kernel.function("compat_sys_newstat") ?
{
name = "stat"
@@ -1857,6 +1860,7 @@ probe syscall.stat.return = kernel.function("sys_newstat").return ?,
kernel.function("sys32_stat64").return ?,
kernel.function("sys_stat64").return ?,
+ kernel.function("sys_oabi_stat64").return ?,
kernel.function("compat_sys_newstat").return ? {
name = "stat"



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]