diff options
5 files changed, 392 insertions, 1 deletions
diff --git a/recipes-kernel/linux/linux-imx.inc b/recipes-kernel/linux/linux-imx.inc index d508a727..c08ee0d4 100644 --- a/recipes-kernel/linux/linux-imx.inc +++ b/recipes-kernel/linux/linux-imx.inc | |||
@@ -15,7 +15,11 @@ SRCBRANCH ?= "" | |||
15 | PV = "${LINUX_VERSION}+git${SRCPV}" | 15 | PV = "${LINUX_VERSION}+git${SRCPV}" |
16 | 16 | ||
17 | SRC_URI = "git://source.codeaurora.org/external/imx/linux-imx;protocol=https;branch=${SRCBRANCH} \ | 17 | SRC_URI = "git://source.codeaurora.org/external/imx/linux-imx;protocol=https;branch=${SRCBRANCH} \ |
18 | file://defconfig \ | 18 | file://defconfig \ |
19 | file://0001-perf-tests-bp_account-Make-global-variable-static.patch \ | ||
20 | file://0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch \ | ||
21 | file://0001-perf-bench-Share-some-global-variables-to-fix-build-.patch \ | ||
22 | file://0001-libtraceevent-Fix-build-with-binutils-2.35.patch \ | ||
19 | " | 23 | " |
20 | 24 | ||
21 | S = "${WORKDIR}/git" | 25 | S = "${WORKDIR}/git" |
diff --git a/recipes-kernel/linux/linux-imx/0001-libtraceevent-Fix-build-with-binutils-2.35.patch b/recipes-kernel/linux/linux-imx/0001-libtraceevent-Fix-build-with-binutils-2.35.patch new file mode 100644 index 00000000..b1d07fc4 --- /dev/null +++ b/recipes-kernel/linux/linux-imx/0001-libtraceevent-Fix-build-with-binutils-2.35.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 39efdd94e314336f4acbac4c07e0f37bdc3bef71 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ben Hutchings <ben@decadent.org.uk> | ||
3 | Date: Sat, 25 Jul 2020 02:06:23 +0100 | ||
4 | Subject: [PATCH] libtraceevent: Fix build with binutils 2.35 | ||
5 | |||
6 | In binutils 2.35, 'nm -D' changed to show symbol versions along with | ||
7 | symbol names, with the usual @@ separator. When generating | ||
8 | libtraceevent-dynamic-list we need just the names, so strip off the | ||
9 | version suffix if present. | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | |||
13 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
14 | Tested-by: Salvatore Bonaccorso <carnil@debian.org> | ||
15 | Reviewed-by: Steven Rostedt <rostedt@goodmis.org> | ||
16 | Cc: linux-trace-devel@vger.kernel.org | ||
17 | Cc: stable@vger.kernel.org | ||
18 | Signed-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 | |||
23 | diff --git a/tools/lib/traceevent/plugins/Makefile b/tools/lib/traceevent/plugins/Makefile | ||
24 | index 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 | -- | ||
37 | 2.17.1 | ||
38 | |||
diff --git a/recipes-kernel/linux/linux-imx/0001-perf-bench-Share-some-global-variables-to-fix-build-.patch b/recipes-kernel/linux/linux-imx/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-imx/0001-perf-bench-Share-some-global-variables-to-fix-build-.patch | |||
@@ -0,0 +1,239 @@ | |||
1 | From e4d9b04b973b2dbce7b42af95ea70d07da1c936d Mon Sep 17 00:00:00 2001 | ||
2 | From: Arnaldo Carvalho de Melo <acme@redhat.com> | ||
3 | Date: Mon, 2 Mar 2020 12:09:38 -0300 | ||
4 | Subject: [PATCH] perf bench: Share some global variables to fix build with gcc | ||
5 | 10 | ||
6 | |||
7 | Noticed with gcc 10 (fedora rawhide) that those variables were not being | ||
8 | declared 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 | |||
18 | Prefix those with bench__ and add them to bench/bench.h, so that we can | ||
19 | share those on the tools needing to access those variables from signal | ||
20 | handlers. | ||
21 | |||
22 | Upstream-Status: Backport | ||
23 | |||
24 | Acked-by: Thomas Gleixner <tglx@linutronix.de> | ||
25 | Cc: Adrian Hunter <adrian.hunter@intel.com> | ||
26 | Cc: Davidlohr Bueso <dave@stgolabs.net> | ||
27 | Cc: Jiri Olsa <jolsa@kernel.org> | ||
28 | Cc: Namhyung Kim <namhyung@kernel.org> | ||
29 | Link: http://lore.kernel.org/lkml/20200303155811.GD13702@kernel.org | ||
30 | Signed-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 | |||
39 | diff --git a/tools/perf/bench/bench.h b/tools/perf/bench/bench.h | ||
40 | index 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 | ||
54 | diff --git a/tools/perf/bench/epoll-ctl.c b/tools/perf/bench/epoll-ctl.c | ||
55 | index 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 | |||
86 | diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-wait.c | ||
87 | index 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 | |||
136 | diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c | ||
137 | index 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) | ||
187 | diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c | ||
188 | index 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 | -- | ||
238 | 2.17.1 | ||
239 | |||
diff --git a/recipes-kernel/linux/linux-imx/0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch b/recipes-kernel/linux/linux-imx/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-imx/0001-perf-cs-etm-Move-definition-of-traceid_list-global-v.patch | |||
@@ -0,0 +1,68 @@ | |||
1 | From 168200b6d6ea0cb5765943ec5da5b8149701f36a Mon Sep 17 00:00:00 2001 | ||
2 | From: Leo Yan <leo.yan@linaro.org> | ||
3 | Date: Tue, 5 May 2020 21:36:42 +0800 | ||
4 | Subject: [PATCH] perf cs-etm: Move definition of 'traceid_list' global | ||
5 | variable from header file | ||
6 | |||
7 | The variable 'traceid_list' is defined in the header file cs-etm.h, | ||
8 | if multiple C files include cs-etm.h the compiler might complaint for | ||
9 | multiple definition of 'traceid_list'. | ||
10 | |||
11 | To fix multiple definition error, move the definition of 'traceid_list' | ||
12 | into cs-etm.c. | ||
13 | |||
14 | Upstream-Status: Backport | ||
15 | |||
16 | Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata") | ||
17 | Reported-by: Thomas Backlund <tmb@mageia.org> | ||
18 | Signed-off-by: Leo Yan <leo.yan@linaro.org> | ||
19 | Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> | ||
20 | Reviewed-by: Mike Leach <mike.leach@linaro.org> | ||
21 | Tested-by: Mike Leach <mike.leach@linaro.org> | ||
22 | Tested-by: Thomas Backlund <tmb@mageia.org> | ||
23 | Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> | ||
24 | Cc: Jiri Olsa <jolsa@redhat.com> | ||
25 | Cc: Mark Rutland <mark.rutland@arm.com> | ||
26 | Cc: Namhyung Kim <namhyung@kernel.org> | ||
27 | Cc: Peter Zijlstra <peterz@infradead.org> | ||
28 | Cc: Suzuki Poulouse <suzuki.poulose@arm.com> | ||
29 | Cc: Tor Jeremiassen <tor@ti.com> | ||
30 | Cc: linux-arm-kernel@lists.infradead.org | ||
31 | Link: http://lore.kernel.org/lkml/20200505133642.4756-1-leo.yan@linaro.org | ||
32 | Signed-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 | |||
38 | diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c | ||
39 | index 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, | ||
52 | diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h | ||
53 | index 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 | -- | ||
67 | 2.17.1 | ||
68 | |||
diff --git a/recipes-kernel/linux/linux-imx/0001-perf-tests-bp_account-Make-global-variable-static.patch b/recipes-kernel/linux/linux-imx/0001-perf-tests-bp_account-Make-global-variable-static.patch new file mode 100644 index 00000000..b36ed2cc --- /dev/null +++ b/recipes-kernel/linux/linux-imx/0001-perf-tests-bp_account-Make-global-variable-static.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From cff20b3151ccab690715cb6cf0f5da5cccb32adf Mon Sep 17 00:00:00 2001 | ||
2 | From: Arnaldo Carvalho de Melo <acme@redhat.com> | ||
3 | Date: Mon, 2 Mar 2020 11:13:19 -0300 | ||
4 | Subject: [PATCH] perf tests bp_account: Make global variable static | ||
5 | |||
6 | To 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 | |||
12 | First 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 | |||
17 | Upstream-Status: Backport | ||
18 | |||
19 | Reported-by: Jiri Olsa <jolsa@kernel.org> | ||
20 | Cc: Adrian Hunter <adrian.hunter@intel.com> | ||
21 | Cc: Namhyung Kim <namhyung@kernel.org> | ||
22 | Signed-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 | |||
27 | diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c | ||
28 | index 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 | -- | ||
41 | 2.17.1 | ||
42 | |||