aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2013-04-01 07:35:20 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-05-28 09:23:53 -0400
commit55369fc179b0572d0b4a06a9be1d2779b3ac22e0 (patch)
tree629f53b617814ebfcb517a34324115efe7026d16 /tools/perf/util
parentded19d57a621e92a27a05972949ad3230f84d0b0 (diff)
perf sort: Introduce sort__mode variable
It's used for determining current sort mode which can be one of NORMAL, BRANCH and new MEMORY. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1364816125-12212-5-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/sort.c4
-rw-r--r--tools/perf/util/sort.h8
2 files changed, 9 insertions, 3 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 16d5e38befe5..a6ddad41d57a 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -9,7 +9,7 @@ const char *sort_order = default_sort_order;
9int sort__need_collapse = 0; 9int sort__need_collapse = 0;
10int sort__has_parent = 0; 10int sort__has_parent = 0;
11int sort__has_sym = 0; 11int sort__has_sym = 0;
12int sort__branch_mode = -1; /* -1 = means not set */ 12enum sort_mode sort__mode = SORT_MODE__NORMAL;
13 13
14enum sort_type sort__first_dimension; 14enum sort_type sort__first_dimension;
15 15
@@ -943,7 +943,7 @@ int sort_dimension__add(const char *tok)
943 if (strncasecmp(tok, sd->name, strlen(tok))) 943 if (strncasecmp(tok, sd->name, strlen(tok)))
944 continue; 944 continue;
945 945
946 if (sort__branch_mode != 1) 946 if (sort__mode != SORT_MODE__BRANCH)
947 return -EINVAL; 947 return -EINVAL;
948 948
949 if (sd->entry == &sort_sym_from || sd->entry == &sort_sym_to) 949 if (sd->entry == &sort_sym_from || sd->entry == &sort_sym_to)
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index f24bdf64238c..39ff4b86ae84 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -32,7 +32,7 @@ extern const char default_sort_order[];
32extern int sort__need_collapse; 32extern int sort__need_collapse;
33extern int sort__has_parent; 33extern int sort__has_parent;
34extern int sort__has_sym; 34extern int sort__has_sym;
35extern int sort__branch_mode; 35extern enum sort_mode sort__mode;
36extern struct sort_entry sort_comm; 36extern struct sort_entry sort_comm;
37extern struct sort_entry sort_dso; 37extern struct sort_entry sort_dso;
38extern struct sort_entry sort_sym; 38extern struct sort_entry sort_sym;
@@ -123,6 +123,12 @@ static inline void hist_entry__add_pair(struct hist_entry *he,
123 list_add_tail(&he->pairs.head, &pair->pairs.node); 123 list_add_tail(&he->pairs.head, &pair->pairs.node);
124} 124}
125 125
126enum sort_mode {
127 SORT_MODE__NORMAL,
128 SORT_MODE__BRANCH,
129 SORT_MODE__MEMORY,
130};
131
126enum sort_type { 132enum sort_type {
127 /* common sort keys */ 133 /* common sort keys */
128 SORT_PID, 134 SORT_PID,