linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yafang Shao <laoar.shao@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	 Kees Cook <keescook@chromium.org>,
	Petr Mladek <pmladek@suse.com>,
	 David Hildenbrand <david@redhat.com>,
	Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
	 Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	linux-mm <linux-mm@kvack.org>,  bpf <bpf@vger.kernel.org>,
	"linux-perf-use." <linux-perf-users@vger.kernel.org>,
	 Linux-Fsdevel <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Michal Miroslaw <mirq-linux@rere.qmqm.pl>,
	 Peter Zijlstra <peterz@infradead.org>,
	Matthew Wilcox <willy@infradead.org>,
	 Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH -mm 5/5] bpf/progs: replace hard-coded 16 with TASK_COMM_LEN
Date: Sun, 5 Dec 2021 15:25:27 +0800	[thread overview]
Message-ID: <CALOAHbBv-_5uF=T4MyC_6J08PRX6KTGora4FArdYKLC0dOy8HQ@mail.gmail.com> (raw)
In-Reply-To: <CAADnVQLu+RWSeMfOe5eBuTsp9gxPsFC_bRTXoWmvWP+Lv_rZzQ@mail.gmail.com>

On Sun, Dec 5, 2021 at 11:13 AM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Sat, Dec 4, 2021 at 6:45 PM Yafang Shao <laoar.shao@gmail.com> wrote:
> >
> > On Sun, Dec 5, 2021 at 12:44 AM Alexei Starovoitov
> > <alexei.starovoitov@gmail.com> wrote:
> > >
> > > On Sat, Dec 4, 2021 at 1:53 AM Yafang Shao <laoar.shao@gmail.com> wrote:
> > > >
> > > >  static int process_sample(void *ctx, void *data, size_t len)
> > > >  {
> > > > -       struct sample *s = data;
> > > > +       struct sample_ringbuf *s = data;
> > >
> > > This is becoming pointless churn.
> > > Nack.
> > >
> > > > index 145028b52ad8..7b1bb73c3501 100644
> > > > --- a/tools/testing/selftests/bpf/progs/test_core_reloc_kernel.c
> > > > +++ b/tools/testing/selftests/bpf/progs/test_core_reloc_kernel.c
> > > > @@ -1,8 +1,7 @@
> > > >  // SPDX-License-Identifier: GPL-2.0
> > > >  // Copyright (c) 2019 Facebook
> > > >
> > > > -#include <linux/bpf.h>
> > > > -#include <stdint.h>
> > > > +#include <vmlinux.h>
> > > >  #include <stdbool.h>
> > > >  #include <bpf/bpf_helpers.h>
> > > >  #include <bpf/bpf_core_read.h>
> > > > @@ -23,11 +22,11 @@ struct core_reloc_kernel_output {
> > > >         int comm_len;
> > > >  };
> > > >
> > > > -struct task_struct {
> > > > +struct task_struct_reloc {
> > >
> > > Churn that is not even compile tested.
> >
> > It is strange that I have successfully compiled it....
> > Below is the compile log,
> >
> > $ cat make.log | grep test_core_reloc_kernel
> >   CLNG-BPF [test_maps] test_core_reloc_kernel.o
> >   GEN-SKEL [test_progs] test_core_reloc_kernel.skel.h
> >   CLNG-BPF [test_maps] test_core_reloc_kernel.o
> >   GEN-SKEL [test_progs-no_alu32] test_core_reloc_kernel.skel.h
> >
> > Also there's no error in the compile log.
>
> and ran the tests too?

My bad. I thought it was just a name change, which will work well if
it can be compiled successfully.
But it seems the task_struct in this file is a dummy struct, which
will be relocated to the real task_struct defined in the kernel.
We can't include vmlinux.h in this file, as it is for the relocation test.

-- 
Thanks
Yafang


      reply	other threads:[~2021-12-05  7:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-04  9:52 [PATCH -mm 0/5] Phase 2 of task comm cleanups Yafang Shao
2021-12-04  9:52 ` [PATCH -mm 1/5] elfcore: replace old hard-code 16 with TASK_COMM_LEN_16 Yafang Shao
2021-12-08 18:39   ` Steven Rostedt
2021-12-04  9:52 ` [PATCH -mm 2/5] cn_proc: replaced old hard-coded " Yafang Shao
2021-12-08 18:40   ` Steven Rostedt
2021-12-04  9:52 ` [PATCH -mm 3/5] samples/bpf/tracex2: replace hard-coded 16 with TASK_COMM_LEN Yafang Shao
2021-12-04 16:45   ` Alexei Starovoitov
2021-12-04  9:52 ` [PATCH -mm 4/5] tools/perf: " Yafang Shao
2021-12-08 18:43   ` Steven Rostedt
2021-12-09  2:42     ` Yafang Shao
2021-12-04  9:52 ` [PATCH -mm 5/5] bpf/progs: " Yafang Shao
2021-12-04 16:44   ` Alexei Starovoitov
2021-12-05  2:44     ` Yafang Shao
2021-12-05  3:13       ` Alexei Starovoitov
2021-12-05  7:25         ` Yafang Shao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALOAHbBv-_5uF=T4MyC_6J08PRX6KTGora4FArdYKLC0dOy8HQ@mail.gmail.com' \
    --to=laoar.shao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=david@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox