Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf cs-etm: Tidy up auxtrace info header printing

cs_etm__print_auxtrace_info() is called twice in case there is an error
somewhere in cs_etm__process_auxtrace_info(), but all the info is
already available at the beginning so just print it there instead.

Also use u64 and the already cast ptr variable to make it more
consistent with the rest of the etm code.

Signed-off-by: James Clark <james.clark@arm.com>
Cc: Al Grant <Al.Grant@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20221212155513.2259623-4-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

James Clark and committed by
Arnaldo Carvalho de Melo
b00204f5 fe55ba18

+10 -18
+10 -18
tools/perf/util/cs-etm.c
··· 2541 2541 }; 2542 2542 2543 2543 static const char * const param_unk_fmt = 2544 - " Unknown parameter [%d] %llx\n"; 2544 + " Unknown parameter [%d] %"PRIx64"\n"; 2545 2545 static const char * const magic_unk_fmt = 2546 - " Magic number Unknown %llx\n"; 2546 + " Magic number Unknown %"PRIx64"\n"; 2547 2547 2548 - static int cs_etm__print_cpu_metadata_v0(__u64 *val, int *offset) 2548 + static int cs_etm__print_cpu_metadata_v0(u64 *val, int *offset) 2549 2549 { 2550 2550 int i = *offset, j, nr_params = 0, fmt_offset; 2551 - __u64 magic; 2551 + u64 magic; 2552 2552 2553 2553 /* check magic value */ 2554 2554 magic = val[i + CS_ETM_MAGIC]; ··· 2580 2580 return 0; 2581 2581 } 2582 2582 2583 - static int cs_etm__print_cpu_metadata_v1(__u64 *val, int *offset) 2583 + static int cs_etm__print_cpu_metadata_v1(u64 *val, int *offset) 2584 2584 { 2585 2585 int i = *offset, j, total_params = 0; 2586 - __u64 magic; 2586 + u64 magic; 2587 2587 2588 2588 magic = val[i + CS_ETM_MAGIC]; 2589 2589 /* total params to print is NR_PARAMS + common block size for v1 */ ··· 2619 2619 return 0; 2620 2620 } 2621 2621 2622 - static void cs_etm__print_auxtrace_info(__u64 *val, int num) 2622 + static void cs_etm__print_auxtrace_info(u64 *val, int num) 2623 2623 { 2624 2624 int i, cpu = 0, version, err; 2625 2625 ··· 2925 2925 pmu_type = (unsigned int) ((hdr[CS_PMU_TYPE_CPUS] >> 32) & 2926 2926 0xffffffff); 2927 2927 2928 + if (dump_trace) 2929 + cs_etm__print_auxtrace_info(ptr, num_cpu); 2930 + 2928 2931 /* 2929 2932 * Create an RB tree for traceID-metadata tuple. Since the conversion 2930 2933 * has to be made for each packet that gets decoded, optimizing access ··· 3077 3074 goto err_delete_thread; 3078 3075 } 3079 3076 3080 - if (dump_trace) { 3081 - cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu); 3082 - } 3083 - 3084 3077 err = cs_etm__synth_events(etm, session); 3085 3078 if (err) 3086 3079 goto err_delete_thread; ··· 3112 3113 intlist__delete(traceid_list); 3113 3114 err_free_hdr: 3114 3115 zfree(&hdr); 3115 - /* 3116 - * At this point, as a minimum we have valid header. Dump the rest of 3117 - * the info section - the print routines will error out on structural 3118 - * issues. 3119 - */ 3120 - if (dump_trace) 3121 - cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu); 3122 3116 return err; 3123 3117 }