[PATCH 0/2] ftrace: improve ftrace during compiling

From: Yinan Liu
Date: Sat Sep 11 2021 - 09:53:01 EST


Hi,
Some business scenarios require the kernel to start as quickly as possible,
so recently we are optimizing some processing during the kernel startup phase.
When the kernel is started, ftrace_init() takes 15-20ms to execute. Almost
all of the overhead belongs to the sorting and replacement of nop instructions,
and other processing only accounts for about 300us. Advance the processing of
these two parts to the compile time, and the time saved is very important
for certain scenarios, such as the quick start of containers.

Yinan Liu (2):
scripts: ftrace - move the sort-processing in ftrace_init to compile time
scripts: ftrace - move the nop-processing in ftrace_init to compile time

kernel/trace/ftrace.c | 9 +++-
scripts/link-vmlinux.sh | 6 +--
scripts/recordmcount.h | 14 +++++++
scripts/sorttable.c | 2 +
scripts/sorttable.h | 109 +++++++++++++++++++++++++++++++++++++++++++++++-
5 files changed, 133 insertions(+), 7 deletions(-)

--
2.14.4.44.g2045bb6
+++++++++++++++++++++++++++++++++++++++++++++++-