From patchwork Wed Jan 9 13:09:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10760255 Return-Path: Received: from mail-wm1-f68.google.com ([209.85.128.68]:40443 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730249AbfAINKG (ORCPT ); Wed, 9 Jan 2019 08:10:06 -0500 Received: by mail-wm1-f68.google.com with SMTP id f188so8129723wmf.5 for ; Wed, 09 Jan 2019 05:10:05 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v2 6/6] kernel-shark-qt: Fix bug in plugin actions execution Date: Wed, 9 Jan 2019 15:09:45 +0200 Message-Id: <20190109130945.28519-7-ykaradzhov@vmware.com> In-Reply-To: <20190109130945.28519-1-ykaradzhov@vmware.com> References: <20190109130945.28519-1-ykaradzhov@vmware.com> Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 1284 Plugin-provided actions are executed when loading the data. These actions can be used to modify the contain of the kshark_entries generated by a given event type and we consider the case of having more than one plugin-provided actions per event type. However, the code that handles the case of multiple actions per-event has a bug. The "if" was introduced with the idea that only the last per-event action will modify the KS_PLUGIN_UNTOUCHED flag of the entry, but it misbehaves in the case of a single per-event action in the list, followed by actions for other events. Signed-off-by: Yordan Karadzhov --- kernel-shark-qt/src/libkshark.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel-shark-qt/src/libkshark.c b/kernel-shark-qt/src/libkshark.c index 598ea52..9ab2d57 100644 --- a/kernel-shark-qt/src/libkshark.c +++ b/kernel-shark-qt/src/libkshark.c @@ -750,8 +750,7 @@ static size_t get_records(struct kshark_context *kshark_ctx, entry->event_id))) { evt_handler->event_func(kshark_ctx, rec, entry); evt_handler = evt_handler->next; - if (!evt_handler) - entry->visible &= ~KS_PLUGIN_UNTOUCHED_MASK; + entry->visible &= ~KS_PLUGIN_UNTOUCHED_MASK; } pid = entry->pid;