Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

objtool: Record symbol name max length

Keep track of the maximum length of symbol names. This will help
formatting the code flow between different functions.

Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://patch.msgid.link/20251121095340.464045-10-alexandre.chartre@oracle.com

authored by

Alexandre Chartre and committed by
Peter Zijlstra
de0248fb a0e5bf9f

+7
+7
tools/objtool/check.c
··· 37 37 static struct cfi_state func_cfi; 38 38 static struct cfi_state force_undefined_cfi; 39 39 40 + static size_t sym_name_max_len; 41 + 40 42 struct instruction *find_insn(struct objtool_file *file, 41 43 struct section *sec, unsigned long offset) 42 44 { ··· 2465 2463 static int classify_symbols(struct objtool_file *file) 2466 2464 { 2467 2465 struct symbol *func; 2466 + size_t len; 2468 2467 2469 2468 for_each_sym(file->elf, func) { 2470 2469 if (is_notype_sym(func) && strstarts(func->name, ".L")) ··· 2492 2489 2493 2490 if (is_profiling_func(func->name)) 2494 2491 func->profiling_func = true; 2492 + 2493 + len = strlen(func->name); 2494 + if (len > sym_name_max_len) 2495 + sym_name_max_len = len; 2495 2496 } 2496 2497 2497 2498 return 0;