]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf env, dso, thread: Add _endian variants for e_machine helpers
authorIan Rogers <irogers@google.com>
Tue, 2 Jun 2026 15:25:00 +0000 (08:25 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 3 Jun 2026 19:45:21 +0000 (16:45 -0300)
commitf7c6e4b99ded250b3fdeaa5be4ccaac9ae05f8d9
treea81b2b159dd4382769acf0207392019a2b412034
parent4ccbc91df98a19eba2f40088e9bf5ab0888cf80a
perf env, dso, thread: Add _endian variants for e_machine helpers

Add perf_arch_is_big_endian(), dso__read_e_machine_endian(),
dso__e_machine_endian(), and thread__e_machine_endian() to support
bi-endianness and cross-architecture analysis without breaking the
existing API.

These helpers allow querying the absolute endianness of a DSO or
thread, which is required for tools like Capstone that need to set the
correct disassembly mode.

Assisted-by: Gemini:gemini-3.1-pro-preview
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Honglei Wang <jameshongleiwang@126.com>
Cc: Jan Polensky <japo@linux.ibm.com>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/dso.c
tools/perf/util/dso.h
tools/perf/util/env.c
tools/perf/util/env.h
tools/perf/util/thread.c
tools/perf/util/thread.h