summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing Liu <ting.liu@nxp.com>2020-09-09 14:09:16 +0530
committerOtavio Salvador <otavio@ossystems.com.br>2020-09-09 08:54:34 -0300
commit902fad9d4ec801d53b09c0010c0c8dea0cc22045 (patch)
tree12c21dc34be53f31e1a6f1d6717b98e9c8b1536f
parentc4ac2aee0eeca51a8983e92635766eff43fd88d1 (diff)
downloadmeta-freescale-902fad9d4ec801d53b09c0010c0c8dea0cc22045.tar.gz
linux-qoriq: backport to fix perf compilation issue
Signed-off-by: Ting Liu <ting.liu@nxp.com>
-rw-r--r--recipes-kernel/linux/linux-qoriq/0001-libtraceevent-Fix-build-with-binutils-2.35.patch38
-rw-r--r--recipes-kernel/linux/linux-qoriq/0001-perf-bench-Share-some-global-variables-to-fix-build-.patch239
-rw-r--r--recipes-kernel/linux/linux-qoriq/0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch68
-rw-r--r--recipes-kernel/linux/linux-qoriq/0001-perf-tests-bp_account-Make-global-variable-static.patch42
-rw-r--r--recipes-kernel/linux/linux-qoriq_5.4.bb4
5 files changed, 391 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-qoriq/0001-libtraceevent-Fix-build-with-binutils-2.35.patch b/recipes-kernel/linux/linux-qoriq/0001-libtraceevent-Fix-build-with-binutils-2.35.patch
new file mode 100644
index 00000000..b1d07fc4
--- /dev/null
+++ b/recipes-kernel/linux/linux-qoriq/0001-libtraceevent-Fix-build-with-binutils-2.35.patch
@@ -0,0 +1,38 @@
1From 39efdd94e314336f4acbac4c07e0f37bdc3bef71 Mon Sep 17 00:00:00 2001
2From: Ben Hutchings <ben@decadent.org.uk>
3Date: Sat, 25 Jul 2020 02:06:23 +0100
4Subject: [PATCH] libtraceevent: Fix build with binutils 2.35
5
6In binutils 2.35, 'nm -D' changed to show symbol versions along with
7symbol names, with the usual @@ separator. When generating
8libtraceevent-dynamic-list we need just the names, so strip off the
9version suffix if present.
10
11Upstream-Status: Backport
12
13Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
14Tested-by: Salvatore Bonaccorso <carnil@debian.org>
15Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
16Cc: linux-trace-devel@vger.kernel.org
17Cc: stable@vger.kernel.org
18Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
19---
20 tools/lib/traceevent/plugins/Makefile | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/tools/lib/traceevent/plugins/Makefile b/tools/lib/traceevent/plugins/Makefile
24index 349bb81482ab..680d883efe05 100644
25--- a/tools/lib/traceevent/plugins/Makefile
26+++ b/tools/lib/traceevent/plugins/Makefile
27@@ -197,7 +197,7 @@ define do_generate_dynamic_list_file
28 xargs echo "U w W" | tr 'w ' 'W\n' | sort -u | xargs echo`;\
29 if [ "$$symbol_type" = "U W" ];then \
30 (echo '{'; \
31- $(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u;\
32+ $(NM) -u -D $1 | awk 'NF>1 {sub("@.*", "", $$2); print "\t"$$2";"}' | sort -u;\
33 echo '};'; \
34 ) > $2; \
35 else \
36--
372.17.1
38
diff --git a/recipes-kernel/linux/linux-qoriq/0001-perf-bench-Share-some-global-variables-to-fix-build-.patch b/recipes-kernel/linux/linux-qoriq/0001-perf-bench-Share-some-global-variables-to-fix-build-.patch
new file mode 100644
index 00000000..b18ae803
--- /dev/null
+++ b/recipes-kernel/linux/linux-qoriq/0001-perf-bench-Share-some-global-variables-to-fix-build-.patch
@@ -0,0 +1,239 @@
1From e4d9b04b973b2dbce7b42af95ea70d07da1c936d Mon Sep 17 00:00:00 2001
2From: Arnaldo Carvalho de Melo <acme@redhat.com>
3Date: Mon, 2 Mar 2020 12:09:38 -0300
4Subject: [PATCH] perf bench: Share some global variables to fix build with gcc
5 10
6
7Noticed with gcc 10 (fedora rawhide) that those variables were not being
8declared as static, so end up with:
9
10 ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `end'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
11 ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `start'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
12 ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `runtime'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
13 ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `end'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
14 ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `start'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
15 ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `runtime'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
16 make[4]: *** [/git/perf/tools/build/Makefile.build:145: /tmp/build/perf/bench/perf-in.o] Error 1
17
18Prefix those with bench__ and add them to bench/bench.h, so that we can
19share those on the tools needing to access those variables from signal
20handlers.
21
22Upstream-Status: Backport
23
24Acked-by: Thomas Gleixner <tglx@linutronix.de>
25Cc: Adrian Hunter <adrian.hunter@intel.com>
26Cc: Davidlohr Bueso <dave@stgolabs.net>
27Cc: Jiri Olsa <jolsa@kernel.org>
28Cc: Namhyung Kim <namhyung@kernel.org>
29Link: http://lore.kernel.org/lkml/20200303155811.GD13702@kernel.org
30Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
31---
32 tools/perf/bench/bench.h | 4 ++++
33 tools/perf/bench/epoll-ctl.c | 7 +++----
34 tools/perf/bench/epoll-wait.c | 11 +++++------
35 tools/perf/bench/futex-hash.c | 12 ++++++------
36 tools/perf/bench/futex-lock-pi.c | 11 +++++------
37 5 files changed, 23 insertions(+), 22 deletions(-)
38
39diff --git a/tools/perf/bench/bench.h b/tools/perf/bench/bench.h
40index fddb3ced9db6..4aa6de1aa67d 100644
41--- a/tools/perf/bench/bench.h
42+++ b/tools/perf/bench/bench.h
43@@ -2,6 +2,10 @@
44 #ifndef BENCH_H
45 #define BENCH_H
46
47+#include <sys/time.h>
48+
49+extern struct timeval bench__start, bench__end, bench__runtime;
50+
51 /*
52 * The madvise transparent hugepage constants were added in glibc
53 * 2.13. For compatibility with older versions of glibc, define these
54diff --git a/tools/perf/bench/epoll-ctl.c b/tools/perf/bench/epoll-ctl.c
55index bb617e568841..a7526c05df38 100644
56--- a/tools/perf/bench/epoll-ctl.c
57+++ b/tools/perf/bench/epoll-ctl.c
58@@ -35,7 +35,6 @@
59
60 static unsigned int nthreads = 0;
61 static unsigned int nsecs = 8;
62-struct timeval start, end, runtime;
63 static bool done, __verbose, randomize;
64
65 /*
66@@ -94,8 +93,8 @@ static void toggle_done(int sig __maybe_unused,
67 {
68 /* inform all threads that we're done for the day */
69 done = true;
70- gettimeofday(&end, NULL);
71- timersub(&end, &start, &runtime);
72+ gettimeofday(&bench__end, NULL);
73+ timersub(&bench__end, &bench__start, &bench__runtime);
74 }
75
76 static void nest_epollfd(void)
77@@ -361,7 +360,7 @@ int bench_epoll_ctl(int argc, const char **argv)
78
79 threads_starting = nthreads;
80
81- gettimeofday(&start, NULL);
82+ gettimeofday(&bench__start, NULL);
83
84 do_threads(worker, cpu);
85
86diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-wait.c
87index 7af694437f4e..d1c5cb526b9f 100644
88--- a/tools/perf/bench/epoll-wait.c
89+++ b/tools/perf/bench/epoll-wait.c
90@@ -90,7 +90,6 @@
91
92 static unsigned int nthreads = 0;
93 static unsigned int nsecs = 8;
94-struct timeval start, end, runtime;
95 static bool wdone, done, __verbose, randomize, nonblocking;
96
97 /*
98@@ -276,8 +275,8 @@ static void toggle_done(int sig __maybe_unused,
99 {
100 /* inform all threads that we're done for the day */
101 done = true;
102- gettimeofday(&end, NULL);
103- timersub(&end, &start, &runtime);
104+ gettimeofday(&bench__end, NULL);
105+ timersub(&bench__end, &bench__start, &bench__runtime);
106 }
107
108 static void print_summary(void)
109@@ -287,7 +286,7 @@ static void print_summary(void)
110
111 printf("\nAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n",
112 avg, rel_stddev_stats(stddev, avg),
113- (int) runtime.tv_sec);
114+ (int)bench__runtime.tv_sec);
115 }
116
117 static int do_threads(struct worker *worker, struct perf_cpu_map *cpu)
118@@ -479,7 +478,7 @@ int bench_epoll_wait(int argc, const char **argv)
119
120 threads_starting = nthreads;
121
122- gettimeofday(&start, NULL);
123+ gettimeofday(&bench__start, NULL);
124
125 do_threads(worker, cpu);
126
127@@ -519,7 +518,7 @@ int bench_epoll_wait(int argc, const char **argv)
128 qsort(worker, nthreads, sizeof(struct worker), cmpworker);
129
130 for (i = 0; i < nthreads; i++) {
131- unsigned long t = worker[i].ops/runtime.tv_sec;
132+ unsigned long t = worker[i].ops / bench__runtime.tv_sec;
133
134 update_stats(&throughput_stats, t);
135
136diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c
137index 8ba0c3330a9a..21776862e940 100644
138--- a/tools/perf/bench/futex-hash.c
139+++ b/tools/perf/bench/futex-hash.c
140@@ -37,7 +37,7 @@ static unsigned int nfutexes = 1024;
141 static bool fshared = false, done = false, silent = false;
142 static int futex_flag = 0;
143
144-struct timeval start, end, runtime;
145+struct timeval bench__start, bench__end, bench__runtime;
146 static pthread_mutex_t thread_lock;
147 static unsigned int threads_starting;
148 static struct stats throughput_stats;
149@@ -103,8 +103,8 @@ static void toggle_done(int sig __maybe_unused,
150 {
151 /* inform all threads that we're done for the day */
152 done = true;
153- gettimeofday(&end, NULL);
154- timersub(&end, &start, &runtime);
155+ gettimeofday(&bench__end, NULL);
156+ timersub(&bench__end, &bench__start, &bench__runtime);
157 }
158
159 static void print_summary(void)
160@@ -114,7 +114,7 @@ static void print_summary(void)
161
162 printf("%sAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n",
163 !silent ? "\n" : "", avg, rel_stddev_stats(stddev, avg),
164- (int) runtime.tv_sec);
165+ (int)bench__runtime.tv_sec);
166 }
167
168 int bench_futex_hash(int argc, const char **argv)
169@@ -161,7 +161,7 @@ int bench_futex_hash(int argc, const char **argv)
170
171 threads_starting = nthreads;
172 pthread_attr_init(&thread_attr);
173- gettimeofday(&start, NULL);
174+ gettimeofday(&bench__start, NULL);
175 for (i = 0; i < nthreads; i++) {
176 worker[i].tid = i;
177 worker[i].futex = calloc(nfutexes, sizeof(*worker[i].futex));
178@@ -204,7 +204,7 @@ int bench_futex_hash(int argc, const char **argv)
179 pthread_mutex_destroy(&thread_lock);
180
181 for (i = 0; i < nthreads; i++) {
182- unsigned long t = worker[i].ops/runtime.tv_sec;
183+ unsigned long t = worker[i].ops / bench__runtime.tv_sec;
184 update_stats(&throughput_stats, t);
185 if (!silent) {
186 if (nfutexes == 1)
187diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c
188index d0cae8125423..30d97121dc4f 100644
189--- a/tools/perf/bench/futex-lock-pi.c
190+++ b/tools/perf/bench/futex-lock-pi.c
191@@ -37,7 +37,6 @@ static bool silent = false, multi = false;
192 static bool done = false, fshared = false;
193 static unsigned int nthreads = 0;
194 static int futex_flag = 0;
195-struct timeval start, end, runtime;
196 static pthread_mutex_t thread_lock;
197 static unsigned int threads_starting;
198 static struct stats throughput_stats;
199@@ -64,7 +63,7 @@ static void print_summary(void)
200
201 printf("%sAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n",
202 !silent ? "\n" : "", avg, rel_stddev_stats(stddev, avg),
203- (int) runtime.tv_sec);
204+ (int)bench__runtime.tv_sec);
205 }
206
207 static void toggle_done(int sig __maybe_unused,
208@@ -73,8 +72,8 @@ static void toggle_done(int sig __maybe_unused,
209 {
210 /* inform all threads that we're done for the day */
211 done = true;
212- gettimeofday(&end, NULL);
213- timersub(&end, &start, &runtime);
214+ gettimeofday(&bench__end, NULL);
215+ timersub(&bench__end, &bench__start, &bench__runtime);
216 }
217
218 static void *workerfn(void *arg)
219@@ -185,7 +184,7 @@ int bench_futex_lock_pi(int argc, const char **argv)
220
221 threads_starting = nthreads;
222 pthread_attr_init(&thread_attr);
223- gettimeofday(&start, NULL);
224+ gettimeofday(&bench__start, NULL);
225
226 create_threads(worker, thread_attr, cpu);
227 pthread_attr_destroy(&thread_attr);
228@@ -211,7 +210,7 @@ int bench_futex_lock_pi(int argc, const char **argv)
229 pthread_mutex_destroy(&thread_lock);
230
231 for (i = 0; i < nthreads; i++) {
232- unsigned long t = worker[i].ops/runtime.tv_sec;
233+ unsigned long t = worker[i].ops / bench__runtime.tv_sec;
234
235 update_stats(&throughput_stats, t);
236 if (!silent)
237--
2382.17.1
239
diff --git a/recipes-kernel/linux/linux-qoriq/0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch b/recipes-kernel/linux/linux-qoriq/0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch
new file mode 100644
index 00000000..f5366416
--- /dev/null
+++ b/recipes-kernel/linux/linux-qoriq/0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch
@@ -0,0 +1,68 @@
1From 168200b6d6ea0cb5765943ec5da5b8149701f36a Mon Sep 17 00:00:00 2001
2From: Leo Yan <leo.yan@linaro.org>
3Date: Tue, 5 May 2020 21:36:42 +0800
4Subject: [PATCH] perf cs-etm: Move definition of 'traceid_list' global
5 variable from header file
6
7The variable 'traceid_list' is defined in the header file cs-etm.h,
8if multiple C files include cs-etm.h the compiler might complaint for
9multiple definition of 'traceid_list'.
10
11To fix multiple definition error, move the definition of 'traceid_list'
12into cs-etm.c.
13
14Upstream-Status: Backport
15
16Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata")
17Reported-by: Thomas Backlund <tmb@mageia.org>
18Signed-off-by: Leo Yan <leo.yan@linaro.org>
19Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
20Reviewed-by: Mike Leach <mike.leach@linaro.org>
21Tested-by: Mike Leach <mike.leach@linaro.org>
22Tested-by: Thomas Backlund <tmb@mageia.org>
23Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
24Cc: Jiri Olsa <jolsa@redhat.com>
25Cc: Mark Rutland <mark.rutland@arm.com>
26Cc: Namhyung Kim <namhyung@kernel.org>
27Cc: Peter Zijlstra <peterz@infradead.org>
28Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
29Cc: Tor Jeremiassen <tor@ti.com>
30Cc: linux-arm-kernel@lists.infradead.org
31Link: http://lore.kernel.org/lkml/20200505133642.4756-1-leo.yan@linaro.org
32Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
33---
34 tools/perf/util/cs-etm.c | 3 +++
35 tools/perf/util/cs-etm.h | 3 ---
36 2 files changed, 3 insertions(+), 3 deletions(-)
37
38diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
39index 3c802fde4954..c283223fb31f 100644
40--- a/tools/perf/util/cs-etm.c
41+++ b/tools/perf/util/cs-etm.c
42@@ -94,6 +94,9 @@ struct cs_etm_queue {
43 struct cs_etm_traceid_queue **traceid_queues;
44 };
45
46+/* RB tree for quick conversion between traceID and metadata pointers */
47+static struct intlist *traceid_list;
48+
49 static int cs_etm__update_queues(struct cs_etm_auxtrace *etm);
50 static int cs_etm__process_queues(struct cs_etm_auxtrace *etm);
51 static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm,
52diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h
53index 650ecc2a6349..4ad925d6d799 100644
54--- a/tools/perf/util/cs-etm.h
55+++ b/tools/perf/util/cs-etm.h
56@@ -114,9 +114,6 @@ enum cs_etm_isa {
57 CS_ETM_ISA_T32,
58 };
59
60-/* RB tree for quick conversion between traceID and metadata pointers */
61-struct intlist *traceid_list;
62-
63 struct cs_etm_queue;
64
65 struct cs_etm_packet {
66--
672.17.1
68
diff --git a/recipes-kernel/linux/linux-qoriq/0001-perf-tests-bp_account-Make-global-variable-static.patch b/recipes-kernel/linux/linux-qoriq/0001-perf-tests-bp_account-Make-global-variable-static.patch
new file mode 100644
index 00000000..b36ed2cc
--- /dev/null
+++ b/recipes-kernel/linux/linux-qoriq/0001-perf-tests-bp_account-Make-global-variable-static.patch
@@ -0,0 +1,42 @@
1From cff20b3151ccab690715cb6cf0f5da5cccb32adf Mon Sep 17 00:00:00 2001
2From: Arnaldo Carvalho de Melo <acme@redhat.com>
3Date: Mon, 2 Mar 2020 11:13:19 -0300
4Subject: [PATCH] perf tests bp_account: Make global variable static
5
6To fix the build with newer gccs, that without this patch exit with:
7
8 LD /tmp/build/perf/tests/perf-in.o
9 ld: /tmp/build/perf/tests/bp_account.o:/git/perf/tools/perf/tests/bp_account.c:22: multiple definition of `the_var'; /tmp/build/perf/tests/bp_signal.o:/git/perf/tools/perf/tests/bp_signal.c:38: first defined here
10 make[4]: *** [/git/perf/tools/build/Makefile.build:145: /tmp/build/perf/tests/perf-in.o] Error 1
11
12First noticed in fedora:rawhide/32 with:
13
14 [perfbuilder@a5ff49d6e6e4 ~]$ gcc --version
15 gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8)
16
17Upstream-Status: Backport
18
19Reported-by: Jiri Olsa <jolsa@kernel.org>
20Cc: Adrian Hunter <adrian.hunter@intel.com>
21Cc: Namhyung Kim <namhyung@kernel.org>
22Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
23---
24 tools/perf/tests/bp_account.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c
28index d0b935356274..489b50604cf2 100644
29--- a/tools/perf/tests/bp_account.c
30+++ b/tools/perf/tests/bp_account.c
31@@ -19,7 +19,7 @@
32 #include "../perf-sys.h"
33 #include "cloexec.h"
34
35-volatile long the_var;
36+static volatile long the_var;
37
38 static noinline int test_function(void)
39 {
40--
412.17.1
42
diff --git a/recipes-kernel/linux/linux-qoriq_5.4.bb b/recipes-kernel/linux/linux-qoriq_5.4.bb
index d1b979f9..6a2f9c1f 100644
--- a/recipes-kernel/linux/linux-qoriq_5.4.bb
+++ b/recipes-kernel/linux/linux-qoriq_5.4.bb
@@ -5,6 +5,10 @@ LINUX_VERSION = "5.4.3"
5SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/linux;nobranch=1 \ 5SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/linux;nobranch=1 \
6 file://0001-Makfefile-linux-5.4-add-warning-cflags-on-LSDK-20.04.patch \ 6 file://0001-Makfefile-linux-5.4-add-warning-cflags-on-LSDK-20.04.patch \
7 file://0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch \ 7 file://0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch \
8 file://0001-perf-tests-bp_account-Make-global-variable-static.patch \
9 file://0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch \
10 file://0001-perf-bench-Share-some-global-variables-to-fix-build-.patch \
11 file://0001-libtraceevent-Fix-build-with-binutils-2.35.patch \
8" 12"
9SRCREV = "134788b16485dd9fa81988681d2365ee38633fa2" 13SRCREV = "134788b16485dd9fa81988681d2365ee38633fa2"
10 14