====================================================================== BUILD LOG: pass/long/new-local-symbol ====================================================================== Verdict: pass Exit code: 0 Kernel: 6.19.0+ Toolchain: Compiler: gcc (GCC) 14.3.1 20251022 (Red Hat 14.3.1-4) Linker: GNU ld version 2.41-63.el10 Assembler: GNU assembler version 2.41-63.el10 ====================================================================== FULL BUILD OUTPUT ====================================================================== --- klp-build stdout --- Validating patch(es) checking file fs/proc/stat.c Hunk #1 succeeded at 79 with fuzz 1 (offset 25 lines). Fixing patch(es) Building patched kernel Copying patched object files Diffing objects vmlinux.o: changed function: show_stat Building patch module: livepatch-new-local-symbol.ko SUCCESS --- klp-build stderr --- warn: klp-build: /root/linux/tools/testing/selftests/klp-build/tests/current-tree/pass/long/new-local-symbol/new-local-symbol.patch applied with drift --- diff.log --- vmlinux.o: changed function: show_stat ====================================================================== BUILD VERIFICATION ====================================================================== klp-build exit code is 0 Module exists: livepatch-new-local-symbol.ko verify_diff_log_contains('changed function: show_stat'): OK ELF Analysis: klp_object[0]: .name = NULL (vmlinux) VERIFIED: klp_object.name = NULL (vmlinux) klp_func[0]: .old_name = "show_stat" [-> .rodata+0x222] .new_func -> show_stat .old_sympos = 0 VERIFIED: klp_func.old_name = 'show_stat' VERIFIED: klp_func.new_func -> show_stat ====================================================================== TEST PATCH(ES) ====================================================================== --- Patch: new-local-symbol.patch --- From: Test Author Subject: [PATCH] proc/stat: add stat tracking helper New local symbol livepatch test case. This patch adds a new static helper function and calls it from an existing function to verify klp-build includes new local symbols in the livepatch. diff --git a/fs/proc/stat.c b/fs/proc/stat.c --- a/fs/proc/stat.c +++ b/fs/proc/stat.c @@ -54,6 +54,13 @@ static u64 get_iowait_time(struct kernel_cpustat *kcs, int cpu) return iowait; } +static void klp_test_stat_accessed(void) +{ + static atomic_t call_count = ATOMIC_INIT(0); + atomic_inc(&call_count); + pr_info("klp-build-test: stat accessed %d times\n", atomic_read(&call_count)); +} + static int show_stat(struct seq_file *p, void *v) { int i, j; @@ -92,6 +99,7 @@ static int show_stat(struct seq_file *p, void *v) user = nice = system = idle = iowait = irq = softirq = steal = 0; guest = guest_nice = 0; + klp_test_stat_accessed(); getboottime64(&boottime); /* shift boot timestamp according to the timens offset */ timens_sub_boottime(&boottime);