Bug 472973 - add debuginfod client support for source code downloading on the fly
Summary: add debuginfod client support for source code downloading on the fly
Status: REPORTED
Alias: None
Product: kcachegrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Josef Weidendorfer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-03 18:48 UTC by Frank Ch. Eigler
Modified: 2026-02-02 17:51 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ch. Eigler 2023-08-03 18:48:19 UTC
Several modern linux distros run debuginfo + source code downloading service called debuginfod -  https://sourceware.org/elfutils/Debuginfod.html .  kcachegrind could take advantage to download source code to binaries and especially shared libraries being profiled.  This could get rid of many occurrences of the "There is no source available for ...." diagnostics.

The simplest way to use it would be to extend libviews/sourceview.cpp to call out to "debuginfod-find $PATH source $SOURCEFILE", consume its standard output as a file name (if rc==0).  That file should contain the contents of the source file.

In the case of callgrind output files, $PATH would probably come from "ob=(N) $PATH" and "cob=(N) $PATH", and $SOURCEFILE is the nearby "fi=(N) $SOURCEFILE".

callgrind.out:

[...]
cob=(2) /usr/lib64/libc.so.6
[...]
fi=(349) /usr/src/debug/glibc-2.37-4.fc38.x86_64/libio/libioP.h


% debuginfod-find /usr/lib64/libc.so.6 source /usr/src/debug/glibc-2.37-4.fc38.x86_64/libio/libioP.h
/home/you/.cache/debuginfod_client/SOMETHING/ELSE.h
% cat /home/you/.cache/debuginfod_client/SOMETHING/ELSE.h
/* ..... glibc goodness ..... */