diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-12-18 00:21:10 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-18 12:43:04 -0500 |
commit | 68f6d0224b2a19a4da4a12a5081f01776e5150df (patch) | |
tree | e89e1cc01a62c4d400bc43087ac2e65d71352877 | |
parent | 2037be53b2bceac3c2e648b8ff3fd62e21af2d35 (diff) |
perf sort: Do not compare dso again
The commit 09600e0f9ebb ("perf tools: Compare dso's also when comparing
symbols") added a comparison of dso when comparing symbol.
But if the sort key already has dso, it doesn't need to do it again
since entries have a different dso already filtered out.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
Cc: Frederic Weisbecker <fweisbec@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: Rodrigo Campos <rodrigo@sdfg.com.ar>
Link: http://lkml.kernel.org/r/1387344086-12744-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/sort.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 68a4fd2f505e..635cd8f8b22e 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -13,6 +13,7 @@ int have_ignore_callees = 0; | |||
13 | int sort__need_collapse = 0; | 13 | int sort__need_collapse = 0; |
14 | int sort__has_parent = 0; | 14 | int sort__has_parent = 0; |
15 | int sort__has_sym = 0; | 15 | int sort__has_sym = 0; |
16 | int sort__has_dso = 0; | ||
16 | enum sort_mode sort__mode = SORT_MODE__NORMAL; | 17 | enum sort_mode sort__mode = SORT_MODE__NORMAL; |
17 | 18 | ||
18 | enum sort_type sort__first_dimension; | 19 | enum sort_type sort__first_dimension; |
@@ -194,9 +195,11 @@ sort__sym_cmp(struct hist_entry *left, struct hist_entry *right) | |||
194 | * comparing symbol address alone is not enough since it's a | 195 | * comparing symbol address alone is not enough since it's a |
195 | * relative address within a dso. | 196 | * relative address within a dso. |
196 | */ | 197 | */ |
197 | ret = sort__dso_cmp(left, right); | 198 | if (!sort__has_dso) { |
198 | if (ret != 0) | 199 | ret = sort__dso_cmp(left, right); |
199 | return ret; | 200 | if (ret != 0) |
201 | return ret; | ||
202 | } | ||
200 | 203 | ||
201 | return _sort__sym_cmp(left->ms.sym, right->ms.sym); | 204 | return _sort__sym_cmp(left->ms.sym, right->ms.sym); |
202 | } | 205 | } |
@@ -1061,6 +1064,8 @@ int sort_dimension__add(const char *tok) | |||
1061 | sort__has_parent = 1; | 1064 | sort__has_parent = 1; |
1062 | } else if (sd->entry == &sort_sym) { | 1065 | } else if (sd->entry == &sort_sym) { |
1063 | sort__has_sym = 1; | 1066 | sort__has_sym = 1; |
1067 | } else if (sd->entry == &sort_dso) { | ||
1068 | sort__has_dso = 1; | ||
1064 | } | 1069 | } |
1065 | 1070 | ||
1066 | __sort_dimension__add(sd, i); | 1071 | __sort_dimension__add(sd, i); |