public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Generic test suite failures found with ARM testing
@ 2007-06-13 21:07 Quentin Barnes
  2007-06-14 14:11 ` David Smith
  0 siblings, 1 reply; 4+ messages in thread
From: Quentin Barnes @ 2007-06-13 21:07 UTC (permalink / raw)
  To: systemtap

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

For example, with syscalls2.exp the output just keeps being appended to
losing the newlines so less than expected 100 lines show up:
	5056 kernel.function("sys_oabi_socketcall@/proj/cost/work/qbarnes/kprobes/work/usr/src/linux-2.6.21.4/arch/arm/kernel/sys_oabi-5056 kernel.function("sys_oabi_sendto@/proj/cost/work/qbarnes/kprobes/work/usr/src/linux-2.6.21.4/arch/arm/kernel/sys_oabi-comp5056 kernel.function("sys_sendto@/proj/cost/work/qbarnes/kprobes/work/usr/src/linux-2.6.21.4/net/socket.c:1538").call^M


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.
  2) Up the max string length parameter MAXSTRINGLEN to be more robust.
  3) Modify these tests not to output the path with the function name.
  4) Something I didn't think of.

What would be the preferred solution here?

Quentin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Generic test suite failures found with ARM testing
  2007-06-13 21:07 Generic test suite failures found with ARM testing Quentin Barnes
@ 2007-06-14 14:11 ` David Smith
  2007-06-14 14:42   ` Martin Hunt
  0 siblings, 1 reply; 4+ messages in thread
From: David Smith @ 2007-06-14 14:11 UTC (permalink / raw)
  To: Quentin Barnes; +Cc: systemtap

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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Generic test suite failures found with ARM testing
  2007-06-14 14:11 ` David Smith
@ 2007-06-14 14:42   ` Martin Hunt
  2007-06-14 16:40     ` Quentin Barnes
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Hunt @ 2007-06-14 14:42 UTC (permalink / raw)
  To: David Smith; +Cc: Quentin Barnes, systemtap

On Thu, 2007-06-14 at 09:11 -0500, David Smith wrote:
> 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.  

I've seen this before. It happens if you use "make O=output/dir" to
build your kernel.


> 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
>     }
>   }
> 

I think removing all uses of the dot concatenation operator would be a
good idea. Maybe keep a specific testcase around for backwards
compatibility.

Martin



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Generic test suite failures found with ARM testing
  2007-06-14 14:42   ` Martin Hunt
@ 2007-06-14 16:40     ` Quentin Barnes
  0 siblings, 0 replies; 4+ messages in thread
From: Quentin Barnes @ 2007-06-14 16:40 UTC (permalink / raw)
  To: Martin Hunt; +Cc: David Smith, systemtap

On Thu, Jun 14, 2007 at 10:42:27AM -0400, Martin Hunt wrote:
>On Thu, 2007-06-14 at 09:11 -0500, David Smith wrote:
>> 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.  

Somebody doing something previously untried is often a good source of
new bugs.  :-)

>I've seen this before. It happens if you use "make O=output/dir" to
>build your kernel.

Ah, ha!

In the log, sometimes I was getting "short" names and sometimes I
was getting "long" names.  I never figured out why.  That's the
missing piece.  Most of the time I build with O=... giving me the
long names, but sometimes I would build in place giving me the short
names.

>> 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
>>     }
>>   }

It worked!

>I think removing all uses of the dot concatenation operator would be a
>good idea. Maybe keep a specific testcase around for backwards
>compatibility.

Probably...

>Martin

Quentin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-14 16:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-13 21:07 Generic test suite failures found with ARM testing Quentin Barnes
2007-06-14 14:11 ` David Smith
2007-06-14 14:42   ` Martin Hunt
2007-06-14 16:40     ` Quentin Barnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).