Linux-Trace-Devel Archive on lore.kernel.org
 help / Atom feed
* [PATCH v3] kernel-shark-qt: Fix a bug in the plugin actions execution
@ 2019-01-10 13:54 Yordan Karadzhov
  2019-01-10 14:35 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Yordan Karadzhov @ 2019-01-10 13:54 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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 <ykaradzhov@vmware.com>
---
 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;
-- 
2.17.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] kernel-shark-qt: Fix a bug in the plugin actions execution
  2019-01-10 13:54 [PATCH v3] kernel-shark-qt: Fix a bug in the plugin actions execution Yordan Karadzhov
@ 2019-01-10 14:35 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2019-01-10 14:35 UTC (permalink / raw)
  To: Yordan Karadzhov; +Cc: linux-trace-devel

On Thu, 10 Jan 2019 15:54:49 +0200
Yordan Karadzhov <ykaradzhov@vmware.com> wrote:

> 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.

Applied.

Note, for bug fixes, lets start adding a "Fixes" tag (like the Linux
kernel does).

For instance, I'm adding this:

Fixes: c70227ebb264 ("kernel-shark-qt: Add Plugin event handlers to session.")
> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>

The format is, 12 characters of the sha1 of the commit that the patch
is fixing, followed by the title of the commit in: ("<commit-title>")

This way, if distros start supporting "stable" versions, they can see
if they should backport a patch or not.

Thanks!

-- Steve

> ---
>  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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10 13:54 [PATCH v3] kernel-shark-qt: Fix a bug in the plugin actions execution Yordan Karadzhov
2019-01-10 14:35 ` Steven Rostedt

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org linux-trace-devel@archiver.kernel.org
	public-inbox-index linux-trace-devel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox