Skip to content

Commit

Permalink
perf tools: Print auxtrace header information
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mathieupoirier committed Mar 16, 2017
1 parent 8e9e2e2 commit 2379238
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/perf/util/cs-etm.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 2379238

Please sign in to comment.