Subject: [PATCH 22/24] bpf: Add module name [bpf] to ksymbols for bpf programs

From: Arnaldo Carvalho de Melo <[email-masked]>
Date: Mon, 21 Jan 2019 20:57:04 -0300

From: Song Liu <[email-masked]>

With this patch, /proc/kallsyms will show BPF programs as

  <addr> t bpf_prog_<tag>_<name> [bpf]

Signed-off-by: Song Liu <[email-masked]>
Reviewed-by: Arnaldo Carvalho de Melo <[email-masked]>
Tested-by: Arnaldo Carvalho de Melo <[email-masked]>
Acked-by: Peter Zijlstra <[email-masked]>
Cc: Alexei Starovoitov <[email-masked]>
Cc: Daniel Borkmann <[email-masked]>
Cc: Peter Zijlstra <[email-masked]>
Cc: [email-masked]
Cc: [email-masked]
Link: http://lkml.kernel.org/r/[email-masked]
Signed-off-by: Arnaldo Carvalho de Melo <[email-masked]>
---
 kernel/kallsyms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index f3a04994e063..14934afa9e68 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -494,7 +494,7 @@ static int get_ksymbol_ftrace_mod(struct kallsym_iter *iter)
 
 static int get_ksymbol_bpf(struct kallsym_iter *iter)
 {
-	iter->module_name[0] = '\0';
+	strlcpy(iter->module_name, "bpf", MODULE_NAME_LEN);
 	iter->exported = 0;
 	return bpf_get_kallsym(iter->pos - iter->pos_ftrace_mod_end,
 			       &iter->value, &iter->type,
-- 
2.20.1