summaryrefslogtreecommitdiffstats
path: root/scripts/documentation-file-ref-check
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-03-08 12:52:42 +0100
committerMasahiro Yamada <masahiroy@kernel.org>2023-04-17 04:03:56 +0200
commitdd1553b8a5f2ef4e0aa2537c49ba0c37837b691e (patch)
treeb37c0dc1ab76c3b474d4737d65a6b99de4d6a188 /scripts/documentation-file-ref-check
parentscripts/kallsyms: change the output order (diff)
downloadlinux-dd1553b8a5f2ef4e0aa2537c49ba0c37837b691e.tar.xz
linux-dd1553b8a5f2ef4e0aa2537c49ba0c37837b691e.zip
scripts/kallsyms: decrease expand_symbol() / cleanup_symbol_name() calls
Currently, expand_symbol() is called many times to get the uncompressed symbol names for sorting, and also for adding comments. With the output order shuffled in the previous commit, the symbol data are now written in the following order: (1) kallsyms_num_syms (2) kallsyms_names <-- need compressed names (3) kallsyms_markers (4) kallsyms_token_table (5) kallsyms_token_index (6) kallsyms_addressed / kallsyms_offsets <-- need uncompressed names (for commenting) (7) kallsyms_relative_base (8) kallsyms_seq_of_names <-- need uncompressed names (for sorting) The compressed names are only needed by (2). Call expand_symbol() between (2) and (3) to restore the original symbol names. This requires just one expand_symbol() call for each symbol. Call cleanup_symbol_name() between (7) and (8) instead of during sorting. It is allowed to overwrite the ->sym field because (8) just outputs the index instead of the name of each symbol. Again, this requires just one cleanup_symbol_name() call for each symbol. This refactoring makes it ~30% faster. [Before] $ time scripts/kallsyms --all-symbols --absolute-percpu --base-relative \ .tmp_vmlinux.kallsyms2.syms >/dev/null real 0m1.027s user 0m1.010s sys 0m0.016s [After] $ time scripts/kallsyms --all-symbols --absolute-percpu --base-relative \ .tmp_vmlinux.kallsyms2.syms >/dev/null real 0m0.717s user 0m0.717s sys 0m0.000s Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/documentation-file-ref-check')
0 files changed, 0 insertions, 0 deletions