btf_encoder: Dynamically allocate the vars array for percpu variables

Use consistent method across allocating function and per-cpu variable
representations, based around (re)allocating the arrays based on demand.

This avoids issues where the number of per-CPU variables exceeds the
hardcoded limit.

Reported-by: John Hubbard <[email protected]>
Suggested-by: Jiri Olsa <[email protected]>
Signed-off-by: Alan Maguire <[email protected]>
Tested-by: Jiri Olsa <[email protected]>
Tested-by: John Hubbard <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 file changed