]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: make veristat's verifier log parsing faster and more robust
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 23 Sep 2022 17:59:10 +0000 (10:59 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 24 Sep 2022 01:14:44 +0000 (18:14 -0700)
commit4bee6ed3939261622a93523998aa3acfd6e3bb28
treeb283bf1f81dbc1621f4c10349f4f31fa9ac0b4b1
parent8d9fb2266c6290977aa1a20090c3acabbf7ab285
selftests/bpf: make veristat's verifier log parsing faster and more robust

Make sure veristat doesn't spend ridiculous amount of time parsing
verifier stats from verifier log, especially for very large logs or
truncated logs (e.g., when verifier returns -ENOSPC due to too small
buffer). For this, parse lines from the end of the log and make sure we
parse only up to 100 last lines, where stats should be, if at all.

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