Re: [PATCH bpf-next v2 05/11] bpf: Add dump_stack() analogue to print to BPF stderr

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

 



On Wed, 28 May 2025 at 02:45, Eduard Zingerman <eddyz87@xxxxxxxxx> wrote:
>
> Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> writes:
>
> Could you please modify one of the selftests to check lines reported by
> dump stack?

Ok, will try to do it with a regex pattern to match the overall layout.

>
> Acked-by: Eduard Zingerman <eddyz87@xxxxxxxxx>
>
> [...]
>
> > diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> > index 6985e793e927..aab5ea17a329 100644
> > --- a/include/linux/bpf.h
> > +++ b/include/linux/bpf.h
> > @@ -3613,8 +3613,10 @@ __printf(2, 3)
> >  int bpf_stream_stage_printk(struct bpf_stream_stage *ss, const char *fmt, ...);
> >  int bpf_stream_stage_commit(struct bpf_stream_stage *ss, struct bpf_prog *prog,
> >                           enum bpf_stream_id stream_id);
> > +int bpf_stream_stage_dump_stack(struct bpf_stream_stage *ss);
> >
> >  #define bpf_stream_printk(...) bpf_stream_stage_printk(&__ss, __VA_ARGS__)
> > +#define bpf_stream_dump_stack() bpf_stream_stage_dump_stack(&__ss)
>
> I don't think we should add macro with hard-coded variable names (`__ss`)
> in common headers.

Hm, right. But this is supposed to be used within the stream stage
block, and we have __i variables in macros that wrap around loops
etc., hence the double / triple underscore to not conflict. Anyhow,
I'm open to other suggestions.

>
> [...]




[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