aboutsummaryrefslogtreecommitdiff
path: root/contrib/tracing/log_utxocache_flush.py
diff options
context:
space:
mode:
authorArnab Sen <arnabsen1729@gmail.com>2021-09-03 22:08:53 +0530
committerArnab Sen <arnabsen1729@gmail.com>2021-11-28 11:51:21 +0530
commit2bc51c5c3215398875c04456a3f3df1c07b830b5 (patch)
treeaef191c5127b3a7e4a0d1c791e96b54c9958d082 /contrib/tracing/log_utxocache_flush.py
parenta26e8eef43c5ff0f4a5cd44d1d331a7bd72564a5 (diff)
[tracing] tracepoints to utxocache add, spent and uncache
Signed-off-by: Arnab Sen <arnabsen1729@gmail.com>
Diffstat (limited to 'contrib/tracing/log_utxocache_flush.py')
-rwxr-xr-x[-rw-r--r--]contrib/tracing/log_utxocache_flush.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/tracing/log_utxocache_flush.py b/contrib/tracing/log_utxocache_flush.py
index df55b94162..df27dc193a 100644..100755
--- a/contrib/tracing/log_utxocache_flush.py
+++ b/contrib/tracing/log_utxocache_flush.py
@@ -4,8 +4,8 @@ import sys
import ctypes
from bcc import BPF, USDT
-""" Example script to log details about coins flushed by the Bitcoin client
-utilizing USDT probes and the flush:flush tracepoint. """
+"""Example logging Bitcoin Core utxo set cache flushes utilizing
+ the utxocache:flush tracepoint."""
# USAGE: ./contrib/tracing/log_utxocache_flush.py path/to/bitcoind
@@ -22,8 +22,10 @@ struct data_t
bool is_flush_prune;
bool is_full_flush;
};
+
// BPF perf buffer to push the data to user space.
BPF_PERF_OUTPUT(flush);
+
int trace_flush(struct pt_regs *ctx) {
struct data_t data = {};
bpf_usdt_readarg(1, ctx, &data.duration);
@@ -45,8 +47,8 @@ FLUSH_MODES = [
]
-# define output data structure
class Data(ctypes.Structure):
+ # define output data structure corresponding to struct data_t
_fields_ = [
("duration", ctypes.c_uint64),
("mode", ctypes.c_uint32),