diff mbox series

[3/3] kernel-shark: sched_events plugin init with sched_switch events only

Message ID 20190305143924.11056-4-ykaradzhov@vmware.com (mailing list archive)
State Accepted
Commit 2c82741856a71cc42155014b2148ab70fd63650e
Headers show
Series Improvements and fixes for sched_switch plugin | expand

Commit Message

Yordan Karadzhov March 5, 2019, 2:39 p.m. UTC
The sched_events plugin should not be totally disabled when the
wakeup events are missing. The initialization of the plugin must
fail only if the trace.dat file contains no sched_switch events.

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark/src/plugins/sched_events.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Slavomir Kaslev March 5, 2019, 3:57 p.m. UTC | #1
On Tue, Mar 05, 2019 at 04:39:24PM +0200, Yordan Karadzhov wrote:
> The sched_events plugin should not be totally disabled when the
> wakeup events are missing. The initialization of the plugin must
> fail only if the trace.dat file contains no sched_switch events.
> 
> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
> ---
>  kernel-shark/src/plugins/sched_events.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/kernel-shark/src/plugins/sched_events.c b/kernel-shark/src/plugins/sched_events.c
> index fe13e6a..c52fb29 100644
> --- a/kernel-shark/src/plugins/sched_events.c
> +++ b/kernel-shark/src/plugins/sched_events.c
> @@ -104,9 +104,6 @@ static bool plugin_sched_init_context(struct kshark_context *kshark_ctx)
>  					   &plugin_ctx->sched_waking_event,
>  					   &plugin_ctx->sched_waking_pid_field);
>  
> -	if (!wakeup_found)
> -		return false;
> -
>  	plugin_ctx->second_pass_hash = tracecmd_filter_id_hash_alloc();
>  
>  	return true;

Looks good to me.

Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>

Thank you,

-- Slavi
Steven Rostedt March 5, 2019, 5:09 p.m. UTC | #2
On Tue,  5 Mar 2019 16:39:24 +0200
Yordan Karadzhov <ykaradzhov@vmware.com> wrote:

> The sched_events plugin should not be totally disabled when the
> wakeup events are missing. The initialization of the plugin must
> fail only if the trace.dat file contains no sched_switch events.
> 

I added:

Reported-by: Phil Auld <pauld@redhat.com>

-- Steve

> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
> ---
>  kernel-shark/src/plugins/sched_events.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/kernel-shark/src/plugins/sched_events.c b/kernel-shark/src/plugins/sched_events.c
> index fe13e6a..c52fb29 100644
> --- a/kernel-shark/src/plugins/sched_events.c
> +++ b/kernel-shark/src/plugins/sched_events.c
> @@ -104,9 +104,6 @@ static bool plugin_sched_init_context(struct kshark_context *kshark_ctx)
>  					   &plugin_ctx->sched_waking_event,
>  					   &plugin_ctx->sched_waking_pid_field);
>  
> -	if (!wakeup_found)
> -		return false;
> -
>  	plugin_ctx->second_pass_hash = tracecmd_filter_id_hash_alloc();
>  
>  	return true;
Steven Rostedt March 5, 2019, 5:13 p.m. UTC | #3
On Tue, 5 Mar 2019 17:57:55 +0200
Slavomir Kaslev <kaslevs@vmware.com> wrote:

> Looks good to me.
> 
> Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>

Thanks Yordan and Slavomir,

I applied the patches.

-- Steve
diff mbox series

Patch

diff --git a/kernel-shark/src/plugins/sched_events.c b/kernel-shark/src/plugins/sched_events.c
index fe13e6a..c52fb29 100644
--- a/kernel-shark/src/plugins/sched_events.c
+++ b/kernel-shark/src/plugins/sched_events.c
@@ -104,9 +104,6 @@  static bool plugin_sched_init_context(struct kshark_context *kshark_ctx)
 					   &plugin_ctx->sched_waking_event,
 					   &plugin_ctx->sched_waking_pid_field);
 
-	if (!wakeup_found)
-		return false;
-
 	plugin_ctx->second_pass_hash = tracecmd_filter_id_hash_alloc();
 
 	return true;