From: German Gomez <german.gomez@arm.com>
To: John Garry <john.garry@huawei.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
acme@kernel.org
Cc: Alexandre Truong <alexandre.truong@arm.com>,
Will Deacon <will@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Leo Yan <leo.yan@linaro.org>, Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH v2 3/3] perf tools: Support register names from all archs
Date: Fri, 10 Dec 2021 15:21:09 +0000 [thread overview]
Message-ID: <9828a385-acde-145a-33db-76043e799344@arm.com> (raw)
In-Reply-To: <aee0c3b8-4d8c-6f1e-24ed-5539a7c1a7b5@arm.com>
On 08/12/2021 13:55, German Gomez wrote:
> Hi John,
>
> On 08/12/2021 11:51, John Garry wrote:
>> On 07/12/2021 18:06, German Gomez wrote:
>>> tools/perf/arch/arm/include/perf_regs.h | 42 --
>>> tools/perf/arch/arm64/include/perf_regs.h | 76 --
>>> tools/perf/arch/csky/include/perf_regs.h | 82 ---
>>> tools/perf/arch/mips/include/perf_regs.h | 69 --
>>> tools/perf/arch/powerpc/include/perf_regs.h | 66 --
>>> tools/perf/arch/riscv/include/perf_regs.h | 74 --
>>> tools/perf/arch/s390/include/perf_regs.h | 78 --
>>> tools/perf/arch/x86/include/perf_regs.h | 82 ---
>>> tools/perf/builtin-script.c | 18 +-
>>> tools/perf/util/perf_regs.c | 666 ++++++++++++++++++
>>> tools/perf/util/perf_regs.h | 10 +-
>>> .../scripting-engines/trace-event-python.c | 10 +-
>>> tools/perf/util/session.c | 25 +-
>>> 13 files changed, 697 insertions(+), 601 deletions(-)
>> Did you consider leaving the register structures where they are while
>> renaming to include the arch name and then having as externs or similar? I see an example of that idea for arm64_unwind_libunwind_ops.
>>
> If by register structures you are referring to "__perf_reg_name(int)", I
> can't leave them where they are. Only one of them would be included in
> the build.
I think I need to elaborate a bit more on this since some of the files
involved share the same name but are serving different purposes and it
could lead to confusion.
The linux repo has "perf_regs.h" for each architecture enumerating the
registers from each architecture. These are the files I #include'd in
"/tools/perf/util/perf_regs.c".
The other "perf_regs.h" affected by this patch are local only to perf.
Likewise there is one file for each architecture, but contrary to the
linux ones, they are mutually exclusive, so I can't #include them all:
#ifndef ARCH_PERF_REGS_H
#define ARCH_PERF_REGS_H
//...
#undef ARCH_PERF_REGS_H
Before the patch, the functions "__perf_reg_name" were declared &
implemented in these headers, so I had to take them out.
Thanks,
German
next prev parent reply other threads:[~2021-12-10 15:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 18:06 [PATCH v2 0/3] Support register names of all architectures German Gomez
2021-12-07 18:06 ` [PATCH v2 1/3] perf tools: Prevent out-of-bounds access to registers German Gomez
2021-12-07 18:06 ` [PATCH v2 2/3] perf tools: Rename perf_event_arm_regs for ARM64 registers German Gomez
2021-12-07 18:06 ` [PATCH v2 3/3] perf tools: Support register names from all archs German Gomez
2021-12-08 11:51 ` John Garry
2021-12-08 13:55 ` German Gomez
2021-12-10 15:21 ` German Gomez [this message]
2021-12-14 8:50 ` [PATCH v2 0/3] Support register names of all architectures Athira Rajeev
2021-12-14 13:26 ` Arnaldo Carvalho de Melo
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=9828a385-acde-145a-33db-76043e799344@arm.com \
--to=german.gomez@arm.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexandre.truong@arm.com \
--cc=john.garry@huawei.com \
--cc=jolsa@redhat.com \
--cc=leo.yan@linaro.org \
--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=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=namhyung@kernel.org \
--cc=will@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).