[PATCH] perf report: fix output of WEIGHT_STRUCT

From: Stephane Eranian
Date: Mon Nov 08 2021 - 02:41:06 EST


The output of the WEIGHT_STRUCT record was not consistent among its
fields. Some are printed in decimal, other in hexdecimal. It does not
make sense to print a weight in hexadecimal.

Signed-off-by: Stephane Eranian <eranian@xxxxxxxxxx>
---
tools/perf/util/session.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 352f16076e01..94c056695a93 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1332,8 +1332,8 @@ static void dump_sample(struct evsel *evsel, union perf_event *event,
if (sample_type & PERF_SAMPLE_WEIGHT_TYPE) {
printf("... weight: %" PRIu64 "", sample->weight);
if (sample_type & PERF_SAMPLE_WEIGHT_STRUCT) {
- printf(",0x%"PRIx16"", sample->ins_lat);
- printf(",0x%"PRIx16"", sample->p_stage_cyc);
+ printf(", %"PRIu16"", sample->ins_lat);
+ printf(", %"PRIu16"", sample->p_stage_cyc);
}
printf("\n");
}
--
2.34.0.rc0.344.g81b53c2807-goog