RFR: 7903740: JMH: Perf event validation not working with skid options [v4]
Aleksey Shipilev
shade at openjdk.org
Thu Aug 22 12:56:17 UTC 2024
On Thu, 22 Aug 2024 12:53:25 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Also, you could have the situation that you pass in multiple events and a subset is only supported. To validate that you have to process the `perf record` output and see if there are events for all of them, otherwise fail.
>
> Well, I would have expected we parsed `perf record` error and error code directly?
>
>
> % perf record -e blah echo 1
> event syntax error: 'blah'
> ___ parser error
> Run 'perf list' for a list of valid events
>
> Usage: perf record [<options>] [<command>]
> or: perf record [<options>] -- <command> [<options>]
>
> -e, --event <event> event selector. use 'perf list' to list available events
>
> % echo $?
> 129
>
> % perf record -e cycles:p echo 1
> Error:
> cycles:p: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'
>
> % echo $?
> 255
>
> % perf record -e cycles echo 1
> 1
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.013 MB perf.data (16 samples) ]
>
> % echo $?
> 0
>
>
> Yes, I understand it actually does not test whether the counters _report_ non-zero values, but that's okay. We only do a light-weight validation that `perf record` even accepts these.
Failing hard when some events cannot be supported is also proper, I'd think. So there is no need to verify them one by one. Keep it as simple as possible?
-------------
PR Review Comment: https://git.openjdk.org/jmh/pull/132#discussion_r1727002459
More information about the jmh-dev
mailing list