From patchwork Thu Jan 10 13:54:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10760269 Return-Path: Received: from mail-wm1-f67.google.com ([209.85.128.67]:38751 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727932AbfAJNzE (ORCPT ); Thu, 10 Jan 2019 08:55:04 -0500 Received: by mail-wm1-f67.google.com with SMTP id m22so12206593wml.3 for ; Thu, 10 Jan 2019 05:55:03 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v3] kernel-shark-qt: Fix a bug in the plugin actions execution Date: Thu, 10 Jan 2019 15:54:49 +0200 Message-Id: <20190110135449.20743-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 content of the kshark_entries generated by a given event type and we consider the case of having multiple 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 event types. 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;