forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog_p2p_connections.bt
executable file
·51 lines (45 loc) · 1.4 KB
/
log_p2p_connections.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bpftrace
BEGIN
{
printf("Logging opened, closed, misbehaving, and evicted P2P connections\n")
}
usdt:./build/bin/bitcoind:net:inbound_connection
{
$id = (int64) arg0;
$addr = str(arg1);
$conn_type = str(arg2);
$network = (int32) arg3;
$existing = (uint64) arg4;
printf("INBOUND conn from %s: id=%ld, type=%s, network=%d, total=%d\n", $addr, $id, $conn_type, $network, $existing);
}
usdt:./build/bin/bitcoind:net:outbound_connection
{
$id = (int64) arg0;
$addr = str(arg1);
$conn_type = str(arg2);
$network = (int32) arg3;
$existing = (uint64) arg4;
printf("OUTBOUND conn to %s: id=%ld, type=%s, network=%d, total=%d\n", $addr, $id, $conn_type, $network, $existing);
}
usdt:./build/bin/bitcoind:net:closed_connection
{
$id = (int64) arg0;
$addr = str(arg1);
$conn_type = str(arg2);
$network = (int32) arg3;
printf("CLOSED conn to %s: id=%ld, type=%s, network=%d, established=%ld\n", $addr, $id, $conn_type, $network, arg4);
}
usdt:./build/bin/bitcoind:net:evicted_inbound_connection
{
$id = (int64) arg0;
$addr = str(arg1);
$conn_type = str(arg2);
$network = (int32) arg3;
printf("EVICTED conn to %s: id=%ld, type=%s, network=%d, established=%ld\n", $addr, $id, $conn_type, $network, arg4);
}
usdt:./build/bin/bitcoind:net:misbehaving_connection
{
$id = (int64) arg0;
$message = str(arg1);
printf("MISBEHAVING conn id=%ld, message='%s'\n", $id, $message);
}