From 78075caad99dc36ec6ef5826b7a5273ea14295fc Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 20 Nov 2009 20:51:26 -0200 Subject: [PATCH] perf symbols: Introduce dso__build_id_equal MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Will be used in more places. Signed-off-by: Arnaldo Carvalho de Melo Cc: Frédéric Weisbecker Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Paul Mackerras LKML-Reference: <1258757489-5978-3-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar --- tools/perf/util/symbol.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index d22030828c21..c324bdf8baba 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -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; } -- 2.30.2