[DTrace-devel] [PATCH] test: ensure bpflogsize tests can handle large logs

Eugene Loh eugene.loh at oracle.com
Mon Oct 9 22:30:31 UTC 2023


I'm afraid I don't get this one.  The patch can make a difference only 
if tmp.out is over 100 lines long.  But in that case, it surely cannot 
match D.out.  So...?

On 9/25/23 10:13, Kris Van Hees via DTrace-devel wrote:
> With recent kernel versions, the output from the BPF log can be too
> much for the test to handle in reasonable time, and the test fails
> with a timeout.  Since the test is only looking for data to match
> near the end of the log, use tail to focus on just that.
>
> diff --git a/test/unittest/options/tst.bpflogsize-cmdline.sh b/test/unittest/options/tst.bpflogsize-cmdline.sh
> @@ -76,7 +76,7 @@ while [ $cursiz -lt $((1024 * 1024 * 1024)) ]; do
>   	# Usually (at least in the default case),
>   	# dtrace should fail because the BPF log size is too small.
>   	# Output should match D.out.
> -	if [ `sed s/$cursiz/nnnn/ tmp.out | diff - D.out | wc -l` -eq 0 ]; then
> +	if [ `tail -100 tmp.out | sed s/$cursiz/nnnn/ | diff - D.out | wc -l` -eq 0 ]; then
>   		echo okay: $cursiz is too small
> diff --git a/test/unittest/options/tst.bpflogsize-pragma.sh b/test/unittest/options/tst.bpflogsize-pragma.sh
> @@ -76,7 +76,7 @@ while [ $cursiz -lt $((1024 * 1024 * 1024)) ]; do
>   	# Usually (at least in the default case),
>   	# dtrace should fail because the BPF log size is too small.
>   	# Output should match D.out.
> -	if [ `sed s/$cursiz/nnnn/ tmp.out | diff - D.out | wc -l` -eq 0 ]; then
> +	if [ `tail -100 tmp.out | sed s/$cursiz/nnnn/ | diff - D.out | wc -l` -eq 0 ]; then
>   		echo okay: $cursiz is too small



More information about the DTrace-devel mailing list