[PATCH v2] gprof: only process line numbers for intersection of vmas and histograms

H.J. Lu hjl.tools@gmail.com
Sat Mar 8 09:08:01 GMT 2025


On Sat, Mar 8, 2025 at 10:44 AM Richard Allen <rsaxvc@gmail.com> wrote:
>
> Thank you for reverting that H. J.
>
> The issue is with my patch 6 is that call-graph parsing requires
> the symbols to be loaded first. When I parsed the gmon file
> first, the symbols were unavailable to cg_tally(), which runs while
> the gmon file is parsed.
>
> The OpenOCD gmon files I am working with only contain histogram
> records, and no callgraph or basic-block records.
>
> I'll look into how to better handle this as time allows. It might work
> to parse the function symbols first, then the gmon file, then the
> reduced set of line symbols only when requested.
>
> Another approach might be loading the gmon file first, then the
> symbols, then tallying the callgraph later.
>

Here is the patch to delay loading the symbol table until its first use.
Does it work for you?

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2-0001-gprof-only-process-line-numbers-for-intersection-.patch
Type: text/x-patch
Size: 39524 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20250308/f802c742/attachment-0001.bin>


More information about the Binutils mailing list