diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index cd379ced19e5..a562702b4841 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -880,8 +880,8 @@ static int map__process_kallsym_symbol(void *arg, const char *name, if (!symbol_type__filter(type)) return 0; - /* Ignore mapping symbols in kallsyms */ - if (is_ignored_kernel_symbol(name)) + /* Ignore mapping and livepatch symbols in kallsyms */ + if (is_ignored_kernel_symbol(name) || is_livepatch_symbol(name)) return 0; /* diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index a71525335703..d0bac824c79c 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -8,7 +8,9 @@ #include #include #include +#include #include +#include #include #include #include "addr_location.h" @@ -45,6 +47,16 @@ static inline bool is_ignored_kernel_symbol(const char *str) return str[0] == '$'; } +/* + * Livepatch symbols (.klp.sym.*) are relocation placeholders whose resolved + * addresses alias existing kernel symbols. They carry a [module] tag which + * confuses module boundary tracking and symbol table lookups. + */ +static inline bool is_livepatch_symbol(const char *str) +{ + return strstarts(str, KLP_SYM_PREFIX); +} + /* * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP; * for newer versions we can use mmap to reduce memory usage: