mirror of
https://github.com/raspberrypi/linux.git
synced 2026-01-02 15:53:42 +00:00
perf tools: Support pipeline stage cycles for powerpc
The pipeline stage cycles details can be recorded on powerpc from the contents of Performance Monitor Unit (PMU) registers. On ISA v3.1 platform, sampling registers exposes the cycles spent in different pipeline stages. Patch adds perf tools support to present two of the cycle counter information along with memory latency (weight). Re-use the field 'ins_lat' for storing the first pipeline stage cycle. This is stored in 'var2_w' field of 'perf_sample_weight'. Add a new field 'p_stage_cyc' to store the second pipeline stage cycle which is stored in 'var3_w' field of perf_sample_weight. Add new sort function 'Pipeline Stage Cycle' and include this in default_mem_sort_order[]. This new sort function may be used to denote some other pipeline stage in another architecture. So add this to list of sort entries that can have dynamic header string. Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Reviewed-by: Madhavan Srinivasan <maddy@linux.ibm.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Link: https://lore.kernel.org/r/1616425047-1666-5-git-send-email-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
ff0bd0a33f
commit
06e5ca746c
@@ -37,7 +37,7 @@ const char default_parent_pattern[] = "^sys_|^do_page_fault";
|
||||
const char *parent_pattern = default_parent_pattern;
|
||||
const char *default_sort_order = "comm,dso,symbol";
|
||||
const char default_branch_sort_order[] = "comm,dso_from,symbol_from,symbol_to,cycles";
|
||||
const char default_mem_sort_order[] = "local_weight,mem,sym,dso,symbol_daddr,dso_daddr,snoop,tlb,locked,blocked,local_ins_lat";
|
||||
const char default_mem_sort_order[] = "local_weight,mem,sym,dso,symbol_daddr,dso_daddr,snoop,tlb,locked,blocked,local_ins_lat,p_stage_cyc";
|
||||
const char default_top_sort_order[] = "dso,symbol";
|
||||
const char default_diff_sort_order[] = "dso,symbol";
|
||||
const char default_tracepoint_sort_order[] = "trace";
|
||||
@@ -46,7 +46,7 @@ const char *field_order;
|
||||
regex_t ignore_callees_regex;
|
||||
int have_ignore_callees = 0;
|
||||
enum sort_mode sort__mode = SORT_MODE__NORMAL;
|
||||
const char *dynamic_headers[] = {"local_ins_lat"};
|
||||
const char *dynamic_headers[] = {"local_ins_lat", "p_stage_cyc"};
|
||||
|
||||
/*
|
||||
* Replaces all occurrences of a char used with the:
|
||||
@@ -1410,6 +1410,25 @@ struct sort_entry sort_global_ins_lat = {
|
||||
.se_width_idx = HISTC_GLOBAL_INS_LAT,
|
||||
};
|
||||
|
||||
static int64_t
|
||||
sort__global_p_stage_cyc_cmp(struct hist_entry *left, struct hist_entry *right)
|
||||
{
|
||||
return left->stat.p_stage_cyc - right->stat.p_stage_cyc;
|
||||
}
|
||||
|
||||
static int hist_entry__p_stage_cyc_snprintf(struct hist_entry *he, char *bf,
|
||||
size_t size, unsigned int width)
|
||||
{
|
||||
return repsep_snprintf(bf, size, "%-*u", width, he->stat.p_stage_cyc);
|
||||
}
|
||||
|
||||
struct sort_entry sort_p_stage_cyc = {
|
||||
.se_header = "Pipeline Stage Cycle",
|
||||
.se_cmp = sort__global_p_stage_cyc_cmp,
|
||||
.se_snprintf = hist_entry__p_stage_cyc_snprintf,
|
||||
.se_width_idx = HISTC_P_STAGE_CYC,
|
||||
};
|
||||
|
||||
struct sort_entry sort_mem_daddr_sym = {
|
||||
.se_header = "Data Symbol",
|
||||
.se_cmp = sort__daddr_cmp,
|
||||
@@ -1853,6 +1872,7 @@ static struct sort_dimension common_sort_dimensions[] = {
|
||||
DIM(SORT_CODE_PAGE_SIZE, "code_page_size", sort_code_page_size),
|
||||
DIM(SORT_LOCAL_INS_LAT, "local_ins_lat", sort_local_ins_lat),
|
||||
DIM(SORT_GLOBAL_INS_LAT, "ins_lat", sort_global_ins_lat),
|
||||
DIM(SORT_PIPELINE_STAGE_CYC, "p_stage_cyc", sort_p_stage_cyc),
|
||||
};
|
||||
|
||||
#undef DIM
|
||||
|
||||
Reference in New Issue
Block a user