Re: [PATCH v2 bpf-next 7/8] bpf: smarter verifier log number printing logic

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

 



On Sat, Nov 11, 2023 at 12:17 PM Andrii Nakryiko <andrii@xxxxxxxxxx> wrote:
>
> +static void verbose_unum(struct bpf_verifier_env *env, u64 num)
> +{
> +       if (is_unum_decimal(num))
> +               verbose(env, "%llu", num);
> +       else
> +               verbose(env, "%#llx", num);

I didn't know about %#.
The kernel printk doc doesn't describe it.
Great find.
Curious, how did you discover this modifier?
Not sure whether it's worth adding a comment here
that # adds 0x. Probably not ?

> +       if (type_is_pkt_pointer(t)) {
> +               verbose_a("r=");
> +               verbose_snum(env, reg->range);
> +       }

A tiny nit...
The pkt range cannot be negative, so using Snum here
begs the question... why?
The rest looks great.
If you're ok I can fix it up to unum while applying or respin?





[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