btf_encoder: Switch func_states from a list to an array

With only a single encoder, it's now easier to acummulate function
states into an array, and then sort it before merging the states and
adding the functions to BTF.

Previously a list (per encoder) was collected, and because the sorting
is required, the lists had to be converted into a temporary array in a
separate step.

Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
Cc: Alan Maguire <alan.maguire@oracle.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mykola Lysenko <mykolal@fb.com>
Link: https://lore.kernel.org/r/20250109185950.653110-11-ihor.solodrai@pm.me
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 file changed