From patchwork Wed Nov 28 15:16:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10760037 Return-Path: Received: from mail-eopbgr710070.outbound.protection.outlook.com ([40.107.71.70]:36576 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728664AbeK2CSL (ORCPT ); Wed, 28 Nov 2018 21:18:11 -0500 From: Yordan Karadzhov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH 03/17] kernel-shark-qt: Fix a byg in unset_event_filter_flag() Date: Wed, 28 Nov 2018 15:16:09 +0000 Message-ID: <20181128151530.21965-4-ykaradzhov@vmware.com> References: <20181128151530.21965-1-ykaradzhov@vmware.com> In-Reply-To: <20181128151530.21965-1-ykaradzhov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 1734 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 --- kernel-shark-qt/src/libkshark.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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; }