Skip to content

Commit

Permalink
[tracing] bpftrace script for logging utxo
Browse files Browse the repository at this point in the history
  • Loading branch information
arnabsen1729 committed Aug 19, 2021
1 parent 0cf235b commit 4b67dec
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions contrib/tracing/log_utxo.bt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bpftrace

BEGIN
{
printf("Logging P2P traffic\n")
}

usdt:./src/bitcoind:utxo:coins_uncached
{
$height = (uint32)arg0;
$value = arg1;
$isCoinBase = (uint32)arg2;
$usage = arg3;
printf("UNCACHE: %d %d %d %d\n", $height, $value, $isCoinBase, $usage);
}

usdt:./src/bitcoind:utxo:coins_spent
{
$height = (uint32)arg0;
$value = arg1;
$isCoinBase = (uint32)arg2;
$usage = arg3;
printf("%-10s %d %d %d %d\n", "Spent", $height, $value, $isCoinBase, $usage);
}

usdt:./src/bitcoind:utxo:coins_added
{
$height = (uint32)arg0;
$value = arg1;
$isCoinBase = (uint32)arg2;
$usage = arg3;
printf("%-10s %d %d %d %d\n", "Add", $height, $value, $isCoinBase, $usage);
}

0 comments on commit 4b67dec

Please sign in to comment.