[DTrace-devel] [PATCH] test: Bump timeouts up for bpflogsize tests

Eugene Loh eugene.loh at oracle.com
Fri Mar 1 00:08:28 UTC 2024


The tests run a script that looks like this:

BEGIN
{
         x = 1;
         @ = quantize(x);
         @ = quantize(x);
         @ = quantize(x);
         [this "quantize" line appears a total of 2000 times]
         @ = quantize(x);
         @ = quantize(x);
         @ = quantize(x);
         exit(0);
}

That is, it's an intentionally large program.

In dt_bpf.c, we try loading some tiny test programs for have_helpers().  
They do not take much time.  But we also call dt_bpf_load_prog() to load 
the big BEGIN program... twice!  (The first time fails, so we call again 
but now with a log file enabled.)  On an OL8 x86 VM, I get about 0.05 
for the first dt_bpf_prog_load() call (no log file) and about 0.35 secs 
for the second dt_bpf_prog_load() call (with log file).  (As you 
probably know, bpf_load_prog() calls bpf_prog_load().  Confusing 
naming.) So, the test does not take much time.

On an OL9 x86 VM, however, each bpf_prog_load() call takes about 5 
seconds.  While it allows for retries, the long duration is not due to 
retries:  a single bpf(BPF_PROG_LOAD, ...) system call is taking that 
long, apparently due to the size of the program being loaded.  Smaller 
programs are much faster.

The test incurs this operation multiple times.  Add to that some other 
overheads, and soon you're bumping up against the timeout.

On 2/29/24 13:19, Kris Van Hees wrote:
> Do we have any idea why it is a timeout issue?  Perhaps you could try adding
> some timing info (just for debugging this) to see how long the bpf syscalls
> take, to see if it is a delay at the kernel side or elsewhere?
>
> On Wed, Feb 28, 2024 at 07:29:11PM -0500, eugene.loh--- via DTrace-devel wrote:
>> From: Eugene Loh <eugene.loh at oracle.com>
>>
>> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
>> ---
>>   test/unittest/options/tst.bpflogsize-cmdline.sh | 3 ++-
>>   test/unittest/options/tst.bpflogsize-pragma.sh  | 3 ++-
>>   2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/test/unittest/options/tst.bpflogsize-cmdline.sh b/test/unittest/options/tst.bpflogsize-cmdline.sh
>> index 2d85e12c..509f9d07 100755
>> --- a/test/unittest/options/tst.bpflogsize-cmdline.sh
>> +++ b/test/unittest/options/tst.bpflogsize-cmdline.sh
>> @@ -1,10 +1,11 @@
>>   #!/bin/bash
>>   #
>>   # Oracle Linux DTrace.
>> -# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
>> +# Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
>>   # Licensed under the Universal Permissive License v 1.0 as shown at
>>   # http://oss.oracle.com/licenses/upl.
>>   #
>> +# @@timeout: 100
>>   
>>   dtrace=$1
>>   
>> diff --git a/test/unittest/options/tst.bpflogsize-pragma.sh b/test/unittest/options/tst.bpflogsize-pragma.sh
>> index 5d03b5f7..3dea3dd4 100755
>> --- a/test/unittest/options/tst.bpflogsize-pragma.sh
>> +++ b/test/unittest/options/tst.bpflogsize-pragma.sh
>> @@ -1,10 +1,11 @@
>>   #!/bin/bash
>>   #
>>   # Oracle Linux DTrace.
>> -# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
>> +# Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
>>   # Licensed under the Universal Permissive License v 1.0 as shown at
>>   # http://oss.oracle.com/licenses/upl.
>>   #
>> +# @@timeout: 100
>>   
>>   dtrace=$1
>>   
>> -- 
>> 2.18.4
>>
>>
>> _______________________________________________
>> DTrace-devel mailing list
>> DTrace-devel at oss.oracle.com
>> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list