Re: [PATCH bpf-next 1/3] bpf: Parameterize task iterators.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.







[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux