Skip to content

Commit

Permalink
add: cli arg to specify a bitcoind PID
Browse files Browse the repository at this point in the history
  • Loading branch information
0xB10C committed Nov 7, 2024
1 parent 4f4272e commit cf24fbe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion extractor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ struct Args {
#[arg(short, long)]
bitcoind_path: String,

/// PID (Process ID) of the Bitcoin Core (bitcoind) binary that should be hooked into.
#[arg(short, long, default_value_t = -1)]
bitcoind_pid: i32,

// Default tracepoints
/// Controls if the p2p message tracepoints should be hooked into.
#[arg(long)]
Expand Down Expand Up @@ -282,7 +286,7 @@ fn main() -> Result<(), libbpf_rs::Error> {
for tracepoint in active_tracepoints {
let prog = find_prog_mut(&obj, tracepoint.function);
_links.push(prog.attach_usdt(
-1,
args.bitcoind_pid,
&args.bitcoind_path,
tracepoint.context,
tracepoint.name,
Expand Down

0 comments on commit cf24fbe

Please sign in to comment.