summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf
diff options
context:
space:
mode:
authorMahe Tardy <mahe.tardy@gmail.com>2024-12-20 18:22:18 +0300
committerAlexei Starovoitov <ast@kernel.org>2024-12-31 01:54:20 +0300
commit9468f39ba478d001f2603ce5bf0e1ab4b97452b8 (patch)
tree4c8d3f2970a12b86aefaed2e9d8c14bf0a3e2dad /tools/testing/selftests/bpf
parent4a24035964b706f5937d3128dcd9677b170b766f (diff)
downloadlinux-9468f39ba478d001f2603ce5bf0e1ab4b97452b8.tar.xz
selftests/bpf: fix veristat comp mode with new stats
Commit 82c1f13de315 ("selftests/bpf: Add more stats into veristat") introduced new stats, added by default in the CSV output, that were not added to parse_stat_value, used in parse_stats_csv which is used in comparison mode. Thus it broke comparison mode altogether making it fail with "Unrecognized stat #7" and EINVAL. One quirk is that PROG_TYPE and ATTACH_TYPE have been transformed to strings using libbpf_bpf_prog_type_str and libbpf_bpf_attach_type_str respectively. Since we might not want to compare those string values, we just skip the parsing in this patch. We might want to translate it back to the enum value or compare the string value directly. Fixes: 82c1f13de315 ("selftests/bpf: Add more stats into veristat") Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com> Tested-by: Mykyta Yatsenko<yatsenko@meta.com> Link: https://lore.kernel.org/r/20241220152218.28405-1-mahe.tardy@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf')
-rw-r--r--tools/testing/selftests/bpf/veristat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c
index 9d17b4dfc170..476bf95cf684 100644
--- a/tools/testing/selftests/bpf/veristat.c
+++ b/tools/testing/selftests/bpf/veristat.c
@@ -1672,7 +1672,10 @@ static int parse_stat_value(const char *str, enum stat_id id, struct verif_stats
case TOTAL_STATES:
case PEAK_STATES:
case MAX_STATES_PER_INSN:
- case MARK_READ_MAX_LEN: {
+ case MARK_READ_MAX_LEN:
+ case SIZE:
+ case JITED_SIZE:
+ case STACK: {
long val;
int err, n;
@@ -1685,6 +1688,9 @@ static int parse_stat_value(const char *str, enum stat_id id, struct verif_stats
st->stats[id] = val;
break;
}
+ case PROG_TYPE:
+ case ATTACH_TYPE:
+ break;
default:
fprintf(stderr, "Unrecognized stat #%d\n", id);
return -EINVAL;