Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+17 -1
+17 -1
tools/testing/selftests/bpf/prog_tests/reg_bounds.c
··· 1217 1217 spec.compare_subregs ? "w0" : "r0", 1218 1218 spec.compare_subregs ? "w" : "r", specs[i].reg_idx); 1219 1219 1220 - q = strstr(p, buf); 1220 + /* 1221 + * In the verifier log look for lines: 1222 + * 18: (bf) r0 = r6 ; R0=... R6=... 1223 + * Different verifier passes may print 1224 + * 18: (bf) r0 = r6 1225 + * as well, but never followed by ';'. 1226 + */ 1227 + q = p; 1228 + while ((q = strstr(q, buf)) != NULL) { 1229 + const char *s = q + strlen(buf); 1230 + 1231 + while (*s == ' ' || *s == '\t') 1232 + s++; 1233 + if (*s == ';') 1234 + break; 1235 + q = s; 1236 + } 1221 1237 if (!q) { 1222 1238 *specs[i].state = (struct reg_state){.valid = false}; 1223 1239 continue;