Thread (6 messages) flat view 6 messages, 3 authors, 2021-11-10

Re: [PATCH bpf-next] bpf: extend BTF_ID_LIST_GLOBAL with parameter for number of IDs

From: Song Liu <hidden>
Date: 2021-11-10 22:18:49
Also in: bpf

On Nov 10, 2021, at 2:13 PM, Alexei Starovoitov [off-list ref] wrote:

On Wed, Nov 10, 2021 at 2:11 PM Song Liu [off-list ref] wrote:
quoted

quoted
On Nov 10, 2021, at 2:02 PM, Alexei Starovoitov [off-list ref] wrote:

On Wed, Nov 10, 2021 at 9:47 AM Song Liu [off-list ref] wrote:
quoted
-#ifdef CONFIG_DEBUG_INFO_BTF
-BTF_ID_LIST_GLOBAL(btf_sock_ids)
+BTF_ID_LIST_GLOBAL(btf_sock_ids, MAX_BTF_SOCK_TYPE)
#define BTF_SOCK_TYPE(name, type) BTF_ID(struct, type)
BTF_SOCK_TYPE_xxx
#undef BTF_SOCK_TYPE
-#else
-u32 btf_sock_ids[MAX_BTF_SOCK_TYPE];
-#endif
If we're trying to future proof it I think it would be better
to combine it with MAX_BTF_SOCK_TYPE and BTF_SOCK_TYPE_xxx macro.
(or have another macro that is tracing specific).
That will help avoid cryptic btf_task_struct_ids[0|1|2]
references in the code.
Yeah, this makes sense.

I am taking time off for tomorrow and Friday, so I probably won't
have time to implement this before 5.16-rc1. How about we ship
this fix as-is, and improve it later?
It's not rc1 material. It's in bpf-next only. There is no rush, I think.
Aha, I guess I messed up the branches.

Song 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help