Generic test suite failures found with ARM testing

David Smith dsmith@redhat.com
Thu Jun 14 14:11:00 GMT 2007


Quentin Barnes wrote:
> I've run across two test failures on ARM that are not ARM-specific.  They
> are with systemtap.samples/profile.exp and systemtap.samples/syscalls2.exp.
> These tests fail for me because of the 128 character limit on strings.
> 
> For example, with profile.exp the output being looked for is truncated:
>     staprun(4619) 
> kernel.function("sys_poll@/proj/cost/work/qbarnes/kprobes/work/usr/src/linux-2.6.21.4/fs/select.c:742").call 
> coun^M

The reason why we haven't noticed this problem is that you are evidently 
compiling your kernel differently than we are.  Here's what you'll see 
on any fedora/rhel kernel:

staprun(24243) kernel.function("sys_poll@fs/select.c:742").call 
count=500 ttime=4980951

Evidently something in the rpmbuild process produces shorter source paths.

> What's the best fix here?  I see a few choices:
> 
>  1) Don't build your kernel deeper than a few levels of directories
>     and expect the tests to work.

This one is what is accidentally working for us.

>  2) Up the max string length parameter MAXSTRINGLEN to be more robust.

We could do this for a particular test, but I don't think we would want 
to do it in general - it would eat up too much memory.

>  3) Modify these tests not to output the path with the function name.
>  4) Something I didn't think of.

I believe the following patch will fix the problem by removing the 
strcats.  If this works for you I'll check it in.

diff -u -p -r1.2 profile.stp
--- testsuite/systemtap.samples/profile.stp     2 Apr 2007 20:30:30 
-0000      1.2
+++ testsuite/systemtap.samples/profile.stp     14 Jun 2007 14:10:01 -0000
@@ -30,9 +30,9 @@ probe timer.ms(5000) {
  }
  probe end {
    foreach ([pid,syscall] in syscall_count-) {
-    log (command[pid] . "(" . sprint(pid) . ") " . syscall .
-         " count=" . sprint(syscall_count[pid,syscall]) .
-         " ttime=" . sprint(syscall_times[pid,syscall]))
+    printf("%s(%d) %s count=%d ttime=%d\n", command[pid], pid, syscall,
+          syscall_count[pid,syscall], syscall_times[pid,syscall])
+
      if (count++ > 30) next
    }
  }

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)



More information about the Systemtap mailing list