summaryrefslogtreecommitdiff
path: root/tools/perf/arch/x86/util
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2023-01-04 23:13:48 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-02-03 23:24:02 +0300
commitd7d213e04cf83318681f24870f1144e50d5c91bb (patch)
tree8d1886bcb767c03cd12d788cf76b10af2d33735f /tools/perf/arch/x86/util
parentebab291641bed48f62c608e3bf29071c435c2d9b (diff)
downloadlinux-d7d213e04cf83318681f24870f1144e50d5c91bb.tar.xz
perf report: Support Retire Latency
The Retire Latency field is added in the var3_w of the PERF_SAMPLE_WEIGHT_STRUCT. The Retire Latency reports pipeline stall of this instruction compared to the previous instruction in cycles. That's quite useful to display the information with perf mem report. The p_stage_cyc for Power is also from the var3_w. Union the p_stage_cyc and retire_lat to share the code. Implement X86 specific codes to display the X86 specific header. Add a new sort key retire_lat for the Retire Latency. Reviewed-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lore.kernel.org/lkml/20230104201349.1451191-8-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/arch/x86/util')
-rw-r--r--tools/perf/arch/x86/util/event.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/perf/arch/x86/util/event.c b/tools/perf/arch/x86/util/event.c
index a3acefe6d0c6..37b3feb53e8d 100644
--- a/tools/perf/arch/x86/util/event.c
+++ b/tools/perf/arch/x86/util/event.c
@@ -89,6 +89,7 @@ void arch_perf_parse_sample_weight(struct perf_sample *data,
else {
data->weight = weight.var1_dw;
data->ins_lat = weight.var2_w;
+ data->retire_lat = weight.var3_w;
}
}
@@ -102,3 +103,22 @@ void arch_perf_synthesize_sample_weight(const struct perf_sample *data,
*array |= ((u64)data->ins_lat << 32);
}
}
+
+const char *arch_perf_header_entry(const char *se_header)
+{
+ if (!strcmp(se_header, "Local Pipeline Stage Cycle"))
+ return "Local Retire Latency";
+ else if (!strcmp(se_header, "Pipeline Stage Cycle"))
+ return "Retire Latency";
+
+ return se_header;
+}
+
+int arch_support_sort_key(const char *sort_key)
+{
+ if (!strcmp(sort_key, "p_stage_cyc"))
+ return 1;
+ if (!strcmp(sort_key, "local_p_stage_cyc"))
+ return 1;
+ return 0;
+}