selftests/bpf: avoid reporting +100% difference in veristat for actual 0%
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 5 Oct 2022 16:14:49 +0000 (09:14 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 5 Oct 2022 23:55:11 +0000 (16:55 -0700)
commit6df2eb45e378f38ca42776276e7bb5b5078c12cf
tree3c04a3c7e55fd98857faae8eaffcf55ded9633fc
parent2a72f5951ac6d613216a93ae3e172cabb04aaefc
selftests/bpf: avoid reporting +100% difference in veristat for actual 0%

In special case when both base and comparison values are 0, veristat
currently reports "+0 (+100%)" difference, which is quite confusing. Fix
it up to be "+0 (+0%)".

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