mirror of
https://github.com/dynup/kpatch
synced 2024-12-14 09:24:33 +00:00
6567762937
Upon realizing that there is no point in correlating rela entries, I also realized that tracking the status of rela entries is also not needed. Additionally, the rela section correlation path (really misnamed as it is the rela section _comparison path) is VERY hot. Particularly on files like fs/ext4/ext4.o (which create-diff-object currently can't successfully parse entirely): Samples: 40K of event 'cycles', Event count (approx.): 36516578362 49.49% create-diff-obj create-diff-object [.] rela_equal 31.85% create-diff-obj create-diff-object [.] kpatch_correlate_relas 16.22% create-diff-obj create-diff-object [.] find_symbol_by_index The refactor does a few things: - replaces nested for loops with single for loop when comparing rela entries - removes status field for rela entires - compares rela and nonrela sections in the same path - removes unnecessary setting of status fields as the inclusion tree will include them even if the section status isn't set to CHANGED. This is even better as unchanged sections won't appear as CHANGED just because their partner .text or .rela section is CHANGED. This drastically reduced runtime for larger objects and cooled the rela comparison path: 87.64% create-diff-obj create-diff-object [.] find_symbol_by_index 6.98% create-diff-obj libc-2.18.so [.] __GI___strcmp_ssse3 1.33% create-diff-obj create-diff-object [.] find_section_by_index 1.16% create-diff-obj create-diff-object [.] kpatch_correlate_symbols 0.61% create-diff-obj create-diff-object [.] kpatch_create_rela_table 0.52% create-diff-obj create-diff-object [.] kpatch_correlate_sections Signed-off-by: Seth Jennings <sjenning@redhat.com> |
||
---|---|---|
.. | ||
add-patches-section.c | ||
create-diff-object.c | ||
kpatch-build | ||
link-vmlinux-syms.c | ||
Makefile |