From 7b0ea1373af3adc99c308964d0c5304332965cc6 Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Tue, 5 May 2020 21:36:42 +0800 Subject: [PATCH 5/7] perf cs-etm: Move definition of 'traceid_list' global variable from header file The variable 'traceid_list' is defined in the header file cs-etm.h, if multiple C files include cs-etm.h the compiler might complaint for multiple definition of 'traceid_list'. To fix multiple definition error, move the definition of 'traceid_list' into cs-etm.c. Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata") Reported-by: Thomas Backlund Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Reviewed-by: Mike Leach Tested-by: Mike Leach Tested-by: Thomas Backlund Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: Tor Jeremiassen Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20200505133642.4756-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo (cherry picked from commit 168200b6d6ea0cb5765943ec5da5b8149701f36a) Conflicts: tools/perf/util/cs-etm.c tools/perf/util/cs-etm.h Change-Id: I3c15e3cdbd3ca8082f6eab16ba9edd71e891772f Signed-off-by: Jeffy Chen --- tools/perf/util/cs-etm.c | 3 +++ tools/perf/util/cs-etm.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index ca93257a6cb7..ee23fd37f241 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -91,6 +91,9 @@ struct cs_etm_queue { bool kernel_mapped; }; +/* RB tree for quick conversion between traceID and metadata pointers */ +static struct intlist *traceid_list; + static int cs_etm__get_trace(struct cs_etm_buffer *buff, struct cs_etm_queue *etmq); static int cs_etm__update_queues(struct cs_etm_auxtrace *); static int cs_etm__process_queues(struct cs_etm_auxtrace *, u64); diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h index ec6ff78f1905..1f785a92fb20 100644 --- a/tools/perf/util/cs-etm.h +++ b/tools/perf/util/cs-etm.h @@ -65,9 +65,6 @@ enum { CS_ETMV4_PRIV_MAX, }; -/* RB tree for quick conversion between traceID and CPUs */ -struct intlist *traceid_list; - #define KiB(x) ((x) * 1024) #define MiB(x) ((x) * 1024 * 1024) -- 2.20.1