[PATCH] Use binary search instead of linear search in corefile.c of gprof
Nick Clifton
nickc@redhat.com
Tue Jun 16 11:56:00 GMT 2009
Hi Homer,
> Thank you. I have updated the patch with bsearch().
Thanks - I have applied your patch, along with the changelog entry below.
Please note for future submissions: it really helps if you can include a
ChangeLog entry along with a patch.
Cheers
Nick
gprof/ChangeLog
2009-06-16 Homer Xing <homer.xing@yahoo.com>
* corefile.c (cmp_symbol_map): New function.
(read_function_mappins): Use qsort to sort the symbols.
(search_mapped_symbol): New function.
(core_create_function_syms): Use bsearch to find symbols.
* corefile.h (struct function_map): Add new bit-field: is_first.
* cg_print.c (cmp_symbol_map): New function.
(cg_print_file_ordering): Sort the symbol map.
More information about the Binutils
mailing list