linux-stable/tools/perf
Arnaldo Carvalho de Melo 7aea2f94cc perf bench numa: Add define for RUSAGE_THREAD if not present
[ Upstream commit bf561d3c13 ]

While cross building perf to the ARC architecture on a fedora 30 host,
we were failing with:

      CC       /tmp/build/perf/bench/numa.o
  bench/numa.c: In function ‘worker_thread’:
  bench/numa.c:1261:12: error: ‘RUSAGE_THREAD’ undeclared (first use in this function); did you mean ‘SIGEV_THREAD’?
    getrusage(RUSAGE_THREAD, &rusage);
              ^~~~~~~~~~~~~
              SIGEV_THREAD
  bench/numa.c:1261:12: note: each undeclared identifier is reported only once for each function it appears in

[perfbuilder@60d5802468f6 perf]$ /arc_gnu_2019.03-rc1_prebuilt_uclibc_le_archs_linux_install/bin/arc-linux-gcc --version | head -1
arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225
[perfbuilder@60d5802468f6 perf]$

Trying to reproduce a report by Vineet, I noticed that, with just
cross-built zlib and numactl libraries, I ended up with the above
failure.

So, since RUSAGE_THREAD is available as a define, check for that and
numactl libraries, I ended up with the above failure.

So, since RUSAGE_THREAD is available as a define in the system headers,
check if it is defined in the 'perf bench numa' sources and define it if
not.

Now it builds and I have to figure out if the problem reported by Vineet
only takes place if we have libelf or some other library available.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: linux-snps-arc@lists.infradead.org
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Link: https://lkml.kernel.org/n/tip-2wb4r1gir9xrevbpq7qp0amk@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-05-25 18:23:46 +02:00
..
arch perf tools: Add Hygon Dhyana support 2019-02-12 19:47:01 +01:00
bench perf bench numa: Add define for RUSAGE_THREAD if not present 2019-05-25 18:23:46 +02:00
Documentation perf config: Fix an error in the config template documentation 2019-04-20 09:15:57 +02:00
examples/bpf perf trace: Handle "bpf-output" events associated with "__augmented_syscalls__" BPF map 2018-08-08 15:55:57 -03:00
include/bpf perf bpf: Add wrappers to BPF_FUNC_probe_read(_str) functions 2018-08-08 15:55:57 -03:00
jvmti perf tools: Fix undefined symbol scnprintf in libperf-jvmti.so 2018-11-27 16:13:06 +01:00
pmu-events perf vendor events intel: Fix Load_Miss_Real_Latency on SKL/SKX 2019-01-26 09:32:40 +01:00
python
scripts perf script python: Fix export-to-sqlite.py sample columns 2018-09-25 11:37:05 -03:00
tests perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() 2019-04-20 09:15:58 +02:00
trace perf trace beauty: Add beautifiers for 'socket''s 'protocol' arg 2018-07-31 10:52:47 -03:00
ui perf annotate: Add support to toggle percent type 2018-08-08 15:55:52 -03:00
util perf intel-pt: Fix sample timestamp wrt non-taken branches 2019-05-25 18:23:33 +02:00
.gitignore
Build
builtin-annotate.c perf annotate: Add --percent-type option 2018-08-08 15:55:53 -03:00
builtin-bench.c
builtin-buildid-cache.c perf buildid-cache: Warn --purge-all failures 2018-05-15 10:32:16 -03:00
builtin-buildid-list.c
builtin-c2c.c perf c2c: Fix c2c report for empty numa node 2019-04-05 22:32:57 +02:00
builtin-config.c
builtin-data.c
builtin-diff.c perf hists: Clarify callchain disabling when available 2018-07-24 14:37:33 -03:00
builtin-evlist.c
builtin-ftrace.c
builtin-help.c perf tools: Rename HAVE_SYSCALL_TABLE to HAVE_SYSCALL_TABLE_SUPPORT 2018-04-12 10:33:31 -03:00
builtin-inject.c perf thread: Make thread__find_map() return the map 2018-04-26 13:47:08 -03:00
builtin-kallsyms.c perf machine: Ditch find_kernel_function variants 2018-04-30 12:20:54 -03:00
builtin-kmem.c tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag' 2018-08-13 15:22:18 -03:00
builtin-kvm.c perf tools: Ditch the symbol_conf.nr_events global 2018-06-04 10:28:52 -03:00
builtin-list.c
builtin-lock.c
builtin-mem.c perf mem: Allow all record/report options 2018-04-18 15:35:48 -03:00
builtin-probe.c perf tools: No need to check if the argument to __get() function is NULL 2018-06-04 10:28:50 -03:00
builtin-record.c
builtin-report.c perf evsel: Store ids for events with their own cpus perf_event__synthesize_event_update_cpus 2018-10-16 08:18:52 -03:00
builtin-sched.c perf sched: Use sched->show_callchain where appropriate 2018-06-05 10:09:54 -03:00
builtin-script.c perf script: Fix crash when processing recorded stat data 2019-03-13 14:02:26 -07:00
builtin-stat.c perf stat: Avoid segfaults caused by negated options 2019-01-26 09:32:41 +01:00
builtin-timechart.c perf tools: Add missing open_memstream() prototype for systems lacking it 2019-01-26 09:32:41 +01:00
builtin-top.c perf top: Fix error handling in cmd_top() 2019-04-20 09:15:57 +02:00
builtin-trace.c perf trace: Support multiple "vfs_getname" probes 2019-03-13 14:02:37 -07:00
builtin-version.c perf version: Print status for syscall_table 2018-04-12 10:33:34 -03:00
builtin.h
check-headers.sh tools include: Adopt linux/bits.h 2019-04-27 09:36:40 +02:00
command-list.txt
CREDITS
design.txt
Makefile perf tools: Disable parallelism for 'make clean' 2018-08-20 08:54:58 -03:00
Makefile.config perf build: Don't unconditionally link the libbfd feature test to -liberty and -lz 2019-02-12 19:47:16 +01:00
Makefile.perf perf tools: Pass build flags to traceevent build 2018-10-16 14:57:59 -03:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c perf tools: Remove dead quote.[ch] code 2018-06-04 10:28:50 -03:00
perf.h perf tools: Allow overriding MAX_NR_CPUS at compile time 2018-08-01 12:33:24 -03:00