aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-03-17 22:31:39 -0400
committerJiri Olsa <jolsa@kernel.org>2014-05-21 05:45:35 -0400
commit512ae1bd6acb811c72e44e2540099eccd31f773d (patch)
treedce8f54594f284e88b113ffd60584869dcb32479 /tools/perf/builtin-top.c
parenta2ce067e55e328f1a6fe3dddf77a173381ffdfe1 (diff)
perf tools: Consolidate management of default sort orders
The perf uses different default sort orders for different use-cases, and this was scattered throughout the code. Add get_default_sort_ order() function to handle this and change initial value of sort_order to NULL to distinguish it from user-given one. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1400480762-22852-10-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 4fef1e415129..34764b6eabf9 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1137,8 +1137,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
1137 if (argc) 1137 if (argc)
1138 usage_with_options(top_usage, options); 1138 usage_with_options(top_usage, options);
1139 1139
1140 if (sort_order == default_sort_order) 1140 sort__mode = SORT_MODE__TOP;
1141 sort_order = "dso,symbol";
1142 1141
1143 if (setup_sorting() < 0) { 1142 if (setup_sorting() < 0) {
1144 parse_options_usage(top_usage, options, "s", 1); 1143 parse_options_usage(top_usage, options, "s", 1);