diff mbox series

[03/17] kernel-shark-qt: Fix a byg in unset_event_filter_flag()

Message ID 20181128151530.21965-4-ykaradzhov@vmware.com (mailing list archive)
State Accepted
Commit da88342d2a9ef210acccf29ae4c5574178ce3df0
Headers show
Series More modifications and bug fixes toward KS 1.0 | expand

Commit Message

Yordan Karadzhov Nov. 28, 2018, 3:16 p.m. UTC
Currently the unset_event_filter_flag() function unsets explicitly the
EVENT_VIEW visibility flag, ignoring the user's request for visibility
of the data after the filtering. This is wrong. The value of the
coresponging bit in the user-provided mask (kshark_ctx->filter_mask),
has to be used instead.

Since the function becames very simple now it is declared as inline.

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark-qt/src/libkshark.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/kernel-shark-qt/src/libkshark.c b/kernel-shark-qt/src/libkshark.c
index fa85171..b4b3d5b 100644
--- a/kernel-shark-qt/src/libkshark.c
+++ b/kernel-shark-qt/src/libkshark.c
@@ -448,19 +448,18 @@  bool kshark_filter_is_set(struct kshark_context *kshark_ctx)
 	       filter_is_set(kshark_ctx->hide_event_filter);
 }
 
-static void unset_event_filter_flag(struct kshark_context *kshark_ctx,
-				    struct kshark_entry *e)
+static inline void unset_event_filter_flag(struct kshark_context *kshark_ctx,
+					   struct kshark_entry *e)
 {
 	/*
 	 * All entries, filtered-out by the event filters, will be treated
 	 * differently, when visualized. Because of this, ignore the value
 	 * of the GRAPH_VIEW flag provided by the user via
-	 * kshark_ctx->filter_mask and unset the EVENT_VIEW flag.
+	 * kshark_ctx->filter_mask. The value of the EVENT_VIEW flag in
+	 * kshark_ctx->filter_mask will be used instead.
 	 */
-	int event_mask = kshark_ctx->filter_mask;
+	int event_mask = kshark_ctx->filter_mask & ~KS_GRAPH_VIEW_FILTER_MASK;
 
-	event_mask &= ~KS_GRAPH_VIEW_FILTER_MASK;
-	event_mask |= KS_EVENT_VIEW_FILTER_MASK;
 	e->visible &= ~event_mask;
 }