This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Use binary search instead of linear search in corefile.c of gprof
- From: Nick Clifton <nickc at redhat dot com>
- To: Dongsheng Xing <homer dot xing at yahoo dot com>
- Cc: Tristan Gingold <gingold at adacore dot com>, binutils at sourceware dot org
- Date: Tue, 16 Jun 2009 12:53:29 +0100
- Subject: Re: [PATCH] Use binary search instead of linear search in corefile.c of gprof
- References: <533228.35450.qm@web43405.mail.sp1.yahoo.com>
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.