aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Mars <paul.mars@canonical.com>2024-03-29 15:25:45 +0100
committerSteven Rostedt (Google) <rostedt@goodmis.org>2024-04-11 20:34:45 -0400
commitec8e0cc624e7ee29f53d1a2459eb5b3ad0d2fcd8 (patch)
treeba004056c2277190776f5a40adba732fc258a658
parent60ed6c392121f5cd9992c7130abc99e673e57358 (diff)
downloadlibtraceevent-upstream-libtraceevent.tar.gz
libtraceevent: Fix tests running on big endian archupstream-libtraceevent
Tests running on big endian arch (tested on s390x) where failing due to: - a typo in CPUMASK_BYTEPN. - a missing call to tep_set_file_bigendian when initializing the test suite. Link: https://lore.kernel.org/linux-trace-devel/20240329142544.845408-1-paul.mars@canonical.com Thanks to Mate Kukri <mate.kukri@canonical.com>. Signed-off-by: Paul Mars <paul.mars@canonical.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--utest/traceevent-utest.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/utest/traceevent-utest.c b/utest/traceevent-utest.c
index 041843e..b95e478 100644
--- a/utest/traceevent-utest.c
+++ b/utest/traceevent-utest.c
@@ -216,7 +216,7 @@ DECL_CPUMASK_EVENT_DATA(bytep2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x01);
#define CPUMASK_BYTEP2_FMT "cpumask=0,23"
DECL_CPUMASK_EVENT_DATA(bytepn, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01);
-#define CPUMASK_BYTEPN "ARRAY[80, 00, 00, 00, 00, 00, 80, 01]"
+#define CPUMASK_BYTEPN "ARRAY[80, 00, 00, 00, 00, 00, 00, 01]"
#define CPUMASK_BYTEPN_FMT "cpumask=0,63"
#endif
@@ -392,6 +392,9 @@ static int test_suite_init(void)
test_tep = tep_alloc();
if (!test_tep)
return 1;
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ tep_set_file_bigendian(test_tep, TEP_BIG_ENDIAN);
+#endif
return 0;
}