aboutsummaryrefslogtreecommitdiff
path: root/contrib/tracing/log_utxocache_flush.py
diff options
context:
space:
mode:
author0xb10c <0xb10c@gmail.com>2021-12-06 11:06:36 +0100
committerArnab Sen <arnabsen1729@gmail.com>2022-02-18 20:48:52 +0530
commit799968e8b38833dc7fd7b6d488a66a14580ef674 (patch)
tree8dee10dad4d43ac15c768630a267deb0e54d1cda /contrib/tracing/log_utxocache_flush.py
parent36a65847033540cf2203252c7baf42bc5ec97579 (diff)
downloadbitcoin-799968e8b38833dc7fd7b6d488a66a14580ef674.tar.xz
tracing: misc follow-ups to 22902
- mention 'Lost X events' workaround - clarify flush tracepoint docs - fix typo in tracepoint context - clarify flush for prune The documentation and examples for the `fFlushForPrune` argument of the utxocache flush tracepoint weren't clear without looking at the code. See these comments: https://github.com/bitcoin/bitcoin/pull/22902#issuecomment-987094612 - doc: note that there can be temporary UTXO caches Bitcoin Core uses temporary clones of it's _main_ UTXO cache in some places. The utxocache:add and :spent tracepoints are triggered when temporary caches are changed too. This is documented.
Diffstat (limited to 'contrib/tracing/log_utxocache_flush.py')
-rwxr-xr-xcontrib/tracing/log_utxocache_flush.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/contrib/tracing/log_utxocache_flush.py b/contrib/tracing/log_utxocache_flush.py
index 3326346b50..24ede0fe14 100755
--- a/contrib/tracing/log_utxocache_flush.py
+++ b/contrib/tracing/log_utxocache_flush.py
@@ -13,13 +13,14 @@ from bcc import BPF, USDT
# a sandboxed Linux kernel VM.
program = """
# include <uapi/linux/ptrace.h>
+
struct data_t
{
u64 duration;
u32 mode;
u64 coins_count;
u64 coins_mem_usage;
- bool is_flush_prune;
+ bool is_flush_for_prune;
};
// BPF perf buffer to push the data to user space.
@@ -31,7 +32,7 @@ int trace_flush(struct pt_regs *ctx) {
bpf_usdt_readarg(2, ctx, &data.mode);
bpf_usdt_readarg(3, ctx, &data.coins_count);
bpf_usdt_readarg(4, ctx, &data.coins_mem_usage);
- bpf_usdt_readarg(5, ctx, &data.is_flush_prune);
+ bpf_usdt_readarg(5, ctx, &data.is_flush_for_prune);
flush.perf_submit(ctx, &data, sizeof(data));
return 0;
}
@@ -52,7 +53,7 @@ class Data(ctypes.Structure):
("mode", ctypes.c_uint32),
("coins_count", ctypes.c_uint64),
("coins_mem_usage", ctypes.c_uint64),
- ("is_flush_prune", ctypes.c_bool),
+ ("is_flush_for_prune", ctypes.c_bool)
]
@@ -62,7 +63,7 @@ def print_event(event):
FLUSH_MODES[event.mode],
event.coins_count,
"%.2f kB" % (event.coins_mem_usage/1000),
- event.is_flush_prune,
+ event.is_flush_for_prune
))
@@ -85,7 +86,7 @@ def main(bitcoind_path):
print("Logging utxocache flushes. Ctrl-C to end...")
print("%-15s %-10s %-15s %-15s %-8s" % ("Duration (µs)", "Mode",
"Coins Count", "Memory Usage",
- "Prune"))
+ "Flush for Prune"))
while True:
try: