Skip to contentSkip to conversation

perf report: fix output of WEIGHT_STRUCT

PATCH New Stephane Eranian 1 participant 1 message Nov 8, 2021 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf report: fix output of WEIGHT_STRUCT

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.

---
 tools/perf/util/session.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/session.c +2 -2
index 352f16076e01..94c056695a93 100644
@@ -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");
 	}
Signature · 1 line
2.34.0.rc0.344.g81b53c2807-goog