]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
scripts/sorttable: Get start/stop_mcount_loc from ELF file directly
authorSteven Rostedt <rostedt@goodmis.org>
Sun, 5 Jan 2025 16:22:25 +0000 (11:22 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 8 Jan 2025 03:36:39 +0000 (22:36 -0500)
commit4acda8edefa1ce66d3de845f1c12745721cd14c3
treea132067ed74537448a6b4546871e536168ef27da
parent58d87678a0f46c6120904b4326aaf5ebf4454c69
scripts/sorttable: Get start/stop_mcount_loc from ELF file directly

The get_mcount_loc() does a cheesy trick to find the start_mcount_loc and
stop_mcount_loc values. That trick is:

 file_start = popen(" grep start_mcount System.map | awk '{print $1}' ", "r");

and

 file_stop = popen(" grep stop_mcount System.map | awk '{print $1}' ", "r");

Those values are stored in the Elf symbol table. Use that to capture those
values. Using the symbol table is more efficient and more robust. The
above could fail if another variable had "start_mcount" or "stop_mcount"
as part of its name.

Cc: bpf <bpf@vger.kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nicolas Schier <nicolas@fjasle.eu>
Cc: Zheng Yejian <zhengyejian1@huawei.com>
Cc: Martin Kelly <martin.kelly@crowdstrike.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/20250105162346.817157047@goodmis.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
scripts/sorttable.c