]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/perf-bench-numa-add-define-for-rusage_thread-if-not-.patch
drop drm-rockchip-shutdown-drm-subsystem-on-shutdown.patch from 4.4.y and 4.9.y
[thirdparty/kernel/stable-queue.git] / queue-4.4 / perf-bench-numa-add-define-for-rusage_thread-if-not-.patch
CommitLineData
1aa7b030
SL
1From 7589a886eef9b660d7bc35d58597ffb0972223f6 Mon Sep 17 00:00:00 2001
2From: Arnaldo Carvalho de Melo <acme@redhat.com>
3Date: Thu, 25 Apr 2019 18:36:51 -0300
4Subject: perf bench numa: Add define for RUSAGE_THREAD if not present
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9[ Upstream commit bf561d3c13423fc54daa19b5d49dc15fafdb7acc ]
10
11While cross building perf to the ARC architecture on a fedora 30 host,
12we were failing with:
13
14 CC /tmp/build/perf/bench/numa.o
15 bench/numa.c: In function ‘worker_thread’:
16 bench/numa.c:1261:12: error: ‘RUSAGE_THREAD’ undeclared (first use in this function); did you mean ‘SIGEV_THREAD’?
17 getrusage(RUSAGE_THREAD, &rusage);
18 ^~~~~~~~~~~~~
19 SIGEV_THREAD
20 bench/numa.c:1261:12: note: each undeclared identifier is reported only once for each function it appears in
21
22[perfbuilder@60d5802468f6 perf]$ /arc_gnu_2019.03-rc1_prebuilt_uclibc_le_archs_linux_install/bin/arc-linux-gcc --version | head -1
23arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225
24[perfbuilder@60d5802468f6 perf]$
25
26Trying to reproduce a report by Vineet, I noticed that, with just
27cross-built zlib and numactl libraries, I ended up with the above
28failure.
29
30So, since RUSAGE_THREAD is available as a define, check for that and
31numactl libraries, I ended up with the above failure.
32
33So, since RUSAGE_THREAD is available as a define in the system headers,
34check if it is defined in the 'perf bench numa' sources and define it if
35not.
36
37Now it builds and I have to figure out if the problem reported by Vineet
38only takes place if we have libelf or some other library available.
39
40Cc: Arnd Bergmann <arnd@arndb.de>
41Cc: Jiri Olsa <jolsa@kernel.org>
42Cc: linux-snps-arc@lists.infradead.org
43Cc: Namhyung Kim <namhyung@kernel.org>
44Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
45Link: https://lkml.kernel.org/n/tip-2wb4r1gir9xrevbpq7qp0amk@git.kernel.org
46Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
47Signed-off-by: Sasha Levin <sashal@kernel.org>
48---
49 tools/perf/bench/numa.c | 4 ++++
50 1 file changed, 4 insertions(+)
51
52diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
53index 73d192f57dc34..df41deed0320e 100644
54--- a/tools/perf/bench/numa.c
55+++ b/tools/perf/bench/numa.c
56@@ -32,6 +32,10 @@
57 #include <numa.h>
58 #include <numaif.h>
59
60+#ifndef RUSAGE_THREAD
61+# define RUSAGE_THREAD 1
62+#endif
63+
64 /*
65 * Regular printout to the terminal, supressed if -q is specified:
66 */
67--
682.20.1
69