lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9828a385-acde-145a-33db-76043e799344@arm.com>
Date:   Fri, 10 Dec 2021 15:21:09 +0000
From:   German Gomez <german.gomez@....com>
To:     John Garry <john.garry@...wei.com>, linux-kernel@...r.kernel.org,
        linux-perf-users@...r.kernel.org, acme@...nel.org
Cc:     Alexandre Truong <alexandre.truong@....com>,
        Will Deacon <will@...nel.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Leo Yan <leo.yan@...aro.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        linux-arm-kernel@...ts.infradead.org, linux-csky@...r.kernel.org,
        linux-riscv@...ts.infradead.org
Subject: Re: [PATCH v2 3/3] perf tools: Support register names from all archs


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ