Skip to contentSkip to conversation

perf test bpf: Improve message about expected samples

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jan 11, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  6703c9771d83ebe092b0d49cb0609a3f9d8b4ff7
Gitweb:     https://git.kernel.org/tip/6703c9771d83ebe092b0d49cb0609a3f9d8b4ff7
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Tue, 2 Jan 2018 14:59:21 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 8 Jan 2018 11:11:56 -0300

perf test bpf: Improve message about expected samples

When failing on one of the BPF tests we were just stating:

BPF filter result incorrect

Add some more info to help figuring out the problem:

BPF filter result incorrect, expected 56, got 0 samples

This came out while investigating this failure, first seen after updating the kernel to the 4.15.0-rc6 tag:

[root@jouet ~]# perf test bpf

  39: BPF filter               :
  39.1: Basic BPF filtering    : FAILED!
  39.2: BPF pinning            : Skip

39.3: BPF prologue generation: Skip
39.4: BPF relocation checker : Skip
[root@jouet ~]#

---
 tools/perf/tests/bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/bpf.c +1 -1
index c433dd3..057c6b8 100644
@@ -190,7 +190,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 	}
 
 	if (count != expect) {
-		pr_debug("BPF filter result incorrect\n");
+		pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect, count);
 		goto out_delete_evlist;
 	}