From patchwork Thu Nov 1 21:45:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10759641 Return-Path: Received: from mail-eopbgr810073.outbound.protection.outlook.com ([40.107.81.73]:3002 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727001AbeKBGu0 (ORCPT ); Fri, 2 Nov 2018 02:50:26 -0400 From: Yordan Karadzhov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH 1/8] kernel-shark-qt: Free all collections when closing the trace file. Date: Thu, 1 Nov 2018 21:45:37 +0000 Message-ID: <20181101214512.18684-2-ykaradzhov@vmware.com> References: <20181101214512.18684-1-ykaradzhov@vmware.com> In-Reply-To: <20181101214512.18684-1-ykaradzhov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: All data collections are file specific. We have to guarantee that collections from one file cannot be used with another file. Signed-off-by: Yordan Karadzhov --- kernel-shark-qt/src/libkshark.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel-shark-qt/src/libkshark.c b/kernel-shark-qt/src/libkshark.c index 33d25de..64236a5 100644 --- a/kernel-shark-qt/src/libkshark.c +++ b/kernel-shark-qt/src/libkshark.c @@ -188,6 +188,13 @@ void kshark_close(struct kshark_context *kshark_ctx) kshark_ctx->advanced_event_filter = NULL; } + /* + * All data collections are file specific. Make sure that collections + * from this file are not going to be used with another file. + */ + kshark_free_collection_list(kshark_ctx->collections); + kshark_ctx->collections = NULL; + tracecmd_close(kshark_ctx->handle); kshark_ctx->handle = NULL; kshark_ctx->pevent = NULL;