提交 50fa3a53 编写于 作者: A Athira Rajeev 提交者: Arnaldo Carvalho de Melo

perf sort: Display sort dimension p_stage_cyc only on supported archs

The sort dimension "p_stage_cyc" is used to represent pipeline
stage cycle information. Presently, this is used only in powerpc.

For unsupported platforms, we don't want to display it
in the perf report output columns. Hence add check in sort_dimension__add()
and skip the sort key incase it is not applicable for the particular arch.
Signed-off-by: NAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Reviewed-by: NMadhavan Srinivasan <maddy@linux.ibm.com>
Acked-by: NJiri Olsa <jolsa@redhat.com>
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-6-git-send-email-atrajeev@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 06e5ca74
...@@ -44,3 +44,10 @@ const char *arch_perf_header_entry(const char *se_header) ...@@ -44,3 +44,10 @@ const char *arch_perf_header_entry(const char *se_header)
return "Dispatch Cyc"; return "Dispatch Cyc";
return se_header; return se_header;
} }
int arch_support_sort_key(const char *sort_key)
{
if (!strcmp(sort_key, "p_stage_cyc"))
return 1;
return 0;
}
...@@ -429,5 +429,6 @@ char *get_page_size_name(u64 size, char *str); ...@@ -429,5 +429,6 @@ char *get_page_size_name(u64 size, char *str);
void arch_perf_parse_sample_weight(struct perf_sample *data, const __u64 *array, u64 type); void arch_perf_parse_sample_weight(struct perf_sample *data, const __u64 *array, u64 type);
void arch_perf_synthesize_sample_weight(const struct perf_sample *data, __u64 *array, u64 type); void arch_perf_synthesize_sample_weight(const struct perf_sample *data, __u64 *array, u64 type);
const char *arch_perf_header_entry(const char *se_header); const char *arch_perf_header_entry(const char *se_header);
int arch_support_sort_key(const char *sort_key);
#endif /* __PERF_RECORD_H */ #endif /* __PERF_RECORD_H */
...@@ -47,6 +47,7 @@ regex_t ignore_callees_regex; ...@@ -47,6 +47,7 @@ regex_t ignore_callees_regex;
int have_ignore_callees = 0; int have_ignore_callees = 0;
enum sort_mode sort__mode = SORT_MODE__NORMAL; enum sort_mode sort__mode = SORT_MODE__NORMAL;
const char *dynamic_headers[] = {"local_ins_lat", "p_stage_cyc"}; const char *dynamic_headers[] = {"local_ins_lat", "p_stage_cyc"};
const char *arch_specific_sort_keys[] = {"p_stage_cyc"};
/* /*
* Replaces all occurrences of a char used with the: * Replaces all occurrences of a char used with the:
...@@ -1837,6 +1838,11 @@ struct sort_dimension { ...@@ -1837,6 +1838,11 @@ struct sort_dimension {
int taken; int taken;
}; };
int __weak arch_support_sort_key(const char *sort_key __maybe_unused)
{
return 0;
}
const char * __weak arch_perf_header_entry(const char *se_header) const char * __weak arch_perf_header_entry(const char *se_header)
{ {
return se_header; return se_header;
...@@ -2773,6 +2779,19 @@ int sort_dimension__add(struct perf_hpp_list *list, const char *tok, ...@@ -2773,6 +2779,19 @@ int sort_dimension__add(struct perf_hpp_list *list, const char *tok,
{ {
unsigned int i, j; unsigned int i, j;
/*
* Check to see if there are any arch specific
* sort dimensions not applicable for the current
* architecture. If so, Skip that sort key since
* we don't want to display it in the output fields.
*/
for (j = 0; j < ARRAY_SIZE(arch_specific_sort_keys); j++) {
if (!strcmp(arch_specific_sort_keys[j], tok) &&
!arch_support_sort_key(tok)) {
return 0;
}
}
for (i = 0; i < ARRAY_SIZE(common_sort_dimensions); i++) { for (i = 0; i < ARRAY_SIZE(common_sort_dimensions); i++) {
struct sort_dimension *sd = &common_sort_dimensions[i]; struct sort_dimension *sd = &common_sort_dimensions[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册