[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1381802517-18812-2-git-send-email-namhyung@kernel.org>
Date: Tue, 15 Oct 2013 11:01:57 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung.kim@....com>,
LKML <linux-kernel@...r.kernel.org>,
Jiri Olsa <jolsa@...hat.com>, David Ahern <dsahern@...il.com>
Subject: [RFC/PATCH 2/2] perf tools: Sort dso using pointers
From: Namhyung Kim <namhyung.kim@....com>
The dso's in a perf session are maintained machine-wide so same dso is
shared by hist entries. Thus just checking pointer should be enough
to comparing dso's.
It may change behavior of 'perf report -s dso' when there're two or
more dso's that have same basename - the dso's which have same name
used to merged to one unless -v option was given. But I don't think
it's a big problem. ;)
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
tools/perf/util/sort.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 1f9821db9e77..70658a0834e3 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -114,20 +114,8 @@ static int64_t _sort__dso_cmp(struct map *map_l, struct map *map_r)
{
struct dso *dso_l = map_l ? map_l->dso : NULL;
struct dso *dso_r = map_r ? map_r->dso : NULL;
- const char *dso_name_l, *dso_name_r;
- if (!dso_l || !dso_r)
- return cmp_null(dso_l, dso_r);
-
- if (verbose) {
- dso_name_l = dso_l->long_name;
- dso_name_r = dso_r->long_name;
- } else {
- dso_name_l = dso_l->short_name;
- dso_name_r = dso_r->short_name;
- }
-
- return strcmp(dso_name_l, dso_name_r);
+ return (int64_t)(dso_l - dso_r);
}
static int64_t
--
1.7.11.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists