[PATCH v4 3/4] perf test sample-parsing: Update expected branch flags

From: Sandipan Das
Date: Thu Feb 02 2023 - 07:27:40 EST


The bitfield swapping scheme used duing sample parsing has changed
because of the addition of new branch flags, namely "spec", "new_type"
and "priv". Earlier, these were all part of the "reserved" field but
now, each of these fields get swapped separately. Change the expected
flag values accordingly for the test to pass.

E.g.

$ perf test -v 27

Before:

27: Sample parsing :
--- start ---
test child forked, pid 61979
parsing failed for sample_type 0x800
test child finished with -1
---- end ----
Sample parsing: FAILED!

After:

27: Sample parsing :
--- start ---
test child forked, pid 63293
test child finished with 0
---- end ----
Sample parsing: Ok

Signed-off-by: Sandipan Das <sandipan.das@xxxxxxx>
---
tools/perf/tests/sample-parsing.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c
index 927c7f0cc4cc..25a3f6cece50 100644
--- a/tools/perf/tests/sample-parsing.c
+++ b/tools/perf/tests/sample-parsing.c
@@ -37,7 +37,7 @@
* in branch_stack variable.
*/
#define BS_EXPECTED_BE 0xa000d00000000000
-#define BS_EXPECTED_LE 0xd5000000
+#define BS_EXPECTED_LE 0x1aa00000000
#define FLAG(s) s->branch_stack->entries[i].flags

static bool samples_same(const struct perf_sample *s1,
--
2.34.1