[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220628150506.291d093a@gandalf.local.home>
Date: Tue, 28 Jun 2022 15:05:06 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Daniel Bristot de Oliveira <bristot@...nel.org>
Cc: Wim Van Sebroeck <wim@...ux-watchdog.org>,
Guenter Roeck <linux@...ck-us.net>,
Jonathan Corbet <corbet@....net>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Will Deacon <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Marco Elver <elver@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Shuah Khan <skhan@...uxfoundation.org>,
Gabriele Paoloni <gpaoloni@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Clark Williams <williams@...hat.com>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-trace-devel@...r.kernel.org
Subject: Re: [PATCH V4 11/20] rv/monitor: wwnr instrumentation and
Makefile/Kconfig entries
On Thu, 16 Jun 2022 10:44:53 +0200
Daniel Bristot de Oliveira <bristot@...nel.org> wrote:
> diff --git a/kernel/trace/rv/monitors/wwnr/wwnr.c b/kernel/trace/rv/monitors/wwnr/wwnr.c
> index 8ba01f0f0df8..3fe1ad9125d3 100644
> --- a/kernel/trace/rv/monitors/wwnr/wwnr.c
> +++ b/kernel/trace/rv/monitors/wwnr/wwnr.c
> @@ -10,11 +10,8 @@
>
> #define MODULE_NAME "wwnr"
>
> -/*
> - * XXX: include required tracepoint headers, e.g.,
> - * #include <linux/trace/events/sched.h>
> - */
> #include <trace/events/rv.h>
> +#include <trace/events/sched.h>
>
> /*
> * This is the self-generated part of the monitor. Generally, there is no need
> @@ -37,21 +34,20 @@ DECLARE_DA_MON_PER_TASK(wwnr, char);
> * are translated into model's event.
> *
> */
> -static void handle_switch_in(void *data, /* XXX: fill header */)
> +static void handle_switch(void *data, bool preempt, struct task_struct *p,
> + struct task_struct *n, unsigned int prev_state)
> {
Patch 8 was the "educational" patch. There's no reason to split 10 and 11
up too.
-- Steve
> - struct task_struct *p = /* XXX: how do I get p? */;
> - da_handle_event_wwnr(p, switch_in_wwnr);
> -}
> + /* start monitoring only after the first suspension */
> + if (prev_state == TASK_INTERRUPTIBLE)
> + da_handle_init_event_wwnr(p, switch_out_wwnr);
> + else
> + da_handle_event_wwnr(p, switch_out_wwnr);
>
> -static void handle_switch_out(void *data, /* XXX: fill header */)
> -{
> - struct task_struct *p = /* XXX: how do I get p? */;
> - da_handle_event_wwnr(p, switch_out_wwnr);
> + da_handle_event_wwnr(n, switch_in_wwnr);
> }
>
> -static void handle_wakeup(void *data, /* XXX: fill header */)
> +static void handle_wakeup(void *data, struct task_struct *p)
> {
> - struct task_struct *p = /* XXX: how do I get p? */;
> da_handle_event_wwnr(p, wakeup_wwnr);
> }
Powered by blists - more mailing lists