Re: [PATCH v2 0/5] perf test trace: Reduce test failures and make error messages verbose

From: Ian Rogers
Date: Mon May 19 2025 - 15:59:03 EST


On Mon, May 19, 2025 at 12:28 PM Howard Chu <howardchu95@xxxxxxxxx> wrote:
>
> Hello Ian,
>
> On Mon, May 19, 2025 at 10:00 AM Ian Rogers <irogers@xxxxxxxxxx> wrote:
> >
>
> <SNIP>
>
> > ```
> > --- start ---
> > test child forked, pid 279547
> > Checking if vmlinux BTF exists
> > Testing perf trace's string augmentation
> > Testing perf trace's buffer augmentation
> > Testing perf trace's struct augmentation
> > BTF struct augmentation test failed, output:
> > sleep/279619 clock_nanosleep(0, 0, {1,1,}, 0x7ffcd47b6450) = 0
>
> Thank you so much for testing it :)
>
> My bad, I have just realized this is because of the data in the
> timespec, nothing to do with libbpf... The tv_nsec has a value of 1. I
> think the 'sleep' on your machine has a different implementation. On
> my machine, the second member has a value of 0, see below:
> ~~~
> $ sudo /tmp/perf/perf trace -e clock_nanosleep -- sleep 1
> 0.000 (1000.196 ms): sleep/54261 clock_nanosleep(rqtp: { .tv_sec:
> 1, .tv_nsec: 0 }, rmtp: 0x7ffe13529550) = 0
>
> $ strace -e clock_nanosleep -- sleep 1
> clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=1, tv_nsec=0}, 0x7fff859365a0) = 0
> +++ exited with 0 +++
> ~~~
>
> Can you please run any of the commands above and see what
> happens(please change the perf executable path)? If you get 'rqtp: {
> .tv_sec: 1, .tv_nsec: 1 }' then I will just make the regex less
> strict, because it differs between different 'sleep' implementations
> instead of having anything to do with perf itself.

Ack. Here is the output:
```
$ sudo /tmp/perf/perf trace -e clock_nanosleep -- sleep 1
0.000 (1000.208 ms): sleep/1710732 clock_nanosleep(rqtp: {
.tv_sec: 1, .tv_nsec: 1 }, rmtp: 0x7ffc091f4090) = 0
$ strace -e clock_nanosleep -- sleep 1
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=1, tv_nsec=1}, 0x7ffe51f3cd00) = 0
+++ exited with 0 +++
```

Thanks,
Ian

>
> Thanks,
> Howard