mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 05:31:37 -04:00
selftests/bpf: Make reg_bounds test more robust
The verifier log output may contain multiple lines that start with 18: (bf) r0 = r6 teach reg_bounds to look for lines that have ';' in them, since reg_bounds test is looking for: 18: (bf) r0 = r6 ; R0=... R6=... Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com> Link: https://lore.kernel.org/r/20260325012242.45606-1-alexei.starovoitov@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
@@ -1217,7 +1217,23 @@ static int parse_range_cmp_log(const char *log_buf, struct case_spec spec,
|
||||
spec.compare_subregs ? "w0" : "r0",
|
||||
spec.compare_subregs ? "w" : "r", specs[i].reg_idx);
|
||||
|
||||
q = strstr(p, buf);
|
||||
/*
|
||||
* In the verifier log look for lines:
|
||||
* 18: (bf) r0 = r6 ; R0=... R6=...
|
||||
* Different verifier passes may print
|
||||
* 18: (bf) r0 = r6
|
||||
* as well, but never followed by ';'.
|
||||
*/
|
||||
q = p;
|
||||
while ((q = strstr(q, buf)) != NULL) {
|
||||
const char *s = q + strlen(buf);
|
||||
|
||||
while (*s == ' ' || *s == '\t')
|
||||
s++;
|
||||
if (*s == ';')
|
||||
break;
|
||||
q = s;
|
||||
}
|
||||
if (!q) {
|
||||
*specs[i].state = (struct reg_state){.valid = false};
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user