bitcoin core development – When would I use USDT tracing over debugging? How do they compare and complement each other?

0xB10C answered this on Mastodon. Alternative answers are welcome.

We implement our own tracepoints in our userspace application
(Bitcoin Core) and write custom scripts to get insights into the parts
we find important.

Tracing via USDT and debugging are two very different things. You can
use tracing via USDT as part of the search for a bug but you can’t
replace debugging with tracing.

Sometimes debugging, as in stepping through code and looking at state
with e.g. GDB, is something you do manually.

The tracing done with USDT allows you to use internal state
programatically. You can automatically react to some state.

This could be thought of richer, deeper debugging. Rather than the stop, start nature of breakpoints you can allow the code to run continuously and still manipulate it. Or you could locate a bug using debugging and then explore the impact of the bug with USDT tracing.

Debugging is only one of the USDT applications. Tracepoints can also
be used to evaluate/review changes like I do with the Erlay vs master
nodes dashboard
. Or for general monitoring, anomaly detection,
benchmarking and testing.