summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/sort.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/sort.c')
-rw-r--r--tools/perf/util/sort.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 60ced707bd6b..b490354d1b23 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -7,7 +7,8 @@ char default_sort_order[] = "comm,dso,symbol";
char *sort_order = default_sort_order;
int sort__need_collapse = 0;
int sort__has_parent = 0;
-int sort_by_sym_first;
+
+enum sort_type sort__first_dimension;
unsigned int dsos__col_width;
unsigned int comms__col_width;
@@ -266,9 +267,18 @@ int sort_dimension__add(const char *tok)
sort__has_parent = 1;
}
- if (list_empty(&hist_entry__sort_list) &&
- !strcmp(sd->name, "symbol"))
- sort_by_sym_first = true;
+ if (list_empty(&hist_entry__sort_list)) {
+ if (!strcmp(sd->name, "pid"))
+ sort__first_dimension = SORT_PID;
+ else if (!strcmp(sd->name, "comm"))
+ sort__first_dimension = SORT_COMM;
+ else if (!strcmp(sd->name, "dso"))
+ sort__first_dimension = SORT_DSO;
+ else if (!strcmp(sd->name, "symbol"))
+ sort__first_dimension = SORT_SYM;
+ else if (!strcmp(sd->name, "parent"))
+ sort__first_dimension = SORT_PARENT;
+ }
list_add_tail(&sd->entry->list, &hist_entry__sort_list);
sd->taken = 1;