[PATCH 1/8] kernel-shark-qt: Free all collections when closing the trace file.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <ykaradzhov@xxxxxxxxxx>
---
 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;
-- 
2.17.1





[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux