Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755326AbbKRGtG (ORCPT ); Wed, 18 Nov 2015 01:49:06 -0500 Received: from mail7.hitachi.co.jp ([133.145.228.42]:39340 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755205AbbKRGr1 (ORCPT ); Wed, 18 Nov 2015 01:47:27 -0500 X-AuditID: 85900ec0-9e1cab9000001a57-93-564c1efb9f5b Subject: [PATCH perf/core 07/13] perf: Fix to destroy kernel maps when machine exits From: Masami Hiramatsu To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, Adrian Hunter , Ingo Molnar , Namhyung Kim , Jiri Olsa Date: Wed, 18 Nov 2015 15:40:24 +0900 Message-ID: <20151118064024.30709.43577.stgit@localhost.localdomain> In-Reply-To: <20151118064009.30709.74354.stgit@localhost.localdomain> References: <20151118064009.30709.74354.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1656 Lines: 56 Actually machine__exit forgot to call machine__destroy_kernel_maps. So this fixes to call it. This fixes some memory leaks on map as below. Without this fix. ---- ./perf probe vfs_read Added new event: probe:vfs_read (on vfs_read) You can now use it in all perf tools, such as: perf record -e probe:vfs_read -aR sleep 1 REFCNT: BUG: Unreclaimed objects found. REFCNT: Total 4 objects are not reclaimed. To see all backtraces, rerun with -v option ---- With this fix. ---- ./perf probe vfs_read Added new event: probe:vfs_read (on vfs_read) You can now use it in all perf tools, such as: perf record -e probe:vfs_read -aR sleep 1 REFCNT: BUG: Unreclaimed objects found. REFCNT: Total 2 objects are not reclaimed. To see all backtraces, rerun with -v option ---- Signed-off-by: Masami Hiramatsu --- tools/perf/util/machine.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 7c647d3..15282df 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -121,6 +121,7 @@ void machine__delete_threads(struct machine *machine) void machine__exit(struct machine *machine) { + machine__destroy_kernel_maps(machine); map_groups__exit(&machine->kmaps); dsos__exit(&machine->dsos); machine__exit_vdso(machine); -- 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/