<p>0xB10C answered this on <a href="https://x0f.org/@0xb10c/106862874310026032" rel="nofollow noreferrer">Mastodon</a>. Alternative answers are welcome.</p>
<blockquote>
<p>We implement our own tracepoints in our userspace application
(Bitcoin Core) and write custom scripts to get insights into the parts
we find important.</p>
<p>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.</p>
<p>Sometimes debugging, as in stepping through code and looking at state
with e.g. GDB, is something you do manually.</p>
<p>The tracing done with USDT allows you to use internal state
programatically. You can automatically react to some state.</p>
</blockquote>
<p>This could be thought of as 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.</p>
<blockquote>
<p>Debugging is only one of the USDT applications. Tracepoints can also
be used to evaluate/review changes like I do with the <a href="https://github.com/naumenkogs/txrelaysim/issues/8#issuecomment-903255752" rel="nofollow noreferrer">Erlay vs master
nodes dashboard</a>. Or for general monitoring, anomaly detection,
benchmarking and testing.</p>
</blockquote>

CC BY-SA 4.0
2021-09-03T12:52:59.023Z
2021-09-05T20:45:17.653Z
2021-09-05T20:45:17.653Z
Michael Folkson
<p>I am starting to learn about USDT tracing that 0xB10C hosted a <a href="https://bitcoincore.reviews/22006" rel="nofollow noreferrer">PR review club</a> on in May 2021 and is covered in this <a href="https://b10c.me/blog/008-bitcoin-core-usdt-support/" rel="nofollow noreferrer">blog post</a>.</p>
<p>I am still a little unclear when I would reach for this tool (assuming I learnt how to use it effectively!) and how it complements or compares to debugging generally.</p>
<p>Is it something to use when you hit the limits of what a debugger can do?</p>

<bitcoin-core-development><debugging><tracing>
When would I use USDT tracing over debugging? How do they compare and complement each other?
Michael Folkson
# When would I use USDT tracing over debugging? How do they compare and complement each other?

(Asked by: username_0 on 2021-09-03)

I am starting to learn about USDT tracing that 0xB10C hosted a [PR review club](https://bitcoincore.reviews/22006) on in May 2021 and is covered in this [blog post](https://b10c.me/blog/008-bitcoin-core-usdt-support/).

I am still a little unclear when I would reach for this tool (assuming I learnt how to use it effectively!) and how it complements or compares to debugging generally.

Is it something to use when you hit the limits of what a debugger can do?

**Tags:** bitcoin-core-development, debugging, tracing


---

## 1 answers

### Answer by username_0 on 2021-09-03. Score: 1 | Accepted answer

0xB10C answered this on [Mastodon](https://x0f.org/@0xb10c/106862874310026032). 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 as 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](https://github.com/naumenkogs/txrelaysim/issues/8#issuecomment-903255752). Or for general monitoring, anomaly detection,
> benchmarking and testing.


---

