Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755415AbbLJIRH (ORCPT ); Thu, 10 Dec 2015 03:17:07 -0500 Received: from terminus.zytor.com ([198.137.202.10]:55105 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752552AbbLJIRE (ORCPT ); Thu, 10 Dec 2015 03:17:04 -0500 Date: Thu, 10 Dec 2015 00:16:45 -0800 From: tip-bot for Masami Hiramatsu Message-ID: Cc: jolsa@redhat.com, mingo@kernel.org, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, acme@redhat.com, masami.hiramatsu.pt@hitachi.com, tglx@linutronix.de, namhyung@kernel.org, a.p.zijlstra@chello.nl, hpa@zytor.com Reply-To: mingo@kernel.org, jolsa@redhat.com, adrian.hunter@intel.com, namhyung@kernel.org, tglx@linutronix.de, a.p.zijlstra@chello.nl, hpa@zytor.com, linux-kernel@vger.kernel.org, acme@redhat.com, masami.hiramatsu.pt@hitachi.com In-Reply-To: <20151209021129.10245.28710.stgit@localhost.localdomain> References: <20151209021129.10245.28710.stgit@localhost.localdomain> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf hists: Fix hists_evsel to release hists Git-Commit-ID: 17577decb2ddae28f5a449ddb79cf0ed3e2312c5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2228 Lines: 60 Commit-ID: 17577decb2ddae28f5a449ddb79cf0ed3e2312c5 Gitweb: http://git.kernel.org/tip/17577decb2ddae28f5a449ddb79cf0ed3e2312c5 Author: Masami Hiramatsu AuthorDate: Wed, 9 Dec 2015 11:11:29 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 9 Dec 2015 13:41:59 -0300 perf hists: Fix hists_evsel to release hists Since hists__init doesn't set the destructor of hists_evsel (which is an extended evsel structure), when hists_evsel is released, the extended part of the hists_evsel is not deleted (note that the hists_evsel object itself is freed). This fixes it to add a destructor for hists__evsel and to set it up. Signed-off-by: Masami Hiramatsu Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20151209021129.10245.28710.stgit@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/hist.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 6e8e0ee..565ea35 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1567,6 +1567,13 @@ static int hists_evsel__init(struct perf_evsel *evsel) return 0; } +static void hists_evsel__exit(struct perf_evsel *evsel) +{ + struct hists *hists = evsel__hists(evsel); + + hists__delete_entries(hists); +} + /* * XXX We probably need a hists_evsel__exit() to free the hist_entries * stored in the rbtree... @@ -1575,7 +1582,8 @@ static int hists_evsel__init(struct perf_evsel *evsel) int hists__init(void) { int err = perf_evsel__object_config(sizeof(struct hists_evsel), - hists_evsel__init, NULL); + hists_evsel__init, + hists_evsel__exit); if (err) fputs("FATAL ERROR: Couldn't setup hists class\n", stderr); -- 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/