From 11a4d435a2d75918039540f08b259969c63b8635 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 22 Oct 2013 15:24:58 -0300 Subject: perf test: Clarify the "sample parsing" test entry Before: [root@sandy ~]# perf test -v 22 22: Test sample parsing : --- start --- sample format has changed - test needs updating ---- end ---- Test sample parsing: FAILED! [root@sandy ~]# After: [root@sandy ~]# perf test -v 22 22: Test sample parsing : --- start --- sample format has changed, some new PERF_SAMPLE_ bit was introduced - test needs updating ---- end ---- Test sample parsing: FAILED! [root@sandy ~]# Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-8cazc2fpmk70jcbww8c0cobx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/sample-parsing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/perf/tests/sample-parsing.c') diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c index 77f598dbd97..17d000c6c8f 100644 --- a/tools/perf/tests/sample-parsing.c +++ b/tools/perf/tests/sample-parsing.c @@ -276,7 +276,7 @@ int test__sample_parsing(void) * were added. */ if (PERF_SAMPLE_MAX > PERF_SAMPLE_IDENTIFIER << 1) { - pr_debug("sample format has changed - test needs updating\n"); + pr_debug("sample format has changed, some new PERF_SAMPLE_ bit was introduced - test needs updating\n"); return -1; } -- cgit v1.2.3-70-g09d2 From 4ac2f1c1014a121f1493a9d5207258793c576438 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 22 Oct 2013 15:28:11 -0300 Subject: perf test: Consider PERF_SAMPLE_TRANSACTION in the "sample parsing" test [root@sandy ~]# perf test -v 22 22: Test sample parsing : --- start --- sample format has changed, some new PERF_SAMPLE_ bit was introduced - test needs updating ---- end ---- Test sample parsing: FAILED! [root@sandy ~]# Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-cx83wuzz30m10m4s1xt0ocyq@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/sample-parsing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/perf/tests/sample-parsing.c') diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c index 17d000c6c8f..61c9da2eb3a 100644 --- a/tools/perf/tests/sample-parsing.c +++ b/tools/perf/tests/sample-parsing.c @@ -275,7 +275,7 @@ int test__sample_parsing(void) * Fail the test if it has not been updated when new sample format bits * were added. */ - if (PERF_SAMPLE_MAX > PERF_SAMPLE_IDENTIFIER << 1) { + if (PERF_SAMPLE_MAX > PERF_SAMPLE_TRANSACTION << 1) { pr_debug("sample format has changed, some new PERF_SAMPLE_ bit was introduced - test needs updating\n"); return -1; } -- cgit v1.2.3-70-g09d2 From 091a4ef5a94d46d26a05f0c32d2f64800ed91306 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Fri, 1 Nov 2013 15:51:37 +0200 Subject: perf test: Update "sample parsing" test for PERF_SAMPLE_TRANSACTION In fact the "sample parsing" test does not automatically check new sample type bits - they must be added to the comparison logic. Doing that shows that the test fails because the functions perf_event__synthesize_sample() and perf_event__sample_event_size() have not been updated with PERF_SAMPLE_TRANSACTION either. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mike Galbraith Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1383313899-15987-10-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/sample-parsing.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools/perf/tests/sample-parsing.c') diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c index 61c9da2eb3a..1b677202638 100644 --- a/tools/perf/tests/sample-parsing.c +++ b/tools/perf/tests/sample-parsing.c @@ -121,6 +121,9 @@ static bool samples_same(const struct perf_sample *s1, if (type & PERF_SAMPLE_DATA_SRC) COMP(data_src); + if (type & PERF_SAMPLE_TRANSACTION) + COMP(transaction); + return true; } @@ -165,6 +168,7 @@ static int do_test(u64 sample_type, u64 sample_regs_user, u64 read_format) .cpu = 110, .raw_size = sizeof(raw_data), .data_src = 111, + .transaction = 112, .raw_data = (void *)raw_data, .callchain = &callchain.callchain, .branch_stack = &branch_stack.branch_stack, @@ -273,7 +277,8 @@ int test__sample_parsing(void) /* * Fail the test if it has not been updated when new sample format bits - * were added. + * were added. Please actually update the test rather than just change + * the condition below. */ if (PERF_SAMPLE_MAX > PERF_SAMPLE_TRANSACTION << 1) { pr_debug("sample format has changed, some new PERF_SAMPLE_ bit was introduced - test needs updating\n"); -- cgit v1.2.3-70-g09d2