Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755246AbZKTWwW (ORCPT ); Fri, 20 Nov 2009 17:52:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754129AbZKTWvd (ORCPT ); Fri, 20 Nov 2009 17:51:33 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:58656 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753704AbZKTWvc (ORCPT ); Fri, 20 Nov 2009 17:51:32 -0500 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , =?utf-8?q?Fr=C3=A9d=C3=A9ric=20Weisbecker?= , Mike Galbraith , Peter Zijlstra , Paul Mackerras Subject: [PATCH 3/6] perf symbols: Introduce dso__build_id_equal Date: Fri, 20 Nov 2009 20:51:26 -0200 Message-Id: <1258757489-5978-3-git-send-email-acme@infradead.org> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: <1258757489-5978-2-git-send-email-acme@infradead.org> References: <1258757489-5978-1-git-send-email-acme@infradead.org> <1258757489-5978-2-git-send-email-acme@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1327 Lines: 47 From: Arnaldo Carvalho de Melo Will be used in more places. Cc: Frédéric Weisbecker Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Paul Mackerras Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/symbol.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index d220308..c324bdf 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; } -- 1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/