projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
10b1b3f
)
selftests/bpf: ensure we always have non-ambiguous sorting in veristat
author
Andrii Nakryiko
<andrii@kernel.org>
Thu, 3 Nov 2022 05:52:58 +0000
(22:52 -0700)
committer
Alexei Starovoitov
<ast@kernel.org>
Fri, 4 Nov 2022 04:54:13 +0000
(21:54 -0700)
Always fall back to unique file/prog comparison if user's custom order
specs are ambiguous. This ensures stable output no matter what.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link:
https://lore.kernel.org/r/20221103055304.2904589-5-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/veristat.c
patch
|
blob
|
history
diff --git
a/tools/testing/selftests/bpf/veristat.c
b/tools/testing/selftests/bpf/veristat.c
index f6f6a24904896a731064237dc98ba9d2c326d897..0da3ecf6ed5250fe9142f74747aae33cbf8dd2d4 100644
(file)
--- a/
tools/testing/selftests/bpf/veristat.c
+++ b/
tools/testing/selftests/bpf/veristat.c
@@
-723,7
+723,11
@@
static int cmp_prog_stats(const void *v1, const void *v2)
return cmp;
}
- return 0;
+ /* always disambiguate with file+prog, which are unique */
+ cmp = strcmp(s1->file_name, s2->file_name);
+ if (cmp != 0)
+ return cmp;
+ return strcmp(s1->prog_name, s2->prog_name);
}
#define HEADER_CHAR '-'