From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752098AbcEKD0z (ORCPT ); Tue, 10 May 2016 23:26:55 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33073 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751682AbcEKD0y (ORCPT ); Tue, 10 May 2016 23:26:54 -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 0/4] perf script: fix duplicate symbols in db-export Date: Tue, 10 May 2016 20:26:45 -0700 Message-Id: <1462937209-6032-1-git-send-email-cphlipot0@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes since v1: - fixed scripts/checkpatch.pl errors This patch set contains 3 fixes for duplicate symbol creation in the db-export implementation and one new symbol API required for the fixes. commit 9c7b37cd63d0 ("perf symbols: Fix handling of zero-length symbols.") already removed the majority of duplicates, but these fixes take care of the remaining corner cases. each patch (except for the 1st, which is a dependency for patch 2) reduces the number of duplicate symbols exported. When all patches are applied, my test workload has no more duplicate symbols being exported. Tests ran: $perf record --call-graph=dwarf stress -c 2 -t 20 $perf script -s scripts/python/export-to-postgresql.py test all callchains $psql test To show the effect of the changes we run the following query before/after the changes on a database created using the export-to-postgresql.py script with callchains enabled. If this query returns any value greater than 1, then it means that there are duplicates present. In the test workload, at least one symbol occurs 299 times before applying the fixes: test=# select count(*) as cnt from symbols group by sym_start,sym_end,dso_id order by cnt desc limit 1; cnt ----- 299 (1 row) After applying the fixes no symbol occurs more than once: test=# select count(*) as cnt from symbols group by sym_start,sym_end,dso_id order by cnt desc limit 1; cnt ----- 1 (1 row) Chris Phlipot (4): perf symbols: add dso__insert_symbol function perf script: fix symbol insertion behavior in db-export perf script: fix callchain addresses in db-export perf script: fix export of callchains with recursion in db-export tools/perf/util/db-export.c | 12 ++++++------ tools/perf/util/symbol.c | 12 ++++++++++++ tools/perf/util/symbol.h | 3 +++ 3 files changed, 21 insertions(+), 6 deletions(-) -- 2.7.4