From gcc 6.2 and onward, the compiler complains about
‘cs_etm_global_header_fmts’ not being used (and rightly so).
One solution is to remove the declaration but it is a matter of time before we need to modify the header. Another solution is to simply print the information conveyed by the header.
There is a few advantages that comes with the latter:
1) We know how many CPUs are part of the session, without having to count the number of magic numbers.
2) We get to see if the snapshot option was specified.
3) When we change the header we know exactly what kind of header we are dealing with.
Reported-by: Kim Phillips kim.phillips@arm.com Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org --- tools/perf/util/cs-etm.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 0adb8e4aff2f..82702039ab2e 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -1494,6 +1494,9 @@ static void cs_etm__print_auxtrace_info(u64 *val, size_t num) { unsigned i,j,cpu;
+ for (i = 0; i < CS_HEADER_VERSION_0_MAX; i++) + fprintf(stdout, cs_etm_global_header_fmts[i], val[i]); + for (i = CS_HEADER_VERSION_0_MAX, cpu = 0; cpu < num; ++cpu) {
if (val[i] == __perf_cs_etmv3_magic) {