From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: "Peter Zijlstra" <peterz@infradead.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Namhyung Kim" <namhyung@kernel.org>,
"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
"Jiri Olsa" <jolsa@kernel.org>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"James Clark" <james.clark@linaro.org>,
"John Garry" <john.g.garry@oracle.com>,
"Will Deacon" <will@kernel.org>, "Leo Yan" <leo.yan@linux.dev>,
"Guo Ren" <guoren@kernel.org>, "Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nick Desaulniers" <nick.desaulniers+lkml@gmail.com>,
"Bill Wendling" <morbo@google.com>,
"Justin Stitt" <justinstitt@google.com>,
"Zecheng Li" <zecheng@google.com>,
"Tianyou Li" <tianyou.li@intel.com>,
"Thomas Falcon" <thomas.falcon@intel.com>,
"Julia Lawall" <Julia.Lawall@inria.fr>,
"Suchit Karunakaran" <suchitkarunakaran@gmail.com>,
"Athira Rajeev" <atrajeev@linux.ibm.com>,
"Aditya Bodkhe" <aditya.b1@linux.ibm.com>,
"Howard Chu" <howardchu95@gmail.com>,
"Krzysztof Łopatowski" <krzysztof.m.lopatowski@gmail.com>,
"Dr. David Alan Gilbert" <linux@treblig.org>,
"Shimin Guo" <shimin.guo@skydio.com>,
"Sergei Trofimovich" <slyich@gmail.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH v3 11/12] perf disasm: Refactor arch__find and initialization of arch structs
Date: Fri, 23 Jan 2026 14:47:09 -0300 [thread overview]
Message-ID: <aXO0Hao8t-McaAU3@x1> (raw)
In-Reply-To: <20260122213516.671089-12-irogers@google.com>
On Thu, Jan 22, 2026 at 01:35:15PM -0800, Ian Rogers wrote:
> Switch arch__find to using an ELF machine number rather than a
> string. Rather than an array of fixed size arch structs turn the init
> functions into new functions indexed by the ELF machine they
> correspond to. This allows data to be stored with a struct arch with
> the container_of trick, so the priv variable can be removed. Switch to
> using the thread to find the arch rather than the evsel as the evsel
> only has limited notions of the running thread upon which disassembly
> is performed. Factor out the e_machine and e_flags into their own
> struct to make them easier to pass around.
Added:
⬢ [acme@toolbx perf-tools-next]$ git diff
diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c
index 46740d1e58580004..4f60726247d62764 100644
--- a/tools/perf/util/disasm.c
+++ b/tools/perf/util/disasm.c
@@ -1,5 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <ctype.h>
+#include <elf.h>
+#ifndef EF_CSKY_ABIMASK
+#define EF_CSKY_ABIMASK 0XF0000000
+#endif
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
With:
[ Include elf.h for EM_CSKY and friends and also conditionally define EM_CSKY_ABIMASK for old distros ]
WARNING: multiple messages have this Message-ID (diff)
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: "Peter Zijlstra" <peterz@infradead.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Namhyung Kim" <namhyung@kernel.org>,
"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
"Jiri Olsa" <jolsa@kernel.org>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"James Clark" <james.clark@linaro.org>,
"John Garry" <john.g.garry@oracle.com>,
"Will Deacon" <will@kernel.org>, "Leo Yan" <leo.yan@linux.dev>,
"Guo Ren" <guoren@kernel.org>, "Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nick Desaulniers" <nick.desaulniers+lkml@gmail.com>,
"Bill Wendling" <morbo@google.com>,
"Justin Stitt" <justinstitt@google.com>,
"Zecheng Li" <zecheng@google.com>,
"Tianyou Li" <tianyou.li@intel.com>,
"Thomas Falcon" <thomas.falcon@intel.com>,
"Julia Lawall" <Julia.Lawall@inria.fr>,
"Suchit Karunakaran" <suchitkarunakaran@gmail.com>,
"Athira Rajeev" <atrajeev@linux.ibm.com>,
"Aditya Bodkhe" <aditya.b1@linux.ibm.com>,
"Howard Chu" <howardchu95@gmail.com>,
"Krzysztof Łopatowski" <krzysztof.m.lopatowski@gmail.com>,
"Dr. David Alan Gilbert" <linux@treblig.org>,
"Shimin Guo" <shimin.guo@skydio.com>,
"Sergei Trofimovich" <slyich@gmail.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH v3 11/12] perf disasm: Refactor arch__find and initialization of arch structs
Date: Fri, 23 Jan 2026 14:47:09 -0300 [thread overview]
Message-ID: <aXO0Hao8t-McaAU3@x1> (raw)
In-Reply-To: <20260122213516.671089-12-irogers@google.com>
On Thu, Jan 22, 2026 at 01:35:15PM -0800, Ian Rogers wrote:
> Switch arch__find to using an ELF machine number rather than a
> string. Rather than an array of fixed size arch structs turn the init
> functions into new functions indexed by the ELF machine they
> correspond to. This allows data to be stored with a struct arch with
> the container_of trick, so the priv variable can be removed. Switch to
> using the thread to find the arch rather than the evsel as the evsel
> only has limited notions of the running thread upon which disassembly
> is performed. Factor out the e_machine and e_flags into their own
> struct to make them easier to pass around.
Added:
⬢ [acme@toolbx perf-tools-next]$ git diff
diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c
index 46740d1e58580004..4f60726247d62764 100644
--- a/tools/perf/util/disasm.c
+++ b/tools/perf/util/disasm.c
@@ -1,5 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <ctype.h>
+#include <elf.h>
+#ifndef EF_CSKY_ABIMASK
+#define EF_CSKY_ABIMASK 0XF0000000
+#endif
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
With:
[ Include elf.h for EM_CSKY and friends and also conditionally define EM_CSKY_ABIMASK for old distros ]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2026-01-23 17:47 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 21:35 [PATCH v3 00/12] perf annotate arch clean up Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-22 21:35 ` [PATCH v3 01/12] perf header: Fix memory leaks in process_cpu_domain_info Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-22 21:35 ` [PATCH v3 02/12] perf annotate: Fix args leak of map_symbol Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-22 21:35 ` [PATCH v3 03/12] perf maps: Fix reference count leak in maps__find_ams Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-22 21:35 ` [PATCH v3 04/12] perf disasm: Constify use of struct arch Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-22 21:35 ` [PATCH v3 05/12] perf disasm: Constify use of struct ins_op Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-22 21:35 ` [PATCH v3 06/12] perf disasm: Constify use of struct ins Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-22 21:35 ` [PATCH v3 07/12] perf disasm: Rework the string arch__is to use the ELF machine Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-22 21:35 ` [PATCH v3 08/12] perf disasm: Don't include C files from the arch directory Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-22 21:35 ` [PATCH v3 09/12] perf disasm: Refactor ins__is_call/jump to avoid exposing arch ins_ops Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-22 21:35 ` [PATCH v3 10/12] perf map_symbol: Switch from holding maps to holding thread Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-22 21:35 ` [PATCH v3 11/12] perf disasm: Refactor arch__find and initialization of arch structs Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-23 17:47 ` Arnaldo Carvalho de Melo [this message]
2026-01-23 17:47 ` Arnaldo Carvalho de Melo
2026-01-22 21:35 ` [PATCH v3 12/12] perf disasm: Minor layout tweaks for struct arch Ian Rogers
2026-01-22 21:35 ` Ian Rogers
2026-01-23 11:02 ` [PATCH v3 00/12] perf annotate arch clean up James Clark
2026-01-23 11:02 ` James Clark
2026-01-23 16:30 ` Ian Rogers
2026-01-23 16:30 ` Ian Rogers
2026-01-23 16:47 ` Arnaldo Carvalho de Melo
2026-01-23 16:47 ` Arnaldo Carvalho de Melo
2026-03-24 6:07 ` patchwork-bot+linux-riscv
2026-03-24 6:07 ` patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aXO0Hao8t-McaAU3@x1 \
--to=acme@kernel.org \
--cc=Julia.Lawall@inria.fr \
--cc=aditya.b1@linux.ibm.com \
--cc=adrian.hunter@intel.com \
--cc=alex@ghiti.fr \
--cc=alexander.shishkin@linux.intel.com \
--cc=aou@eecs.berkeley.edu \
--cc=atrajeev@linux.ibm.com \
--cc=guoren@kernel.org \
--cc=howardchu95@gmail.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=john.g.garry@oracle.com \
--cc=jolsa@kernel.org \
--cc=justinstitt@google.com \
--cc=krzysztof.m.lopatowski@gmail.com \
--cc=leo.yan@linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@treblig.org \
--cc=mingo@redhat.com \
--cc=morbo@google.com \
--cc=namhyung@kernel.org \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=palmer@dabbelt.com \
--cc=peterz@infradead.org \
--cc=pjw@kernel.org \
--cc=shimin.guo@skydio.com \
--cc=slyich@gmail.com \
--cc=suchitkarunakaran@gmail.com \
--cc=thomas.falcon@intel.com \
--cc=tianyou.li@intel.com \
--cc=will@kernel.org \
--cc=zecheng@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.