scripts/kallsyms: change the output order
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 8 Mar 2023 11:52:41 +0000 (20:52 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 17 Apr 2023 02:03:56 +0000 (11:03 +0900)
commit404bad70fcf7cb1a36198581e6904637f3c36846
tree99f0b306ccaa4be01100043e14b727394b537aba
parent320e7c9d4494f7a6f046871678f582a3392235f8
scripts/kallsyms: change the output order

Currently, this tool outputs symbol data in the following order.

 (1) kallsyms_addressed / kallsyms_offsets
 (2) kallsyms_relative_base
 (3) kallsyms_num_syms
 (4) kallsyms_names
 (5) kallsyms_markers
 (6) kallsyms_seq_of_names
 (7) kallsyms_token_table
 (8) kallsyms_token_index

This commit changes the order as follows:

 (1) kallsyms_num_syms
 (2) kallsyms_names
 (3) kallsyms_markers
 (4) kallsyms_token_table
 (5) kallsyms_token_index
 (6) kallsyms_addressed / kallsyms_offsets
 (7) kallsyms_relative_base
 (8) kallsyms_seq_of_names

The motivation is to decrease the number of function calls to
expand_symbol() and cleanup_symbol_name().

The compressed names are only required for writing 'kallsyms_names'.
If you do this first, we can restore the original symbol names.
You do not need to repeat the same operation over again.

The actual refactoring will happen in the next commit.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kallsyms.c