summaryrefslogtreecommitdiffstats
path: root/scripts/kallsyms.c
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-07-20 12:30:14 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2024-07-21 18:24:22 +0200
commitf9c3d671dd816ea4d5604dd04ef98d42921656a7 (patch)
treefe756b21b4f449cd567be1f6f3e888ee67818227 /scripts/kallsyms.c
parentkallsyms: use \t instead of a tab in printf() (diff)
downloadlinux-f9c3d671dd816ea4d5604dd04ef98d42921656a7.tar.xz
linux-f9c3d671dd816ea4d5604dd04ef98d42921656a7.zip
kallsyms: add more original symbol type/name in comment lines
Commit bea5b7450474 ("kallsyms: expand symbol name into comment for debugging") added the uncompressed type/name in the comment lines of kallsyms_offsets. It would be useful to do the same for kallsyms_names and kallsyms_seqs_of_names. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/kallsyms.c')
-rw-r--r--scripts/kallsyms.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 164c04d22061..e291e34a450b 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -456,18 +456,16 @@ static void write_src(void)
}
for (k = 0; k < table[i]->len; k++)
printf(", 0x%02x", table[i]->sym[k]);
- printf("\n");
- }
- printf("\n");
- /*
- * Now that we wrote out the compressed symbol names, restore the
- * original names, which are needed in some of the later steps.
- */
- for (i = 0; i < table_cnt; i++) {
+ /*
+ * Now that we wrote out the compressed symbol name, restore the
+ * original name and print it in the comment.
+ */
expand_symbol(table[i]->sym, table[i]->len, buf);
strcpy((char *)table[i]->sym, buf);
+ printf("\t/* %s */\n", table[i]->sym);
}
+ printf("\n");
output_label("kallsyms_markers");
for (i = 0; i < markers_cnt; i++)
@@ -536,10 +534,11 @@ static void write_src(void)
sort_symbols_by_name();
output_label("kallsyms_seqs_of_names");
for (i = 0; i < table_cnt; i++)
- printf("\t.byte 0x%02x, 0x%02x, 0x%02x\n",
+ printf("\t.byte 0x%02x, 0x%02x, 0x%02x\t/* %s */\n",
(unsigned char)(table[i]->seq >> 16),
(unsigned char)(table[i]->seq >> 8),
- (unsigned char)(table[i]->seq >> 0));
+ (unsigned char)(table[i]->seq >> 0),
+ table[i]->sym);
printf("\n");
}