Re: [PATCH bpf-next 2/4] bpftool: add support for subskeletons

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

 



Sorry, missed this question originally.

On Fri, 2022-03-04 at 11:29 -0800, Andrii Nakryiko wrote:
> Split BTF added on top makes it a bit more
> tolerable (though there is still a bunch of unnecessary complexity and
> overhead just for that pesky asterisk).
> 
> Another alternative would be:
> 
> typeof(char[123]) *my_ptr;
> 
> This can be done without generating extra BTF. For complex types it's
> actually even easier to parse, tbh. I initially didn't like it, but
> now I'm thinking maybe for arrays and func_protos we should do just
> this? WDYT?

typeof is _technically_ not standard C (I think it'll make it into C23). GCC and
Clang do both support it but I would guess we'd want the generated userspace
code to be compatible with as many toolchains and configurations as possible?
(e.g. people using c99 instead of gnu99)

Beyond that, I feel that any complexity saved by the typeof is lost in special-
casing arrays and function prototypes when the current code is uniform across
all types.

If you insist, I can go down this path but I'm not super enthusiastic about it
(and it's harder to read on top of everything).

-- Delyan




[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