perf symbols: Introduce dso__build_id_equal
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 20 Nov 2009 22:51:26 +0000 (20:51 -0200)
committerIngo Molnar <mingo@elte.hu>
Sat, 21 Nov 2009 13:11:33 +0000 (14:11 +0100)
Will be used in more places.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1258757489-5978-3-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/util/symbol.c

index d22030828c217572a0e250743e4061df1a7b36a5..c324bdf8baba1bd4bac10fd752672c065c8fb781 100644 (file)
@@ -884,6 +884,11 @@ out_close:
        return err;
 }
 
+static bool dso__build_id_equal(const struct dso *self, u8 *build_id)
+{
+       return memcmp(self->build_id, build_id, sizeof(self->build_id)) == 0;
+}
+
 bool dsos__read_build_ids(void)
 {
        bool have_build_id = false;
@@ -1099,8 +1104,7 @@ more:
                                                    sizeof(build_id)) < 0)
                                goto more;
 compare_build_id:
-                       if (memcmp(build_id, self->build_id,
-                                  sizeof(self->build_id)) != 0)
+                       if (!dso__build_id_equal(self, build_id))
                                goto more;
                }