perf tool: build related fixes
Subsystems (2)
Ian Rogers
reviewercover perf tool: build related fixes
These patches better enable a build of perf when not using the regular Makefiles, in my case using bazel.
Ian Rogers (3):
tools: fix off-by 1 relative directory includes
libperf: avoid redefining _GNU_SOURCE in test
tools/perf: build fixes for arch_errno_names.sh
tools/include/uapi/asm/errno.h | 14 +++++----- tools/lib/perf/tests/test-evlist.c | 2 ++ tools/perf/arch/arm64/util/arm-spe.c | 20 +++++++------- tools/perf/arch/arm64/util/perf_regs.c | 2 +- tools/perf/arch/powerpc/util/perf_regs.c | 4 +-- tools/perf/arch/x86/util/auxtrace.c | 14 +++++----- tools/perf/arch/x86/util/event.c | 12 ++++----- tools/perf/arch/x86/util/header.c | 4 +-- tools/perf/arch/x86/util/intel-bts.c | 24 ++++++++--------- tools/perf/arch/x86/util/intel-pt.c | 30 ++++++++++----------- tools/perf/arch/x86/util/machine.c | 6 ++--- tools/perf/arch/x86/util/perf_regs.c | 8 +++--- tools/perf/arch/x86/util/pmu.c | 6 ++--- tools/perf/trace/beauty/arch_errno_names.sh | 4 +-- 14 files changed, 76 insertions(+), 74 deletions(-)
Signature · 1 line
2.25.1.481.gfbce0eb801-goog
Ian Rogers
reviewerPATCH 1/3 tools: fix off-by 1 relative directory includes
This is currently working due to extra include paths in the build.
--- tools/include/uapi/asm/errno.h | 14 +++++------ tools/perf/arch/arm64/util/arm-spe.c | 20 ++++++++-------- tools/perf/arch/arm64/util/perf_regs.c | 2 +- tools/perf/arch/powerpc/util/perf_regs.c | 4 ++-- tools/perf/arch/x86/util/auxtrace.c | 14 +++++------ tools/perf/arch/x86/util/event.c | 12 +++++----- tools/perf/arch/x86/util/header.c | 4 ++-- tools/perf/arch/x86/util/intel-bts.c | 24 +++++++++---------- tools/perf/arch/x86/util/intel-pt.c | 30 ++++++++++++------------ tools/perf/arch/x86/util/machine.c | 6 ++--- tools/perf/arch/x86/util/perf_regs.c | 8 +++---- tools/perf/arch/x86/util/pmu.c | 6 ++--- 12 files changed, 72 insertions(+), 72 deletions(-)
tools/include/uapi/asm/errno.h +7 -7
@@ -1,18 +1,18 @@/* SPDX-License-Identifier: GPL-2.0 */ #if defined(__i386__) || defined(__x86_64__) -#include "../../arch/x86/include/uapi/asm/errno.h" +#include "../../../arch/x86/include/uapi/asm/errno.h" #elif defined(__powerpc__) -#include "../../arch/powerpc/include/uapi/asm/errno.h" +#include "../../../arch/powerpc/include/uapi/asm/errno.h" #elif defined(__sparc__) -#include "../../arch/sparc/include/uapi/asm/errno.h" +#include "../../../arch/sparc/include/uapi/asm/errno.h" #elif defined(__alpha__) -#include "../../arch/alpha/include/uapi/asm/errno.h" +#include "../../../arch/alpha/include/uapi/asm/errno.h" #elif defined(__mips__) -#include "../../arch/mips/include/uapi/asm/errno.h" +#include "../../../arch/mips/include/uapi/asm/errno.h" #elif defined(__ia64__) -#include "../../arch/ia64/include/uapi/asm/errno.h" +#include "../../../arch/ia64/include/uapi/asm/errno.h" #elif defined(__xtensa__) -#include "../../arch/xtensa/include/uapi/asm/errno.h" +#include "../../../arch/xtensa/include/uapi/asm/errno.h" #else #include <asm-generic/errno.h> #endif
tools/perf/arch/arm64/util/arm-spe.c +10 -10
@@ -11,17 +11,17 @@#include <linux/zalloc.h> #include <time.h> -#include "../../util/cpumap.h" -#include "../../util/event.h" -#include "../../util/evsel.h" -#include "../../util/evlist.h" -#include "../../util/session.h" +#include "../../../util/cpumap.h" +#include "../../../util/event.h" +#include "../../../util/evsel.h" +#include "../../../util/evlist.h" +#include "../../../util/session.h" #include <internal/lib.h> // page_size -#include "../../util/pmu.h" -#include "../../util/debug.h" -#include "../../util/auxtrace.h" -#include "../../util/record.h" -#include "../../util/arm-spe.h" +#include "../../../util/pmu.h" +#include "../../../util/debug.h" +#include "../../../util/auxtrace.h" +#include "../../../util/record.h" +#include "../../../util/arm-spe.h" #define KiB (x) ((x) * 1024)#define MiB (x) ((x) * 1024 * 1024)
tools/perf/arch/arm64/util/perf_regs.c +1 -1
@@ -1,5 +1,5 @@// SPDX-License-Identifier: GPL-2.0 -#include "../../util/perf_regs.h" +#include "../../../util/perf_regs.h" const struct sample_reg sample_reg_masks[] = {SMPL_REG_END
tools/perf/arch/powerpc/util/perf_regs.c +2 -2
@@ -4,8 +4,8 @@#include <regex.h> #include <linux/zalloc.h> -#include "../../util/perf_regs.h" -#include "../../util/debug.h" +#include "../../../util/perf_regs.h" +#include "../../../util/debug.h" #include <linux/kernel.h>
tools/perf/arch/x86/util/auxtrace.c +7 -7
@@ -7,13 +7,13 @@#include <errno.h> #include <stdbool.h> -#include "../../util/header.h" -#include "../../util/debug.h" -#include "../../util/pmu.h" -#include "../../util/auxtrace.h" -#include "../../util/intel-pt.h" -#include "../../util/intel-bts.h" -#include "../../util/evlist.h" +#include "../../../util/header.h" +#include "../../../util/debug.h" +#include "../../../util/pmu.h" +#include "../../../util/auxtrace.h" +#include "../../../util/intel-pt.h" +#include "../../../util/intel-bts.h" +#include "../../../util/evlist.h" static struct auxtrace_record *auxtrace_record__init_intel(struct evlist *evlist,
tools/perf/arch/x86/util/event.c +6 -6
@@ -3,12 +3,12 @@#include <linux/string.h> #include <linux/zalloc.h> -#include "../../util/event.h" -#include "../../util/synthetic-events.h" -#include "../../util/machine.h" -#include "../../util/tool.h" -#include "../../util/map.h" -#include "../../util/debug.h" +#include "../../../util/event.h" +#include "../../../util/synthetic-events.h" +#include "../../../util/machine.h" +#include "../../../util/tool.h" +#include "../../../util/map.h" +#include "../../../util/debug.h" #if defined(__x86_64__)
tools/perf/arch/x86/util/header.c +2 -2
@@ -7,8 +7,8 @@#include <string.h> #include <regex.h> -#include "../../util/debug.h" -#include "../../util/header.h" +#include "../../../util/debug.h" +#include "../../../util/header.h" static inline void cpuid(unsigned int op, unsigned int *a, unsigned int *b, unsigned int *c,
tools/perf/arch/x86/util/intel-bts.c +12 -12
@@ -11,18 +11,18 @@#include <linux/log2.h> #include <linux/zalloc.h> -#include "../../util/cpumap.h" -#include "../../util/event.h" -#include "../../util/evsel.h" -#include "../../util/evlist.h" -#include "../../util/mmap.h" -#include "../../util/session.h" -#include "../../util/pmu.h" -#include "../../util/debug.h" -#include "../../util/record.h" -#include "../../util/tsc.h" -#include "../../util/auxtrace.h" -#include "../../util/intel-bts.h" +#include "../../../util/cpumap.h" +#include "../../../util/event.h" +#include "../../../util/evsel.h" +#include "../../../util/evlist.h" +#include "../../../util/mmap.h" +#include "../../../util/session.h" +#include "../../../util/pmu.h" +#include "../../../util/debug.h" +#include "../../../util/record.h" +#include "../../../util/tsc.h" +#include "../../../util/auxtrace.h" +#include "../../../util/intel-bts.h" #include <internal/lib.h> // page_size #define KiB (x) ((x) * 1024)
tools/perf/arch/x86/util/intel-pt.c +15 -15
@@ -13,23 +13,23 @@#include <linux/zalloc.h> #include <cpuid.h> -#include "../../util/session.h" -#include "../../util/event.h" -#include "../../util/evlist.h" -#include "../../util/evsel.h" -#include "../../util/evsel_config.h" -#include "../../util/cpumap.h" -#include "../../util/mmap.h" +#include "../../../util/session.h" +#include "../../../util/event.h" +#include "../../../util/evlist.h" +#include "../../../util/evsel.h" +#include "../../../util/evsel_config.h" +#include "../../../util/cpumap.h" +#include "../../../util/mmap.h" #include <subcmd/parse-options.h> -#include "../../util/parse-events.h" -#include "../../util/pmu.h" -#include "../../util/debug.h" -#include "../../util/auxtrace.h" -#include "../../util/record.h" -#include "../../util/target.h" -#include "../../util/tsc.h" +#include "../../../util/parse-events.h" +#include "../../../util/pmu.h" +#include "../../../util/debug.h" +#include "../../../util/auxtrace.h" +#include "../../../util/record.h" +#include "../../../util/target.h" +#include "../../../util/tsc.h" #include <internal/lib.h> // page_size -#include "../../util/intel-pt.h" +#include "../../../util/intel-pt.h" #define KiB (x) ((x) * 1024)#define MiB (x) ((x) * 1024 * 1024)
tools/perf/arch/x86/util/machine.c +3 -3
@@ -5,9 +5,9 @@#include <stdlib.h> #include <internal/lib.h> // page_size -#include "../../util/machine.h" -#include "../../util/map.h" -#include "../../util/symbol.h" +#include "../../../util/machine.h" +#include "../../../util/map.h" +#include "../../../util/symbol.h" #include <linux/ctype.h> #include <symbol/kallsyms.h>
tools/perf/arch/x86/util/perf_regs.c +4 -4
@@ -5,10 +5,10 @@#include <linux/kernel.h> #include <linux/zalloc.h> -#include "../../perf-sys.h" -#include "../../util/perf_regs.h" -#include "../../util/debug.h" -#include "../../util/event.h" +#include "../../../perf-sys.h" +#include "../../../util/perf_regs.h" +#include "../../../util/debug.h" +#include "../../../util/event.h" const struct sample_reg sample_reg_masks[] = {SMPL_REG (AX ,PERF_REG_X86_AX ),
tools/perf/arch/x86/util/pmu.c +3 -3
@@ -4,9 +4,9 @@#include <linux/stddef.h> #include <linux/perf_event.h> -#include "../../util/intel-pt.h" -#include "../../util/intel-bts.h" -#include "../../util/pmu.h" +#include "../../../util/intel-pt.h" +#include "../../../util/intel-bts.h" +#include "../../../util/pmu.h" struct perf_event_attr *perf_pmu__get_default_config (struct perf_pmu *pmu__maybe_unused ) {
Signature · 1 line
2.25.1.481.gfbce0eb801-goog
Re: [PATCH 1/3] tools: fix off-by 1 relative directory includes
Quoted 1 line · Ian Rogers
This is currently working due to extra include paths in the build.
if you're fixing this, why not remove that extra include path then?
jirka
Ian Rogers
reviewerRe: [PATCH 1/3] tools: fix off-by 1 relative directory includes
Quoted 5 lines · Jiri Olsa
Quoted 1 line · Ian Rogers
This is currently working due to extra include paths in the build.
if you're fixing this, why not remove that extra include path then?
TL;DR it is complicated, but the include paths are all currently necessary I believe and doing this way is necessary due to how header files may be copied out of the kernel.
The current build uses multiple -Is to ensure the correct version of a file is included, for example there are 27 files called bitops.h and 29 called bitsperlong.h. In
Google we're using libraries and bazel build files:
https://docs.bazel.build/versions/master/be/c-cpp.html#cc_library
and there's no way to say if you depend on this library then you need this include path. We've tried to make perf this way but having tied ourselves in knots we decided instead to emulate the include path behaviour by rewriting includes when we import code using copybara:
https://github.com/google/copybara
We are able when doing this to prioritize the include paths we rewrite so that a local directory version of a header is preferred over say one in tools/lib/perf and perhaps tools/perf. Having full include paths isn't really an option upstream as the same header file may be copied into a libc project that has a different directory layout. As we have absolute include paths at the time of building we need relative include paths to be correct. Upstream -Is allow the build to find the file but it is a bit of a quirk of the C preprocessor, so fixing these off-by 1s feels like value add both for us and upstream. For upstream to do anything different I think is going to be a significant rewrite of how the Makefile build works and I'm not sure what the result would look like.
Thanks!
Ian
Quoted 2 lines
jirka
Re: [PATCH 1/3] tools: fix off-by 1 relative directory includes
Em Fri, Mar 06, 2020 at 08:47:51AM -0800, Ian Rogers escreveu:
Quoted 10 lines · Jiri Olsa
Quoted 5 lines · Ian Rogers
Quoted 1 line
This is currently working due to extra include paths in the build.
if you're fixing this, why not remove that extra include path then?
TL;DR it is complicated, but the include paths are all currently necessary I believe and doing this way is necessary due to how header files may be copied out of the kernel.
TL;DR response: yeah, lets make incremental fixes to this, like applying this patch :)
- Arnaldo
Quoted 28 lines
The current build uses multiple -Is to ensure the correct version of a file is included, for example there are 27 files called
bitops.hand 29 calledbitsperlong.h. In
Google we're using libraries and bazel build files:
https://docs.bazel.build/versions/master/be/c-cpp.html#cc_library
and there's no way to say if you depend on this library then you need this include path. We've tried to make perf this way but having tied ourselves in knots we decided instead to emulate the include path behaviour by rewriting includes when we import code using copybara:
https://github.com/google/copybara
We are able when doing this to prioritize the include paths we rewrite so that a local directory version of a header is preferred over say one intools/lib/perfand perhapstools/perf. Having full include paths isn't really an option upstream as the same header file may be copied into a libc project that has a different directory layout. As we have absolute include paths at the time of building we need relative include paths to be correct. Upstream -Is allow the build to find the file but it is a bit of a quirk of the C preprocessor, so fixing these off-by 1s feels like value add both for us and upstream. For upstream to do anything different I think is going to be a significant rewrite of how theMakefilebuild works and I'm not sure what the result would look like.Thanks!
IanQuoted 2 lines
jirka
Signature · 1 line
- Arnaldo
Arnaldo Carvalho de Melo
AppliedRe: [PATCH 1/3] tools: fix off-by 1 relative directory includes
In reply to Ian RogersEm Thu, Mar 05, 2020 at 11:11:08PM -0800, Ian Rogers escreveu:
Quoted 1 line
This is currently working due to extra include paths in the build.
Thanks, applied and added this to the cset commit log:
Committer testing:
$ cd tools/include/uapi/asm/
Before this patch:
$ ls -la ../../arch/x86/include/uapi/asm/errno.h
ls: cannot access '../../arch/x86/include/uapi/asm/errno.h': No such file or directory
$
After this patch;
$ ls -la ../../../arch/x86/include/uapi/asm/errno.h
-rw-rw-r--. 1 acme acme 31 Feb 20 12:42 ../../../arch/x86/include/uapi/asm/errno.h
$
Check that that is still under tools/, i.e. hasn't escaped into the main
kernel sources:
$ cd ../../../arch/x86/include/uapi/asm/
$ pwd
/home/acme/git/perf/tools/arch/x86/include/uapi/asm
$
Tested-by: Arnaldo Carvalho de Melo <[email protected]>Quoted 301 lines
Signed-off-by Ian Rogers <[email protected]>--- tools/include/uapi/asm/errno.h | 14 +++++------ tools/perf/arch/arm64/util/arm-spe.c | 20 ++++++++-------- tools/perf/arch/arm64/util/perf_regs.c | 2 +- tools/perf/arch/powerpc/util/perf_regs.c | 4 ++-- tools/perf/arch/x86/util/auxtrace.c | 14 +++++------ tools/perf/arch/x86/util/event.c | 12 +++++----- tools/perf/arch/x86/util/header.c | 4 ++-- tools/perf/arch/x86/util/intel-bts.c | 24 +++++++++---------- tools/perf/arch/x86/util/intel-pt.c | 30 ++++++++++++------------ tools/perf/arch/x86/util/machine.c | 6 ++--- tools/perf/arch/x86/util/perf_regs.c | 8 +++---- tools/perf/arch/x86/util/pmu.c | 6 ++--- 12 files changed, 72 insertions(+), 72 deletions(-)tools/include/uapi/asm/errno.h +7
-7@@ -1,18 +1,18 @@/* SPDX-License-Identifier: GPL-2.0 */ #if defined(__i386__) || defined(__x86_64__) -#include "../../arch/x86/include/uapi/asm/errno.h" +#include "../../../arch/x86/include/uapi/asm/errno.h" #elif defined(__powerpc__) -#include "../../arch/powerpc/include/uapi/asm/errno.h" +#include "../../../arch/powerpc/include/uapi/asm/errno.h" #elif defined(__sparc__) -#include "../../arch/sparc/include/uapi/asm/errno.h" +#include "../../../arch/sparc/include/uapi/asm/errno.h" #elif defined(__alpha__) -#include "../../arch/alpha/include/uapi/asm/errno.h" +#include "../../../arch/alpha/include/uapi/asm/errno.h" #elif defined(__mips__) -#include "../../arch/mips/include/uapi/asm/errno.h" +#include "../../../arch/mips/include/uapi/asm/errno.h" #elif defined(__ia64__) -#include "../../arch/ia64/include/uapi/asm/errno.h" +#include "../../../arch/ia64/include/uapi/asm/errno.h" #elif defined(__xtensa__) -#include "../../arch/xtensa/include/uapi/asm/errno.h" +#include "../../../arch/xtensa/include/uapi/asm/errno.h" #else #include <asm-generic/errno.h> #endif tools/perf/arch/arm64/util/arm-spe.c +10
-10@@ -11,17 +11,17 @@#include <linux/zalloc.h> #include <time.h> -#include "../../util/cpumap.h" -#include "../../util/event.h" -#include "../../util/evsel.h" -#include "../../util/evlist.h" -#include "../../util/session.h" +#include "../../../util/cpumap.h" +#include "../../../util/event.h" +#include "../../../util/evsel.h" +#include "../../../util/evlist.h" +#include "../../../util/session.h" #include <internal/lib.h> // page_size -#include "../../util/pmu.h" -#include "../../util/debug.h" -#include "../../util/auxtrace.h" -#include "../../util/record.h" -#include "../../util/arm-spe.h" +#include "../../../util/pmu.h" +#include "../../../util/debug.h" +#include "../../../util/auxtrace.h" +#include "../../../util/record.h" +#include "../../../util/arm-spe.h" #define KiB (x) ((x) * 1024)#define MiB (x) ((x) * 1024 * 1024)tools/perf/arch/arm64/util/perf_regs.c +1
-1@@ -1,5 +1,5 @@// SPDX-License-Identifier: GPL-2.0 -#include "../../util/perf_regs.h" +#include "../../../util/perf_regs.h" const struct sample_reg sample_reg_masks[] = {SMPL_REG_END tools/perf/arch/powerpc/util/perf_regs.c +2
-2@@ -4,8 +4,8 @@#include <regex.h> #include <linux/zalloc.h> -#include "../../util/perf_regs.h" -#include "../../util/debug.h" +#include "../../../util/perf_regs.h" +#include "../../../util/debug.h" #include <linux/kernel.h> tools/perf/arch/x86/util/auxtrace.c +7
-7@@ -7,13 +7,13 @@#include <errno.h> #include <stdbool.h> -#include "../../util/header.h" -#include "../../util/debug.h" -#include "../../util/pmu.h" -#include "../../util/auxtrace.h" -#include "../../util/intel-pt.h" -#include "../../util/intel-bts.h" -#include "../../util/evlist.h" +#include "../../../util/header.h" +#include "../../../util/debug.h" +#include "../../../util/pmu.h" +#include "../../../util/auxtrace.h" +#include "../../../util/intel-pt.h" +#include "../../../util/intel-bts.h" +#include "../../../util/evlist.h" static struct auxtrace_record *auxtrace_record__init_intel(struct evlist *evlist,tools/perf/arch/x86/util/event.c +6
-6@@ -3,12 +3,12 @@#include <linux/string.h> #include <linux/zalloc.h> -#include "../../util/event.h" -#include "../../util/synthetic-events.h" -#include "../../util/machine.h" -#include "../../util/tool.h" -#include "../../util/map.h" -#include "../../util/debug.h" +#include "../../../util/event.h" +#include "../../../util/synthetic-events.h" +#include "../../../util/machine.h" +#include "../../../util/tool.h" +#include "../../../util/map.h" +#include "../../../util/debug.h" #if defined(__x86_64__)tools/perf/arch/x86/util/header.c +2
-2@@ -7,8 +7,8 @@#include <string.h> #include <regex.h> -#include "../../util/debug.h" -#include "../../util/header.h" +#include "../../../util/debug.h" +#include "../../../util/header.h" static inline void cpuid(unsigned int op, unsigned int *a, unsigned int *b, unsigned int *c,tools/perf/arch/x86/util/intel-bts.c +12
-12@@ -11,18 +11,18 @@#include <linux/log2.h> #include <linux/zalloc.h> -#include "../../util/cpumap.h" -#include "../../util/event.h" -#include "../../util/evsel.h" -#include "../../util/evlist.h" -#include "../../util/mmap.h" -#include "../../util/session.h" -#include "../../util/pmu.h" -#include "../../util/debug.h" -#include "../../util/record.h" -#include "../../util/tsc.h" -#include "../../util/auxtrace.h" -#include "../../util/intel-bts.h" +#include "../../../util/cpumap.h" +#include "../../../util/event.h" +#include "../../../util/evsel.h" +#include "../../../util/evlist.h" +#include "../../../util/mmap.h" +#include "../../../util/session.h" +#include "../../../util/pmu.h" +#include "../../../util/debug.h" +#include "../../../util/record.h" +#include "../../../util/tsc.h" +#include "../../../util/auxtrace.h" +#include "../../../util/intel-bts.h" #include <internal/lib.h> // page_size #define KiB (x) ((x) * 1024)tools/perf/arch/x86/util/intel-pt.c +15
-15@@ -13,23 +13,23 @@#include <linux/zalloc.h> #include <cpuid.h> -#include "../../util/session.h" -#include "../../util/event.h" -#include "../../util/evlist.h" -#include "../../util/evsel.h" -#include "../../util/evsel_config.h" -#include "../../util/cpumap.h" -#include "../../util/mmap.h" +#include "../../../util/session.h" +#include "../../../util/event.h" +#include "../../../util/evlist.h" +#include "../../../util/evsel.h" +#include "../../../util/evsel_config.h" +#include "../../../util/cpumap.h" +#include "../../../util/mmap.h" #include <subcmd/parse-options.h> -#include "../../util/parse-events.h" -#include "../../util/pmu.h" -#include "../../util/debug.h" -#include "../../util/auxtrace.h" -#include "../../util/record.h" -#include "../../util/target.h" -#include "../../util/tsc.h" +#include "../../../util/parse-events.h" +#include "../../../util/pmu.h" +#include "../../../util/debug.h" +#include "../../../util/auxtrace.h" +#include "../../../util/record.h" +#include "../../../util/target.h" +#include "../../../util/tsc.h" #include <internal/lib.h> // page_size -#include "../../util/intel-pt.h" +#include "../../../util/intel-pt.h" #define KiB (x) ((x) * 1024)#define MiB (x) ((x) * 1024 * 1024)tools/perf/arch/x86/util/machine.c +3
-3@@ -5,9 +5,9 @@#include <stdlib.h> #include <internal/lib.h> // page_size -#include "../../util/machine.h" -#include "../../util/map.h" -#include "../../util/symbol.h" +#include "../../../util/machine.h" +#include "../../../util/map.h" +#include "../../../util/symbol.h" #include <linux/ctype.h> #include <symbol/kallsyms.h> tools/perf/arch/x86/util/perf_regs.c +4
-4@@ -5,10 +5,10 @@#include <linux/kernel.h> #include <linux/zalloc.h> -#include "../../perf-sys.h" -#include "../../util/perf_regs.h" -#include "../../util/debug.h" -#include "../../util/event.h" +#include "../../../perf-sys.h" +#include "../../../util/perf_regs.h" +#include "../../../util/debug.h" +#include "../../../util/event.h" const struct sample_reg sample_reg_masks[] = {SMPL_REG (AX ,PERF_REG_X86_AX ),tools/perf/arch/x86/util/pmu.c +3
-3@@ -4,9 +4,9 @@#include <linux/stddef.h> #include <linux/perf_event.h> -#include "../../util/intel-pt.h" -#include "../../util/intel-bts.h" -#include "../../util/pmu.h" +#include "../../../util/intel-pt.h" +#include "../../../util/intel-bts.h" +#include "../../../util/pmu.h" struct perf_event_attr *perf_pmu__get_default_config (struct perf_pmu *pmu__maybe_unused ) {Signature · 1 line
2.25.1.481.gfbce0eb801-goog
Signature · 1 line
- Arnaldo
[tip: perf/urgent] tools: Fix off-by 1 relative directory includes
In reply to Ian RogersThe following commit has been merged into the perf/urgent branch of tip:
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 441b62acd9c809e87bab45ad1d82b1b3b77cb4f0 Gitweb: https://git.kernel.org/tip/441b62acd9c809e87bab45ad1d82b1b3b77cb4f0 Author: Ian Rogers <[email protected]> AuthorDate: Thu, 05 Mar 2020 23:11:08 -08:00 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitterDate: Fri, 06 Mar 2020 08:36:46 -03:00
tools: Fix off-by 1 relative directory includes
This is currently working due to extra include paths in the build.
Committer testing:
$ cd tools/include/uapi/asm/
Before this patch:
$ ls -la ../../arch/x86/include/uapi/asm/errno.h ls: cannot access '../../arch/x86/include/uapi/asm/errno.h': No such file or directory $
After this patch;
$ ls -la ../../../arch/x86/include/uapi/asm/errno.h -rw-rw-r--. 1 acme acme 31 Feb 20 12:42 ../../../arch/x86/include/uapi/asm/errno.h $
Check that that is still under tools/, i.e. hasn't escaped into the main kernel sources:
$ cd ../../../arch/x86/include/uapi/asm/ $ pwd /home/acme/git/perf/tools/arch/x86/include/uapi/asm $
--- tools/include/uapi/asm/errno.h | 14 +++++------ tools/perf/arch/arm64/util/arm-spe.c | 20 +++++++-------- tools/perf/arch/arm64/util/perf_regs.c | 2 +- tools/perf/arch/powerpc/util/perf_regs.c | 4 +-- tools/perf/arch/x86/util/auxtrace.c | 14 +++++------ tools/perf/arch/x86/util/event.c | 12 ++++----- tools/perf/arch/x86/util/header.c | 4 +-- tools/perf/arch/x86/util/intel-bts.c | 24 +++++++++--------- tools/perf/arch/x86/util/intel-pt.c | 30 +++++++++++------------ tools/perf/arch/x86/util/machine.c | 6 ++--- tools/perf/arch/x86/util/perf_regs.c | 8 +++--- tools/perf/arch/x86/util/pmu.c | 6 ++--- 12 files changed, 72 insertions(+), 72 deletions(-)
tools/include/uapi/asm/errno.h +7 -7
@@ -1,18 +1,18 @@/* SPDX-License-Identifier: GPL-2.0 */ #if defined(__i386__) || defined(__x86_64__) -#include "../../arch/x86/include/uapi/asm/errno.h" +#include "../../../arch/x86/include/uapi/asm/errno.h" #elif defined(__powerpc__) -#include "../../arch/powerpc/include/uapi/asm/errno.h" +#include "../../../arch/powerpc/include/uapi/asm/errno.h" #elif defined(__sparc__) -#include "../../arch/sparc/include/uapi/asm/errno.h" +#include "../../../arch/sparc/include/uapi/asm/errno.h" #elif defined(__alpha__) -#include "../../arch/alpha/include/uapi/asm/errno.h" +#include "../../../arch/alpha/include/uapi/asm/errno.h" #elif defined(__mips__) -#include "../../arch/mips/include/uapi/asm/errno.h" +#include "../../../arch/mips/include/uapi/asm/errno.h" #elif defined(__ia64__) -#include "../../arch/ia64/include/uapi/asm/errno.h" +#include "../../../arch/ia64/include/uapi/asm/errno.h" #elif defined(__xtensa__) -#include "../../arch/xtensa/include/uapi/asm/errno.h" +#include "../../../arch/xtensa/include/uapi/asm/errno.h" #else #include <asm-generic/errno.h> #endif
tools/perf/arch/arm64/util/arm-spe.c +10 -10
@@ -11,17 +11,17 @@#include <linux/zalloc.h> #include <time.h> -#include "../../util/cpumap.h" -#include "../../util/event.h" -#include "../../util/evsel.h" -#include "../../util/evlist.h" -#include "../../util/session.h" +#include "../../../util/cpumap.h" +#include "../../../util/event.h" +#include "../../../util/evsel.h" +#include "../../../util/evlist.h" +#include "../../../util/session.h" #include <internal/lib.h> // page_size -#include "../../util/pmu.h" -#include "../../util/debug.h" -#include "../../util/auxtrace.h" -#include "../../util/record.h" -#include "../../util/arm-spe.h" +#include "../../../util/pmu.h" +#include "../../../util/debug.h" +#include "../../../util/auxtrace.h" +#include "../../../util/record.h" +#include "../../../util/arm-spe.h" #define KiB (x) ((x) * 1024)#define MiB (x) ((x) * 1024 * 1024)
tools/perf/arch/arm64/util/perf_regs.c +1 -1
@@ -1,5 +1,5 @@// SPDX-License-Identifier: GPL-2.0 -#include "../../util/perf_regs.h" +#include "../../../util/perf_regs.h" const struct sample_reg sample_reg_masks[] = {SMPL_REG_END
tools/perf/arch/powerpc/util/perf_regs.c +2 -2
@@ -4,8 +4,8 @@#include <regex.h> #include <linux/zalloc.h> -#include "../../util/perf_regs.h" -#include "../../util/debug.h" +#include "../../../util/perf_regs.h" +#include "../../../util/debug.h" #include <linux/kernel.h>
tools/perf/arch/x86/util/auxtrace.c +7 -7
@@ -7,13 +7,13 @@#include <errno.h> #include <stdbool.h> -#include "../../util/header.h" -#include "../../util/debug.h" -#include "../../util/pmu.h" -#include "../../util/auxtrace.h" -#include "../../util/intel-pt.h" -#include "../../util/intel-bts.h" -#include "../../util/evlist.h" +#include "../../../util/header.h" +#include "../../../util/debug.h" +#include "../../../util/pmu.h" +#include "../../../util/auxtrace.h" +#include "../../../util/intel-pt.h" +#include "../../../util/intel-bts.h" +#include "../../../util/evlist.h" static struct auxtrace_record *auxtrace_record__init_intel(struct evlist *evlist,
tools/perf/arch/x86/util/event.c +6 -6
@@ -3,12 +3,12 @@#include <linux/string.h> #include <linux/zalloc.h> -#include "../../util/event.h" -#include "../../util/synthetic-events.h" -#include "../../util/machine.h" -#include "../../util/tool.h" -#include "../../util/map.h" -#include "../../util/debug.h" +#include "../../../util/event.h" +#include "../../../util/synthetic-events.h" +#include "../../../util/machine.h" +#include "../../../util/tool.h" +#include "../../../util/map.h" +#include "../../../util/debug.h" #if defined(__x86_64__)
tools/perf/arch/x86/util/header.c +2 -2
@@ -7,8 +7,8 @@#include <string.h> #include <regex.h> -#include "../../util/debug.h" -#include "../../util/header.h" +#include "../../../util/debug.h" +#include "../../../util/header.h" static inline void cpuid(unsigned int op, unsigned int *a, unsigned int *b, unsigned int *c,
tools/perf/arch/x86/util/intel-bts.c +12 -12
@@ -11,18 +11,18 @@#include <linux/log2.h> #include <linux/zalloc.h> -#include "../../util/cpumap.h" -#include "../../util/event.h" -#include "../../util/evsel.h" -#include "../../util/evlist.h" -#include "../../util/mmap.h" -#include "../../util/session.h" -#include "../../util/pmu.h" -#include "../../util/debug.h" -#include "../../util/record.h" -#include "../../util/tsc.h" -#include "../../util/auxtrace.h" -#include "../../util/intel-bts.h" +#include "../../../util/cpumap.h" +#include "../../../util/event.h" +#include "../../../util/evsel.h" +#include "../../../util/evlist.h" +#include "../../../util/mmap.h" +#include "../../../util/session.h" +#include "../../../util/pmu.h" +#include "../../../util/debug.h" +#include "../../../util/record.h" +#include "../../../util/tsc.h" +#include "../../../util/auxtrace.h" +#include "../../../util/intel-bts.h" #include <internal/lib.h> // page_size #define KiB (x) ((x) * 1024)
tools/perf/arch/x86/util/intel-pt.c +15 -15
@@ -13,23 +13,23 @@#include <linux/zalloc.h> #include <cpuid.h> -#include "../../util/session.h" -#include "../../util/event.h" -#include "../../util/evlist.h" -#include "../../util/evsel.h" -#include "../../util/evsel_config.h" -#include "../../util/cpumap.h" -#include "../../util/mmap.h" +#include "../../../util/session.h" +#include "../../../util/event.h" +#include "../../../util/evlist.h" +#include "../../../util/evsel.h" +#include "../../../util/evsel_config.h" +#include "../../../util/cpumap.h" +#include "../../../util/mmap.h" #include <subcmd/parse-options.h> -#include "../../util/parse-events.h" -#include "../../util/pmu.h" -#include "../../util/debug.h" -#include "../../util/auxtrace.h" -#include "../../util/record.h" -#include "../../util/target.h" -#include "../../util/tsc.h" +#include "../../../util/parse-events.h" +#include "../../../util/pmu.h" +#include "../../../util/debug.h" +#include "../../../util/auxtrace.h" +#include "../../../util/record.h" +#include "../../../util/target.h" +#include "../../../util/tsc.h" #include <internal/lib.h> // page_size -#include "../../util/intel-pt.h" +#include "../../../util/intel-pt.h" #define KiB (x) ((x) * 1024)#define MiB (x) ((x) * 1024 * 1024)
tools/perf/arch/x86/util/machine.c +3 -3
@@ -5,9 +5,9 @@#include <stdlib.h> #include <internal/lib.h> // page_size -#include "../../util/machine.h" -#include "../../util/map.h" -#include "../../util/symbol.h" +#include "../../../util/machine.h" +#include "../../../util/map.h" +#include "../../../util/symbol.h" #include <linux/ctype.h> #include <symbol/kallsyms.h>
tools/perf/arch/x86/util/perf_regs.c +4 -4
@@ -5,10 +5,10 @@#include <linux/kernel.h> #include <linux/zalloc.h> -#include "../../perf-sys.h" -#include "../../util/perf_regs.h" -#include "../../util/debug.h" -#include "../../util/event.h" +#include "../../../perf-sys.h" +#include "../../../util/perf_regs.h" +#include "../../../util/debug.h" +#include "../../../util/event.h" const struct sample_reg sample_reg_masks[] = {SMPL_REG (AX ,PERF_REG_X86_AX ),
tools/perf/arch/x86/util/pmu.c +3 -3
@@ -4,9 +4,9 @@#include <linux/stddef.h> #include <linux/perf_event.h> -#include "../../util/intel-pt.h" -#include "../../util/intel-bts.h" -#include "../../util/pmu.h" +#include "../../../util/intel-pt.h" +#include "../../../util/intel-bts.h" +#include "../../../util/pmu.h" struct perf_event_attr *perf_pmu__get_default_config (struct perf_pmu *pmu__maybe_unused ) {
Ian Rogers
reviewerPATCH 2/3 libperf: avoid redefining _GNU_SOURCE in test
In reply to Ian Rogers_GNU_SOURCE needs to be globally defined to pick up features like asprintf. Add a guard against redefinition in this test.
--- tools/lib/perf/tests/test-evlist.c | 2 ++ 1 file changed, 2 insertions(+)
tools/lib/perf/tests/test-evlist.c +2 -0
@@ -1,5 +1,7 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef _GNU_SOURCE#define _GNU_SOURCE// needed for sched.h to get sched_[gs]etaffinity and CPU_(ZERO,SET) +#endif #include <sched.h> #include <stdio.h> #include <stdarg.h>
Signature · 1 line
2.25.1.481.gfbce0eb801-goog
Re: [PATCH 2/3] libperf: avoid redefining _GNU_SOURCE in test
Em Thu, Mar 05, 2020 at 11:11:09PM -0800, Ian Rogers escreveu:
Quoted 2 lines
_GNU_SOURCEneeds to be globally defined to pick up features like asprintf. Add a guard against redefinition in this test.
Humm, so you're completely sure that the Makefiles that drive the build of this file don't set _GNU_SOURCE? I.e. some explanation in the cset log message about that would help in processing the patch,
- Arnaldo
Quoted 20 lines
Signed-off-by Ian Rogers <[email protected]>--- tools/lib/perf/tests/test-evlist.c | 2 ++ 1 file changed, 2 insertions(+)tools/lib/perf/tests/test-evlist.c +2
-0@@ -1,5 +1,7 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef _GNU_SOURCE#define _GNU_SOURCE// needed for sched.h to get sched_[gs]etaffinity and CPU_(ZERO,SET) +#endif #include <sched.h> #include <stdio.h> #include <stdarg.h> Signature · 1 line
2.25.1.481.gfbce0eb801-goog
Signature · 1 line
- Arnaldo
Ian Rogers
reviewerRe: [PATCH 2/3] libperf: avoid redefining _GNU_SOURCE in test
Quoted 8 lines · Arnaldo Carvalho de Melo
Em Thu, Mar 05, 2020 at 11:11:09PM -0800, Ian Rogers escreveu:
Quoted 2 lines
_GNU_SOURCEneeds to be globally defined to pick up features like asprintf. Add a guard against redefinition in this test.Humm, so you're completely sure that the Makefiles that drive the build of this file don't set
_GNU_SOURCE? I.e. some explanation in the cset log message about that would help in processing the patch,
The convention on _GNU_SOURCE isn't very clear. For our builds we set _GNU_SOURCE globally hence needing this patch. This patch won't interfere with a Makefile setting. Here is some of the inconsistency:
tools/perf: sets _GNU_SOURCE:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tree/tools/perf/Makefile.config#n309
tools/lib/perf: doesn't set _GNU_SOURCE <-- I'm inconsistent in setting _GNU_SOURCE when building files here
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tree/tools/lib/perf/Makefile
tools/lib/subcmd: sets _GNU_SOURCE
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tree/tools/lib/subcmd/Makefile#n43
Some #defines of _GNU_SOURCE are already guarded to avoid redefinition:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tree/tools/lib/bpf/libbpf.c#n13
Some code explicitly undefines _GNU_SOURCE:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tree/tools/lib/str_error_r.c#n2
I don't think this patch hurts, I'm not sure it adds value. I think there's a wider cleanup necessary here but I'm not sure what that would look like.
Thanks,
Ian
Quoted 26 lines
- Arnaldo
Quoted 18 lines
Signed-off-by Ian Rogers <[email protected]>--- tools/lib/perf/tests/test-evlist.c | 2 ++ 1 file changed, 2 insertions(+)tools/lib/perf/tests/test-evlist.c +2
-1@@ -1,5 +1,7 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef _GNU_SOURCE#define _GNU_SOURCE// needed for sched.h to get sched_[gs]etaffinity and CPU_(ZERO,SET) +#endif #include <sched.h> #include <stdio.h> #include <stdarg.h> --Quoted 2 lines
2.25.1.481.gfbce0eb801-goog
--
- Arnaldo
Ian Rogers
reviewerPATCH 3/3 tools/perf: build fixes for arch_errno_names.sh
In reply to Ian RogersAllow the CC compiler to accept a CFLAGS environment variable. Make the architecture test directory agree with the code comment. This doesn't change the code generated but makes it easier to integrate running the shell script in build systems like bazel.
--- tools/perf/trace/beauty/arch_errno_names.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/trace/beauty/arch_errno_names.sh +2 -2
@@ -57,7 +57,7 @@ process_arch() local arch="$1" local asm_errno=$(asm_errno_file "$arch") - $gcc $include_path -E -dM -x c $asm_errno \ + $gcc $CFLAGS $include_path -E -dM -x c $asm_errno \ |grep -hE '^#define[[:blank:]]+(E[^[:blank:]]+)[[:blank:]]+([[:digit:]]+).*' \ |awk '{ print $2","$3; }' \ |sort -t, -k2 -nu \
@@ -91,7 +91,7 @@ EoHEADER # in tools/perf/arch archlist="" for arch in $(find $toolsdir/arch -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | grep -v x86 | sort); do - test -d arch/$arch && archlist="$archlist $arch" + test -d $toolsdir/perf/arch/$arch && archlist="$archlist $arch" done for arch in x86 $archlist generic; do
Signature · 1 line
2.25.1.481.gfbce0eb801-goog
Re: [PATCH 3/3] tools/perf: build fixes for arch_errno_names.sh
Em Thu, Mar 05, 2020 at 11:11:10PM -0800, Ian Rogers escreveu:
Quoted 4 lines
Allow the CC compiler to accept a CFLAGS environment variable. Make the architecture test directory agree with the code comment. This doesn't change the code generated but makes it easier to integrate running the shell script in build systems like bazel.
Hendrik and Thomas, can you please take a look at this and provide a Reviewed-by tag?
Thanks,
- Arnaldo
Quoted 30 lines
Signed-off-by Ian Rogers <[email protected]>--- tools/perf/trace/beauty/arch_errno_names.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/perf/trace/beauty/arch_errno_names.sh +2
-2@@ -57,7 +57,7 @@ process_arch() local arch="$1" local asm_errno=$(asm_errno_file "$arch") - $gcc $include_path -E -dM -x c $asm_errno \ + $gcc $CFLAGS $include_path -E -dM -x c $asm_errno \ |grep -hE '^#define[[:blank:]]+(E[^[:blank:]]+)[[:blank:]]+([[:digit:]]+).*' \ |awk '{ print $2","$3; }' \ |sort -t, -k2 -nu \@@ -91,7 +91,7 @@ EoHEADER # in tools/perf/arch archlist="" for arch in $(find $toolsdir/arch -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | grep -v x86 | sort); do - test -d arch/$arch && archlist="$archlist $arch" + test -d $toolsdir/perf/arch/$arch && archlist="$archlist $arch" done for arch in x86 $archlist generic; doSignature · 1 line
2.25.1.481.gfbce0eb801-goog
Signature · 1 line
- Arnaldo
Ian Rogers
reviewerRe: [PATCH 3/3] tools/perf: build fixes for arch_errno_names.sh
Quoted 9 lines · Arnaldo Carvalho de Melo
Em Thu, Mar 05, 2020 at 11:11:10PM -0800, Ian Rogers escreveu:
Quoted 4 lines
Allow the CC compiler to accept a CFLAGS environment variable. Make the architecture test directory agree with the code comment. This doesn't change the code generated but makes it easier to integrate running the shell script in build systems like bazel.
Hendrik and Thomas, can you please take a look at this and provide a Reviewed-by tag?
Ping.
Quoted 38 lines
Thanks,
- Arnaldo
Quoted 28 lines
Signed-off-by Ian Rogers <[email protected]>--- tools/perf/trace/beauty/arch_errno_names.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/perf/trace/beauty/arch_errno_names.sh +2
-3@@ -57,7 +57,7 @@ process_arch() local arch="$1" local asm_errno=$(asm_errno_file "$arch") - $gcc $include_path -E -dM -x c $asm_errno \ + $gcc $CFLAGS $include_path -E -dM -x c $asm_errno \ |grep -hE '^#define[[:blank:]]+(E[^[:blank:]]+)[[:blank:]]+([[:digit:]]+).*' \ |awk '{ print $2","$3; }' \ |sort -t, -k2 -nu \@@ -91,7 +91,7 @@ EoHEADER # in tools/perf/arch archlist="" for arch in $(find $toolsdir/arch -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | grep -v x86 | sort); do - test -d arch/$arch && archlist="$archlist $arch" + test -d $toolsdir/perf/arch/$arch && archlist="$archlist $arch" done for arch in x86 $archlist generic; do --Quoted 2 lines
2.25.1.481.gfbce0eb801-goog
--
- Arnaldo
Re: [PATCH 3/3] tools/perf: build fixes for arch_errno_names.sh
In reply to Ian RogersEm Thu, Mar 05, 2020 at 11:11:10PM -0800, Ian Rogers escreveu:
Quoted 4 lines
Allow the CC compiler to accept a CFLAGS environment variable. Make the architecture test directory agree with the code comment. This doesn't change the code generated but makes it easier to integrate running the shell script in build systems like bazel.
I've looked at this and split this part in a separate patch, and applied it locally, please take a look, now looking at the other bit of the patch.
- Arnaldo
Quoted 11 lines
Signed-off-by Ian Rogers <[email protected]>--- tools/perf/trace/beauty/arch_errno_names.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/perf/trace/beauty/arch_errno_names.sh +0
-0
tools/perf/trace/beauty/arch_errno_names.sh EoHEADER · line 97
Quoted 8 lines
tools/perf/trace/beauty/arch_errno_names.sh +1
-1@@ -91,7 +91,7 @@ EoHEADER # in tools/perf/arch archlist="" for arch in $(find $toolsdir/arch -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | grep -v x86 | sort); do - test -d arch/$arch && archlist="$archlist $arch" + test -d $toolsdir/perf/arch/$arch && archlist="$archlist $arch" done for arch in x86 $archlist generic; do
commit 1b59e3b7bfc6183d3dc9f119e1875f9607d29d96
Author: Ian Rogers <[email protected]> Date: Thu Mar 5 23:11:10 2020 -0800
perf trace: Fix the selection for architectures to generate the errno name tables
Make the architecture test directory agree with the code comment.
Committer notes:
This was split from a larger patch.
The code was assuming the developer always worked from tools/perf/, so make sure we do the test -d having $toolsdir/perf/arch/$arch, to match the intent expressed in the comment, just above that loop.
tools/perf/trace/beauty/arch_errno_names.sh +1 -1
@@ -91,7 +91,7 @@ EoHEADER # in tools/perf/arch archlist="" for arch in $(find $toolsdir/arch -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | grep -v x86 | sort); do - test -d arch/$arch && archlist="$archlist $arch" + test -d $toolsdir/perf/arch/$arch && archlist="$archlist $arch" done for arch in x86 $archlist generic; do
Ian Rogers
reviewerRe: [PATCH 3/3] tools/perf: build fixes for arch_errno_names.sh
Quoted 10 lines · Arnaldo Carvalho de Melo
Em Thu, Mar 05, 2020 at 11:11:10PM -0800, Ian Rogers escreveu:
Quoted 4 lines
Allow the CC compiler to accept a CFLAGS environment variable. Make the architecture test directory agree with the code comment. This doesn't change the code generated but makes it easier to integrate running the shell script in build systems like bazel.
I've looked at this and split this part in a separate patch, and applied it locally, please take a look, now looking at the other bit of the patch.
This bit looks good. The CFLAGS change is something I need to deal with a directory layout change in our build system.
Thanks,
Ian
Quoted 70 lines
- Arnaldo
Quoted 10 lines
Signed-off-by Ian Rogers <[email protected]>--- tools/perf/trace/beauty/arch_errno_names.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/perf/trace/beauty/arch_errno_names.sh +0
-0tools/perf/trace/beauty/arch_errno_names.sh EoHEADER
Quoted 9 lines
tools/perf/trace/beauty/arch_errno_names.sh +1
-2@@ -91,7 +91,7 @@ EoHEADER # in tools/perf/arch archlist="" for arch in $(find $toolsdir/arch -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | grep -v x86 | sort); do - test -d arch/$arch && archlist="$archlist $arch" + test -d $toolsdir/perf/arch/$arch && archlist="$archlist $arch" done for arch in x86 $archlist generic; do --commit
1b59e3b7bfc6183d3dc9f119e1875f9607d29d96Author: Ian Rogers <[email protected]> Date: Thu Mar 5 23:11:10 2020 -0800perf trace: Fix the selection for architectures to generate the errno name tables
Make the architecture test directory agree with the code comment.
Committer notes:
This was split from a larger patch.
The code was assuming the developer always worked from
tools/perf/, so make sure we do the test -d having $toolsdir/perf/arch/$arch, to match the intent expressed in the comment, just above that loop.Signed-off-by Ian Rogers <[email protected]>Cc Adrian Hunter <[email protected]>Cc Alexander Shishkin <[email protected]>Cc Alexios Zavras <[email protected]>Cc Andi Kleen <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Igor Lubashev <[email protected]>Cc Jiri Olsa <[email protected]>Cc Kan Liang <[email protected]>Cc Mark Rutland <[email protected]>Cc Mathieu Poirier <[email protected]>Cc Namhyung Kim <[email protected]>Cc Nick Desaulniers <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Stephane Eranian <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Wei Li <[email protected]>Signed-off-by Arnaldo Carvalho de Melo <[email protected]>tools/perf/trace/beauty/arch_errno_names.sh +1
-1@@ -91,7 +91,7 @@ EoHEADER # in tools/perf/arch archlist="" for arch in $(find $toolsdir/arch -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | grep -v x86 | sort); do - test -d arch/$arch && archlist="$archlist $arch" + test -d $toolsdir/perf/arch/$arch && archlist="$archlist $arch" done for arch in x86 $archlist generic; do
Re: [PATCH 3/3] tools/perf: build fixes for arch_errno_names.sh
Em Thu, May 14, 2020 at 10:54:49AM -0700, Ian Rogers escreveu:
Quoted 9 lines
Quoted 7 lines · Arnaldo Carvalho de Melo
Em Thu, Mar 05, 2020 at 11:11:10PM -0800, Ian Rogers escreveu:
Quoted 4 lines
Allow the CC compiler to accept a CFLAGS environment variable. Make the architecture test directory agree with the code comment. This doesn't change the code generated but makes it easier to integrate running the shell script in build systems like bazel.
Quoted 7 lines
Quoted 3 lines
I've looked at this and split this part in a separate patch, and applied it locally, please take a look, now looking at the other bit of the patch.
This bit looks good. The CFLAGS change is something I need to deal with a directory layout change in our build system.
I added that one as well, as a separate patch, this one:
commit 6e136ceba23c087b1e1b846914e425706d492a3a
Author: Ian Rogers <[email protected]> Date: Thu Mar 5 23:11:10 2020 -0800
perf beauty: Allow the CC used in the arch errno names script to acccept CFLAGS
Allow the CC compiler to accept a CFLAGS environment variable. This doesn't change the code generated but makes it easier to integrate running the shell script in build systems like bazel.
tools/perf/trace/beauty/arch_errno_names.sh +1 -1
@@ -57,7 +57,7 @@ process_arch() local arch="$1" local asm_errno=$(asm_errno_file "$arch") - $gcc $include_path -E -dM -x c $asm_errno \ + $gcc $CFLAGS $include_path -E -dM -x c $asm_errno \ |grep -hE '^#define[[:blank:]]+(E[^[:blank:]]+)[[:blank:]]+([[:digit:]]+).*' \ |awk '{ print $2","$3; }' \ |sort -t, -k2 -nu \
Quoted 7 lines · Ian Rogers
These patches better enable a build of perf when not using the regular Makefiles, in my case using bazel.
Ian Rogers (3):
tools: fix off-by 1 relative directory includes
libperf: avoid redefining_GNU_SOURCEin test
tools/perf: build fixes forarch_errno_names.sh
thanks,
jirka
Quoted 20 lines
tools/include/uapi/asm/errno.h | 14 +++++----- tools/lib/perf/tests/test-evlist.c | 2 ++ tools/perf/arch/arm64/util/arm-spe.c | 20 +++++++------- tools/perf/arch/arm64/util/perf_regs.c | 2 +- tools/perf/arch/powerpc/util/perf_regs.c | 4 +-- tools/perf/arch/x86/util/auxtrace.c | 14 +++++----- tools/perf/arch/x86/util/event.c | 12 ++++----- tools/perf/arch/x86/util/header.c | 4 +-- tools/perf/arch/x86/util/intel-bts.c | 24 ++++++++--------- tools/perf/arch/x86/util/intel-pt.c | 30 ++++++++++----------- tools/perf/arch/x86/util/machine.c | 6 ++--- tools/perf/arch/x86/util/perf_regs.c | 8 +++--- tools/perf/arch/x86/util/pmu.c | 6 ++--- tools/perf/trace/beauty/arch_errno_names.sh | 4 +-- 14 files changed, 76 insertions(+), 74 deletions(-)Signature · 1 line
2.25.1.481.gfbce0eb801-goog