Skip to content

Commit f9c3d67

Browse files
committed
kallsyms: add more original symbol type/name in comment lines
Commit bea5b74 ("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>
1 parent b07e181 commit f9c3d67

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

scripts/kallsyms.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -456,18 +456,16 @@ static void write_src(void)
456456
}
457457
for (k = 0; k < table[i]->len; k++)
458458
printf(", 0x%02x", table[i]->sym[k]);
459-
printf("\n");
460-
}
461-
printf("\n");
462459

463-
/*
464-
* Now that we wrote out the compressed symbol names, restore the
465-
* original names, which are needed in some of the later steps.
466-
*/
467-
for (i = 0; i < table_cnt; i++) {
460+
/*
461+
* Now that we wrote out the compressed symbol name, restore the
462+
* original name and print it in the comment.
463+
*/
468464
expand_symbol(table[i]->sym, table[i]->len, buf);
469465
strcpy((char *)table[i]->sym, buf);
466+
printf("\t/* %s */\n", table[i]->sym);
470467
}
468+
printf("\n");
471469

472470
output_label("kallsyms_markers");
473471
for (i = 0; i < markers_cnt; i++)
@@ -536,10 +534,11 @@ static void write_src(void)
536534
sort_symbols_by_name();
537535
output_label("kallsyms_seqs_of_names");
538536
for (i = 0; i < table_cnt; i++)
539-
printf("\t.byte 0x%02x, 0x%02x, 0x%02x\n",
537+
printf("\t.byte 0x%02x, 0x%02x, 0x%02x\t/* %s */\n",
540538
(unsigned char)(table[i]->seq >> 16),
541539
(unsigned char)(table[i]->seq >> 8),
542-
(unsigned char)(table[i]->seq >> 0));
540+
(unsigned char)(table[i]->seq >> 0),
541+
table[i]->sym);
543542
printf("\n");
544543
}
545544

0 commit comments

Comments
 (0)