linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel-shark: Do not change the PLUGIN_UNTOUCHED bit flag when filtering
@ 2020-05-28 11:19 Yordan Karadzhov (VMware)
  2020-05-28 12:28 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Yordan Karadzhov (VMware) @ 2020-05-28 11:19 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware)

The "visible" field of the entry has one special bit flag, that helps
the GUI to display the original tracing data (as recorded) regardless
of the possible modifications made by the plugins. This bit flag must
be preserved when applying or removing filters.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark/src/libkshark.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/kernel-shark/src/libkshark.c b/kernel-shark/src/libkshark.c
index 0905359..52aacd3 100644
--- a/kernel-shark/src/libkshark.c
+++ b/kernel-shark/src/libkshark.c
@@ -489,6 +489,11 @@ static inline void unset_event_filter_flag(struct kshark_context *kshark_ctx,
 	e->visible &= ~event_mask;
 }
 
+static void set_all_visible(uint16_t *v) {
+	/*  Keep the original value of the PLUGIN_UNTOUCHED bit flag. */
+	*v |= 0xFF & ~KS_PLUGIN_UNTOUCHED_MASK;
+}
+
 /**
  * @brief This function loops over the array of entries specified by "data"
  *	  and "n_entries" and sets the "visible" fields of each entry
@@ -525,7 +530,7 @@ void kshark_filter_entries(struct kshark_context *kshark_ctx,
 	/* Apply only the Id filters. */
 	for (i = 0; i < n_entries; ++i) {
 		/* Start with and entry which is visible everywhere. */
-		data[i]->visible = 0xFF;
+		set_all_visible(&data[i]->visible);
 
 		/* Apply event filtering. */
 		if (!kshark_show_event(kshark_ctx, data[i]->event_id))
@@ -555,9 +560,8 @@ void kshark_clear_all_filters(struct kshark_context *kshark_ctx,
 			      size_t n_entries)
 {
 	int i;
-
 	for (i = 0; i < n_entries; ++i)
-		data[i]->visible = 0xFF;
+		set_all_visible(&data[i]->visible);
 }
 
 static void kshark_set_entry_values(struct kshark_context *kshark_ctx,
-- 
2.25.1


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

* Re: [PATCH] kernel-shark: Do not change the PLUGIN_UNTOUCHED bit flag when filtering
  2020-05-28 11:19 [PATCH] kernel-shark: Do not change the PLUGIN_UNTOUCHED bit flag when filtering Yordan Karadzhov (VMware)
@ 2020-05-28 12:28 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2020-05-28 12:28 UTC (permalink / raw)
  To: Yordan Karadzhov (VMware); +Cc: linux-trace-devel

On Thu, 28 May 2020 14:19:17 +0300
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:

> The "visible" field of the entry has one special bit flag, that helps
> the GUI to display the original tracing data (as recorded) regardless
> of the possible modifications made by the plugins. This bit flag must
> be preserved when applying or removing filters.
> 
> Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
> ---
>  kernel-shark/src/libkshark.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel-shark/src/libkshark.c b/kernel-shark/src/libkshark.c
> index 0905359..52aacd3 100644
> --- a/kernel-shark/src/libkshark.c
> +++ b/kernel-shark/src/libkshark.c
> @@ -489,6 +489,11 @@ static inline void unset_event_filter_flag(struct kshark_context *kshark_ctx,
>  	e->visible &= ~event_mask;
>  }
>  
> +static void set_all_visible(uint16_t *v) {
> +	/*  Keep the original value of the PLUGIN_UNTOUCHED bit flag. */
> +	*v |= 0xFF & ~KS_PLUGIN_UNTOUCHED_MASK;

This patch is fine as is, but we really should add a KS_PLUGIN_MASK that
encompasses all bits, and replace the 0xFF with that.

-- Steve


> +}
> +
> 

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

end of thread, other threads:[~2020-05-28 12:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 11:19 [PATCH] kernel-shark: Do not change the PLUGIN_UNTOUCHED bit flag when filtering Yordan Karadzhov (VMware)
2020-05-28 12:28 ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).