veristat: add ability to sort by stat's absolute value
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 8 Nov 2023 05:14:29 +0000 (21:14 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 10 Nov 2023 03:07:51 +0000 (19:07 -0800)
commit5d4a7aaca1ebcc7c864caec13203662a061c4f4f
tree6818494833c1355e4f2369373b0e8f9d4c53f2cc
parent7f7c43693c1b46652cfafb7af67ba31726d6ec4e
veristat: add ability to sort by stat's absolute value

Add ability to sort results by absolute values of specified stats. This
is especially useful to find biggest deviations in comparison mode. When
comparing verifier change effect against a large base of BPF object
files, it's necessary to see big changes both in positive and negative
directions, as both might be a signal for regressions or bugs.

The syntax is natural, e.g., adding `-s '|insns_diff|'^` will instruct
veristat to sort by absolute value of instructions difference in
ascending order.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20231108051430.1830950-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/veristat.c