Re: [RFC bpf-next v1 4/8] selftests/bpf: extract utility function for BPF disassembly

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

 



On Tue, 2024-07-02 at 14:16 -0700, Andrii Nakryiko wrote:

[...]

> struct bpf_insn *insn = skip_first_insn ? buf + 1 : buf, *insn_end = buf + cnt;
> 
> while (insn != insn_end) {
>     insn = disasm_insn(insn, insn_buf, sizeof(insn_buf));
>     fprintf(prog_out, "%s\n", insn_buf);
> }
> 
> less addition, but it's simple enough in both cases, of course (I just
> find 1 or 2 as a result kind of a bad contract, but whatever)

Will change.

[...]

> > > > +       sscanf(buf, "(%*[^)]) %n", &pfx_end);
> > > 
> > > let me simplify this a bit ;)
> > > 
> > > pfx_end = 5;
> > > 
> > > not as sophisticated, but equivalent
> > 
> > Okay :(
> 
> if 5 makes you sad, do keep sscanf(), of course, no worries :)

The obscure doc makes me even more sad.

[...]





[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