[PATCH] translate.cxx: parallelize emit_symbol_data

Frank Ch. Eigler fche@redhat.com
Fri Jul 10 15:45:36 GMT 2026


amerey wrote:

> When stap is built against an elfutils that defines
> _ELFUTILS_THREAD_SAFE in <elfutils/version.h>, dump each module's
> symbol/unwind data (dump_unwindsyms) on a boost::asio thread pool.
> Each worker handles one module. [...]

Looks generally fine.  One suggestion is to make the code less
conditional on _ELFUTILS_THREAD_SAFE.  Always use a thread pool, just
size it at N=1 in the non-thread-safe case.  Otherwise make the logic
uniform.  One smaller nit: for commits where several parts just wrap
logic in new indentation levels, consider pasting with "git diff -w"
to abbreviate things. 

> https://gitlab.com/amerey1/elfutils-ai-lab/-/tree/thread-safety-benchmark
> 
>   stap -p3 --ldd -e 'probe process("/usr/bin/ffmpeg").begin
>       { print_ubacktrace() }'                 # 318 user DSOs
>     0.65s -> 0.15s (4.4x)
>   stap -p3 --all-modules -e 'probe timer.profile
>       { print_backtrace() }'                  # kernel + 116 modules
>     4.17s -> 1.62s (2.6x)
>   stap -p3 --all-modules --ldd -d /usr/bin/ffmpeg -e 'probe
>       timer.profile { print_backtrace(); print_ubacktrace() }'
>     4.83s -> 1.64s (2.9x)                     # 434 modules

Nice.  Did you also happen to run it under helgrind?  (Could add an
AGENTS.md blurb as a reminder to have the AI hand-test valgrind/helgrind
runs for multithreading changes.)

- FChE



More information about the Systemtap mailing list