Skip to contentSkip to conversation

perf test: Fix bpf test sample mismatch reporting

PATCH In review Michael Petlan 2 participants 3 messages Aug 5, 2021 – Sep 9, 2021 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf test: Fix bpf test sample mismatch reporting

When the expected sample count in the condition changed, the message needs to be changed too, otherwise we'll get:

0x1001f2091d8: mmap mask[0]:
BPF filter result incorrect, expected 56, got 56 samples

Fixes 4b04e0decd25 ("perf test: Fix basic bpf filtering test")
---
 tools/perf/tests/bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/bpf.c +1 -1
index dbf5f5215abe..fa03ff0dc083 100644
@@ -192,7 +192,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 	}
 
 	if (count != expect * evlist->core.nr_entries) {
-		pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect, count);
+		pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect * evlist->core.nr_entries, count);
 		goto out_delete_evlist;
 	}
 
Signature · 1 line
2.18.4
#1 lore raw

Hi Arnaldo, please have a look.
This is still valid.
Thanks.
Michael

Quoted 30 lines · Michael Petlan

When the expected sample count in the condition changed, the message needs to be changed too, otherwise we'll get:

0x1001f2091d8: mmap mask[0]:
BPF filter result incorrect, expected 56, got 56 samples

Fixes 4b04e0decd25 ("perf test: Fix basic bpf filtering test")
---
 tools/perf/tests/bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/bpf.c +1 -1
index dbf5f5215abe..fa03ff0dc083 100644
@@ -192,7 +192,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 	}
 
 	if (count != expect * evlist->core.nr_entries) {
-		pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect, count);
+		pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect * evlist->core.nr_entries, count);
 		goto out_delete_evlist;
 	}
 
Signature · 1 line
2.18.4
#2 lore raw

Em Mon, Sep 06, 2021 at 04:26:31PM +0200, Michael Petlan escreveu:

Quoted 4 lines

Hi Arnaldo, please have a look.
This is still valid.
Thanks.
Michael

Looks correct, thanks for resending, applied.

- Arnaldo

Quoted 31 lines · Michael Petlan
Quoted 30 lines

When the expected sample count in the condition changed, the message needs to be changed too, otherwise we'll get:

0x1001f2091d8: mmap mask[0]:
BPF filter result incorrect, expected 56, got 56 samples

Fixes 4b04e0decd25 ("perf test: Fix basic bpf filtering test")
---
 tools/perf/tests/bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/bpf.c +1 -1
index dbf5f5215abe..fa03ff0dc083 100644
@@ -192,7 +192,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 	}
 
 	if (count != expect * evlist->core.nr_entries) {
-		pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect, count);
+		pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect * evlist->core.nr_entries, count);
 		goto out_delete_evlist;
 	}
 
Signature · 1 line
2.18.4
Signature · 1 line
- Arnaldo