提交 68f6d022 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

perf sort: Do not compare dso again

The commit 09600e0f ("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: NNamhyung Kim <namhyung@kernel.org>
Acked-by: NJiri 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.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 2037be53
...@@ -13,6 +13,7 @@ int have_ignore_callees = 0; ...@@ -13,6 +13,7 @@ int have_ignore_callees = 0;
int sort__need_collapse = 0; int sort__need_collapse = 0;
int sort__has_parent = 0; int sort__has_parent = 0;
int sort__has_sym = 0; int sort__has_sym = 0;
int sort__has_dso = 0;
enum sort_mode sort__mode = SORT_MODE__NORMAL; enum sort_mode sort__mode = SORT_MODE__NORMAL;
enum sort_type sort__first_dimension; enum sort_type sort__first_dimension;
...@@ -194,9 +195,11 @@ sort__sym_cmp(struct hist_entry *left, struct hist_entry *right) ...@@ -194,9 +195,11 @@ sort__sym_cmp(struct hist_entry *left, struct hist_entry *right)
* comparing symbol address alone is not enough since it's a * comparing symbol address alone is not enough since it's a
* relative address within a dso. * relative address within a dso.
*/ */
ret = sort__dso_cmp(left, right); if (!sort__has_dso) {
if (ret != 0) ret = sort__dso_cmp(left, right);
return ret; if (ret != 0)
return ret;
}
return _sort__sym_cmp(left->ms.sym, right->ms.sym); return _sort__sym_cmp(left->ms.sym, right->ms.sym);
} }
...@@ -1061,6 +1064,8 @@ int sort_dimension__add(const char *tok) ...@@ -1061,6 +1064,8 @@ int sort_dimension__add(const char *tok)
sort__has_parent = 1; sort__has_parent = 1;
} else if (sd->entry == &sort_sym) { } else if (sd->entry == &sort_sym) {
sort__has_sym = 1; sort__has_sym = 1;
} else if (sd->entry == &sort_dso) {
sort__has_dso = 1;
} }
__sort_dimension__add(sd, i); __sort_dimension__add(sd, i);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册