diff mbox series

tools/runqslower: Change state to __state

Message ID 20210706204005.92541-1-jolsa@kernel.org (mailing list archive)
State Accepted
Commit cced7490b172240dd74eb0ef8cc49f0a74df7932
Delegated to: BPF
Headers show
Series tools/runqslower: Change state to __state | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Jiri Olsa July 6, 2021, 8:40 p.m. UTC
The task_struct state got renamed to __state, causing
compile fail:

  runqslower.bpf.c:77:12: error: no member named 'state' in 'struct task_struct'
        if (prev->state == TASK_RUNNING)

As this is tracing prog, I think we don't need to use
READ_ONCE to access __state.

Fixes: 2f064a59a11f ("sched: Change task_struct::state")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/bpf/runqslower/runqslower.bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Song Liu July 6, 2021, 10:53 p.m. UTC | #1
On Tue, Jul 6, 2021 at 1:40 PM Jiri Olsa <jolsa@redhat.com> wrote:
>
> The task_struct state got renamed to __state, causing
> compile fail:
>
>   runqslower.bpf.c:77:12: error: no member named 'state' in 'struct task_struct'
>         if (prev->state == TASK_RUNNING)
>
> As this is tracing prog, I think we don't need to use
> READ_ONCE to access __state.
>
> Fixes: 2f064a59a11f ("sched: Change task_struct::state")
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>

Acked-by: Song Liu <songliubraving@fb.com>
Song Liu July 6, 2021, 10:57 p.m. UTC | #2
On Tue, Jul 6, 2021 at 3:53 PM Song Liu <song@kernel.org> wrote:
>
> On Tue, Jul 6, 2021 at 1:40 PM Jiri Olsa <jolsa@redhat.com> wrote:
> >
> > The task_struct state got renamed to __state, causing
> > compile fail:
> >
> >   runqslower.bpf.c:77:12: error: no member named 'state' in 'struct task_struct'
> >         if (prev->state == TASK_RUNNING)
> >
> > As this is tracing prog, I think we don't need to use
> > READ_ONCE to access __state.
> >
> > Fixes: 2f064a59a11f ("sched: Change task_struct::state")
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
>
> Acked-by: Song Liu <songliubraving@fb.com>

Just realized there is another thread fixing the same error.

Thanks,
Song
patchwork-bot+netdevbpf@kernel.org July 7, 2021, 4:20 p.m. UTC | #3
Hello:

This patch was applied to bpf/bpf.git (refs/heads/master):

On Tue,  6 Jul 2021 22:40:05 +0200 you wrote:
> The task_struct state got renamed to __state, causing
> compile fail:
> 
>   runqslower.bpf.c:77:12: error: no member named 'state' in 'struct task_struct'
>         if (prev->state == TASK_RUNNING)
> 
> As this is tracing prog, I think we don't need to use
> READ_ONCE to access __state.
> 
> [...]

Here is the summary with links:
  - tools/runqslower: Change state to __state
    https://git.kernel.org/bpf/bpf/c/cced7490b172

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/tools/bpf/runqslower/runqslower.bpf.c b/tools/bpf/runqslower/runqslower.bpf.c
index 645530ca7e98..ab9353f2fd46 100644
--- a/tools/bpf/runqslower/runqslower.bpf.c
+++ b/tools/bpf/runqslower/runqslower.bpf.c
@@ -74,7 +74,7 @@  int handle__sched_switch(u64 *ctx)
 	u32 pid;
 
 	/* ivcsw: treat like an enqueue event and store timestamp */
-	if (prev->state == TASK_RUNNING)
+	if (prev->__state == TASK_RUNNING)
 		trace_enqueue(prev);
 
 	pid = next->pid;