From 706e72cc7440bf0d017e3131cd0c413144ded142 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Mon, 11 May 2015 13:28:07 +0300 Subject: [PATCH] Raft tracepoint at election completion --- .../dynamic_node_id_server/distributed/raft_core.hpp | 1 + .../uavcan/protocol/dynamic_node_id_server/event.hpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/raft_core.hpp b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/raft_core.hpp index 5323024c29..e2c29b3a65 100644 --- a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/raft_core.hpp +++ b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/raft_core.hpp @@ -165,6 +165,7 @@ class RaftCore : private TimerBase if (num_votes_received_in_this_campaign_ > 0) { + trace(TraceRaftElectionComplete, num_votes_received_in_this_campaign_); const bool won = num_votes_received_in_this_campaign_ >= cluster_.getQuorumSize(); UAVCAN_TRACE("dynamic_node_id_server::distributed::RaftCore", "Election complete, won: %d", int(won)); diff --git a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/event.hpp b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/event.hpp index 97f58e4493..26413b1e7c 100644 --- a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/event.hpp +++ b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/event.hpp @@ -51,7 +51,7 @@ enum TraceCode TraceRaftNewEntryCommitted, // new commit index value // 25 TraceRaftAppendEntriesCallFailure, // error code (may be negated) - Trace0, + TraceRaftElectionComplete, // number of votes collected Trace1, Trace2, Trace3, @@ -126,7 +126,7 @@ public: "RaftNewerTermInResponse", "RaftNewEntryCommitted", "RaftAppendEntriesCallFailure", - "", + "RaftElectionComplete", "", "", "", @@ -138,7 +138,7 @@ public: "AllocationRequestAccepted", "AllocationExchangeComplete", "AllocationResponse", - "", + "AllocationActivity", "", "DiscoveryNewNodeFound", "DiscoveryCommitCacheUpdated",