]> git.ipfire.org Git - thirdparty/qemu.git/commit
contrib/plugins/uftrace_symbols.py: generate debug files to map symbols to source
authorPierrick Bouvier <pierrick.bouvier@linaro.org>
Thu, 16 Oct 2025 15:03:52 +0000 (16:03 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 20 Oct 2025 12:46:28 +0000 (13:46 +0100)
commit8a545a336d577e87b47e39031c17dd89eebd77d7
tree442f6d39e77d9ee415c4561aeda80fec7909f38f
parent9f714c4b2064d11ca422ab71c973f41ebaea121e
contrib/plugins/uftrace_symbols.py: generate debug files to map symbols to source

Enhance uftrace_symbols.py to generate .dbg files, containing
source location for every symbol present in .sym file.
It allows to use `uftrace {replay,dump} --srcline` and show origin of
functions, connecting trace to original source code.

It was first implemented with pyelftools DWARF parser, which was way
too slow (~minutes) to get locations for every symbol in the linux
kernel. Thus, we use `addr2line` instead, which runs in seconds.

As well, there were some bugs with latest pyelftools release,
requiring to run master version, which is not installable with pip.
Thus, since we now require binutils (addr2line), we can ditch pyelftools
based implementation and simply rely on `nm` to get symbols information,
which is faster and better.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251016150357.876415-8-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
contrib/plugins/uftrace_symbols.py