From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752631AbcEKD16 (ORCPT ); Tue, 10 May 2016 23:27:58 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:33356 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752146AbcEKD06 (ORCPT ); Tue, 10 May 2016 23:26:58 -0400 From: Chris Phlipot To: adrian.hunter@intel.com, acme@kernel.org, peterz@infradead.org, mingo@redhat.com Cc: linux-kernel@vger.kernel.org, Chris Phlipot Subject: [PATCH v2 2/4] perf script: fix symbol insertion behavior in db-export Date: Tue, 10 May 2016 20:26:47 -0700 Message-Id: <1462937209-6032-3-git-send-email-cphlipot0@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1462937209-6032-1-git-send-email-cphlipot0@gmail.com> References: <1462937209-6032-1-git-send-email-cphlipot0@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the dso__insert_symbol function instead of symbols__insert in order to properly update the dso symbol cache. If the cache is not updated, then duplicate symbols can be unintentionally created, inserted, and exported. This change prevents duplicate symbols from being exported due to dso__find_symbol using a stale symbol cache. Signed-off-by: Chris Phlipot --- tools/perf/util/db-export.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c index f8e3057..2ef1f69 100644 --- a/tools/perf/util/db-export.c +++ b/tools/perf/util/db-export.c @@ -260,8 +260,7 @@ static int db_ids_from_al(struct db_export *dbe, struct addr_location *al, if (!al->sym) { al->sym = symbol__new(al->addr, 0, 0, "unknown"); if (al->sym) - symbols__insert(&dso->symbols[al->map->type], - al->sym); + dso__insert_symbol(dso, al->map->type, al->sym); } if (al->sym) { -- 2.7.4