diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt index 15949e2a7805cc6e7d848ddbf2f99b249e332f3b..68c89190e79ce7d521d4275caca3bafb68ead2be 100644 --- a/tools/perf/Documentation/perf-config.txt +++ b/tools/perf/Documentation/perf-config.txt @@ -382,6 +382,10 @@ call-graph.*:: histogram entry. Default is 0 which means no limitation. report.*:: + report.sort_order:: + Allows changing the default sort order from "comm,dso,symbol" to + some other default, for instance "sym,dso" may be more fitting for + kernel developers. report.percent-limit:: This one is mostly the same as call-graph.threshold but works for histogram entries. Entries having an overhead lower than this diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 949e5a15c960e2ef190cc97217df29d561c73777..b9e046baa5fc2e09488bafb60eacecd21f4e478c 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -89,6 +89,10 @@ static int report__config(const char *var, const char *value, void *cb) rep->queue_size = perf_config_u64(var, value); return 0; } + if (!strcmp(var, "report.sort_order")) { + default_sort_order = strdup(value); + return 0; + } return 0; } diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 5ae3d32a21d66d6ebbefed0ff5ed896a70d232e0..1884d7f9b9d2abc516653c479ab3dfb85ecf8a70 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -11,7 +11,7 @@ regex_t parent_regex; 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_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"; const char default_top_sort_order[] = "dso,symbol"; diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 7ca37ea1739559e1e3f064c9260d5d078cb5b84f..28c0524c87026a213f6f2af95cc71bb6d30f251d 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h @@ -28,7 +28,7 @@ extern const char *sort_order; extern const char *field_order; extern const char default_parent_pattern[]; extern const char *parent_pattern; -extern const char default_sort_order[]; +extern const char *default_sort_order; extern regex_t ignore_callees_regex; extern int have_ignore_callees; extern enum sort_mode sort__mode;