History

x86/unwind/orc: Remove boot-time ORC unwind tables sorting

Now that the orc_unwind and orc_unwind_ip tables are sorted at build time, remove the boot time sorting pass. No change in functionality. [ mingo: Rewrote the changelog and code comments. ]

Shile Zhang committed 6 years ago

Commit f14bf6a1 parent 57fa1892 files · +9 −4Browse files

Unified · Split

2 files
  1. arch/x86/kernel/unwind_orc.c +5 −3
  2. scripts/link-vmlinux.sh +4 −1
arch/x86/kernel/unwind_orc.c+5−3
@@ -273,9 +273,11 @@ void __init unwind_init(void) · 272 unmodified lines
273273 return;
274274 }
275275
276− /* Sort the .orc_unwind and .orc_unwind_ip tables: */
277− sort(__start_orc_unwind_ip, num_entries, sizeof(int), orc_sort_cmp,
278− orc_sort_swap);
276+ /*
277+ * Note, the orc_unwind and orc_unwind_ip tables were already
278+ * sorted at build time via the 'sorttable' tool.
279+ * It's ready for binary search straight away, no need to sort it.
280+ */
279281
280282 /* Initialize the fast lookup table: */
281283 lookup_num_blocks = orc_lookup_end - orc_lookup;
scripts/link-vmlinux.sh+4−1
@@ -306,7 +306,10 @@ vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o} · 305 unmodified lines
306306
307307 if [ -n "${CONFIG_BUILDTIME_TABLE_SORT}" ]; then
308308 info SORTTAB vmlinux
309− sorttable vmlinux
309+ if ! sorttable vmlinux; then
310+ echo >&2 Failed to sort kernel tables
311+ exit 1
312+ fi
310313 fi
311314
312315 info SYSMAP System.map