tracing: add inbound connection tracepoint

This commit is contained in:
0xb10c
2022-05-02 16:26:22 +02:00
committed by 0xb10c
parent 1172bc4157
commit 85b2603eec
3 changed files with 115 additions and 1 deletions

View File

@@ -53,6 +53,7 @@
#include <optional>
#include <unordered_map>
TRACEPOINT_SEMAPHORE(net, inbound_connection);
TRACEPOINT_SEMAPHORE(net, outbound_message);
/** Maximum number of block-relay-only anchor connections */
@@ -1833,6 +1834,12 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
m_nodes.push_back(pnode);
}
LogDebug(BCLog::NET, "connection from %s accepted\n", addr.ToStringAddrPort());
TRACEPOINT(net, inbound_connection,
pnode->GetId(),
pnode->m_addr_name.c_str(),
pnode->ConnectionTypeAsString().c_str(),
pnode->ConnectedThroughNetwork(),
GetNodeCount(ConnectionDirection::In));
// We received a new connection, harvest entropy from the time (and our peer count)
RandAddEvent((uint32_t)id);