The tracepoints are further documented in docs/tracing.md and the usage is shown via the two newly added example scripts in contrib/tracing/.
Backport of core#22902.
Backport of core#23907.
Notes:
- The amount is passed as string because our type can't be converted to int
- CTxOut and CCoin accessors are used where applicable
- I removed the casts that are both useless and even mixing stding and posix types