Re: [PATCH v2 bpf 5/5] libbpf: warn on unexpected __arg_ctx type when rewriting BTF

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

 



On Wed, 2024-01-17 at 14:33 -0800, Andrii Nakryiko wrote:
[...]

> +	/* special cases */
> +	switch (prog->type) {
> +	case BPF_PROG_TYPE_KPROBE:
> +	case BPF_PROG_TYPE_PERF_EVENT:
> +		/* `struct pt_regs *` is expected, but we need to fix up */
> +		if (btf_is_struct(t) && strcmp(tname, "pt_regs") == 0)
> +			return true;
> +		break;

Just to double-check my understanding, in patch #3 you say:

> for perf_event kernel allows `struct {pt_regs,user_pt_regs,user_regs_struct} *`.

Here `true` is returned only for `pt_regs`,
meaning that arch specific types "user_pt_regs" and "user_regs_struct"
would not be converted to "bpf_perf_event_data" but "pt_regs" would, right?

[...]







[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