mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
kallsyms: Reduce the memory occupied by kallsyms_seqs_of_names[]
[ Upstream commit19bd8981dc] kallsyms_seqs_of_names[] records the symbol index sorted by address, the maximum value in kallsyms_seqs_of_names[] is the number of symbols. And 2^24 = 16777216, which means that three bytes are enough to store the index. This can help us save (1 * kallsyms_num_syms) bytes of memory. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Stable-dep-of:b022f0c7e4("tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3918cada8f
commit
da359f699f
@@ -602,7 +602,10 @@ static void write_src(void)
|
||||
sort_symbols_by_name();
|
||||
output_label("kallsyms_seqs_of_names");
|
||||
for (i = 0; i < table_cnt; i++)
|
||||
printf("\t.long\t%u\n", table[i]->seq);
|
||||
printf("\t.byte 0x%02x, 0x%02x, 0x%02x\n",
|
||||
(unsigned char)(table[i]->seq >> 16),
|
||||
(unsigned char)(table[i]->seq >> 8),
|
||||
(unsigned char)(table[i]->seq >> 0));
|
||||
printf("\n");
|
||||
|
||||
output_label("kallsyms_token_table");
|
||||
|
||||
Reference in New Issue
Block a user