summaryrefslogtreecommitdiffstats
path: root/include/linux/kallsyms.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2022-05-10 14:26:12 +0200
committerAlexei Starovoitov <ast@kernel.org>2022-05-10 14:42:06 -0700
commitd721def7392a7348ffb9f3583b264239cbd3702c (patch)
tree43df3680a8f8e7c7d34ed0a01cc1fcb1f3729df6 /include/linux/kallsyms.h
parent9376d3898b2da50e6a6e7c0c1a0d7a3bbf0b8f44 (diff)
downloadlinux-d721def7392a7348ffb9f3583b264239cbd3702c.tar.gz
linux-d721def7392a7348ffb9f3583b264239cbd3702c.tar.bz2
linux-d721def7392a7348ffb9f3583b264239cbd3702c.zip
kallsyms: Make kallsyms_on_each_symbol generally available
Making kallsyms_on_each_symbol generally available, so it can be used outside CONFIG_LIVEPATCH option in following changes. Rather than adding another ifdef option let's make the function generally available (when CONFIG_KALLSYMS option is defined). Cc: Christoph Hellwig <hch@lst.de> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/r/20220510122616.2652285-2-jolsa@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/kallsyms.h')
-rw-r--r--include/linux/kallsyms.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index ce1bd2fbf23e..ad39636e0c3f 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -65,11 +65,11 @@ static inline void *dereference_symbol_descriptor(void *ptr)
return ptr;
}
+#ifdef CONFIG_KALLSYMS
int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
unsigned long),
void *data);
-#ifdef CONFIG_KALLSYMS
/* Lookup the address for a symbol. Returns 0 if not found. */
unsigned long kallsyms_lookup_name(const char *name);
@@ -163,6 +163,11 @@ static inline bool kallsyms_show_value(const struct cred *cred)
return false;
}
+static inline int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
+ unsigned long), void *data)
+{
+ return -EOPNOTSUPP;
+}
#endif /*CONFIG_KALLSYMS*/
static inline void print_ip_sym(const char *loglvl, unsigned long ip)