BPF List
 help / color / mirror / Atom feed
From: Kui-Feng Lee <kuifeng@fb.com>
To: "olsajiri@gmail.com" <olsajiri@gmail.com>
Cc: "daniel@iogearbox.net" <daniel@iogearbox.net>,
	Kernel Team <Kernel-team@fb.com>, Yonghong Song <yhs@fb.com>,
	"ast@kernel.org" <ast@kernel.org>,
	"andrii@kernel.org" <andrii@kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next 1/3] bpf: Parameterize task iterators.
Date: Wed, 27 Jul 2022 06:39:10 +0000	[thread overview]
Message-ID: <31968bfd1f694439c2354f5ef3bd5117c2893dbd.camel@fb.com> (raw)
In-Reply-To: <Yt/pyDUuvS1rwlpc@krava>

On Tue, 2022-07-26 at 15:19 +0200, Jiri Olsa wrote:
> On Tue, Jul 26, 2022 at 02:13:17PM +0200, Jiri Olsa wrote:
> > > -static struct task_struct *task_seq_get_next(struct
> > > pid_namespace *ns,
> > > +static struct task_struct *task_seq_get_next(struct
> > > bpf_iter_seq_task_common *common,
> > >                                              u32 *tid,
> > >                                              bool
> > > skip_if_dup_files)
> > >  {
> > >         struct task_struct *task = NULL;
> > >         struct pid *pid;
> > >  
> > > +       if (common->type == BPF_TASK_ITER_TID) {
> > > +               if (*tid)
> > > +                       return NULL;
> > 
> > I tested and this condition breaks it for fd iterations, not sure
> > about
> > the task and vma, because they share this function
> > 
> > if bpf_seq_read is called with small buffer there will be multiple
> > calls
> > to task_file_seq_get_next and second one will stop in here, even if
> > there
> > are more files to be displayed for the task in filter
> 
> I mean there will be multiple calls of following sequence:
> 
>   bpf_seq_read
>     task_file_seq_start
>       task_seq_get_next
> 
> and 2nd one will return NULL in task_seq_get_next,
> because info->tid is already set

Ok!  I got your point.  I will fix it ASAP.




  reply	other threads:[~2022-07-27  6:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26  5:17 [PATCH bpf-next 0/3] Parameterize task iterators Kui-Feng Lee
2022-07-26  5:17 ` [PATCH bpf-next 1/3] bpf: " Kui-Feng Lee
2022-07-26 12:13   ` Jiri Olsa
2022-07-26 13:19     ` Jiri Olsa
2022-07-27  6:39       ` Kui-Feng Lee [this message]
2022-07-27  6:56     ` Kui-Feng Lee
2022-07-27  8:19       ` Kumar Kartikeya Dwivedi
2022-07-28  5:25         ` Kui-Feng Lee
2022-07-28  8:47           ` Kumar Kartikeya Dwivedi
2022-07-28 15:16             ` Kui-Feng Lee
2022-07-28 16:22               ` Kumar Kartikeya Dwivedi
2022-07-28 16:40                 ` Kui-Feng Lee
2022-07-28 17:08                   ` Yonghong Song
2022-07-28 17:52                     ` Kumar Kartikeya Dwivedi
2022-07-28 19:11                       ` Hao Luo
2022-08-02 14:25                         ` Kumar Kartikeya Dwivedi
2022-07-28 22:54                       ` Yonghong Song
2022-07-29  9:10                         ` Christian Brauner
     [not found]                   ` <CAP01T74HRHapKDAfj104KNGnzCgNQSu_M5-KfEvGBNzLWNfd+Q@mail.gmail.com>
2022-07-30  2:46                     ` Kui-Feng Lee
2022-07-28 18:01                 ` Hao Luo
2022-07-26  5:17 ` [PATCH bpf-next 2/3] bpf: Handle bpf_link_info for the parameterized task BPF iterators Kui-Feng Lee
2022-07-26  5:17 ` [PATCH bpf-next 3/3] selftests/bpf: Test " Kui-Feng Lee

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=31968bfd1f694439c2354f5ef3bd5117c2893dbd.camel@fb.com \
    --to=kuifeng@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=olsajiri@gmail.com \
    --cc=yhs@fb.com \
    /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