From 65ee1fc5c5f22e0582a97b4247b95f2c20ea8c22 Mon Sep 17 00:00:00 2001 From: Otto Date: Wed, 15 Sep 2021 10:10:26 +0200 Subject: [PATCH] Comments in .proto file --- pdns/dnsmessage.proto | 22 +++++++++++----------- pdns/recursordist/rec-eventtrace.cc | 1 - pdns/recursordist/rec-eventtrace.hh | 9 ++++----- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/pdns/dnsmessage.proto b/pdns/dnsmessage.proto index 48eb0af96b..5a80267383 100644 --- a/pdns/dnsmessage.proto +++ b/pdns/dnsmessage.proto @@ -127,13 +127,13 @@ message PBDNSMessage { } repeated Meta meta = 22; // Arbitrary meta-data - to be used in future rather than adding new fields all the time + // The well known EventTrace event numbers enum EventType { - RecRecv = 1; - DistPipe = 2; - PCacheCheck = 3; - SyncRes = 4; - AnswerSent = 5; - LuaGetTag = 100; + RecRecv = 1; // A request was received by the recursor process + PCacheCheck = 2; // A packet cache check was initiated or completed; value: bool cacheHit + SyncRes = 3; // Syncres main function has started or completed; value: int rcode + AnswerSent = 4; // The answer was sent to the client + LuaGetTag = 100; // Events below mark start or end of Lua hook calls; value: return value of hook LuaGetTagFFI = 101; LuaIPFilter = 102; LuaPreRPZ = 103; @@ -143,12 +143,12 @@ message PBDNSMessage { LuaNoData = 107; LuaNXDomain = 108; } - + message Event { - required uint64 ts = 1; - required EventType event = 2; - required bool start = 3; - optional bool boolVal = 4; + required uint64 ts = 1; // Timestamp in ns relative to time of creation of event trace data structure + required EventType event = 2; // Type of event + required bool start = 3; // true for "start" events, false for "completed" events + optional bool boolVal = 4; // Below are optional values associated with events optional int64 intVal = 5; optional string stringVal = 6; optional bytes bytesVal = 7; diff --git a/pdns/recursordist/rec-eventtrace.cc b/pdns/recursordist/rec-eventtrace.cc index 35330cf103..c2d04c46ab 100644 --- a/pdns/recursordist/rec-eventtrace.cc +++ b/pdns/recursordist/rec-eventtrace.cc @@ -28,7 +28,6 @@ const std::unordered_map RecEventTrace::s_eventNames = { NameEntry(RecRecv), - NameEntry(DistPipe), NameEntry(PCacheCheck), NameEntry(SyncRes), NameEntry(AnswerSent), diff --git a/pdns/recursordist/rec-eventtrace.hh b/pdns/recursordist/rec-eventtrace.hh index 62cc6b612a..55bf79eec3 100644 --- a/pdns/recursordist/rec-eventtrace.hh +++ b/pdns/recursordist/rec-eventtrace.hh @@ -38,10 +38,9 @@ public: { // Don't forget to add a new entry to the table in the .cc file! RecRecv = 1, - DistPipe = 2, - PCacheCheck = 3, - SyncRes = 4, - AnswerSent = 5, + PCacheCheck = 2, + SyncRes = 3, + AnswerSent = 4, LuaGetTag = 100, LuaGetTagFFI = 101, LuaIPFilter = 102, @@ -86,7 +85,7 @@ public: return *this; } - // We distinguisg beteen string and byres. Does not amtter in C++, but in Go, .Java etc it does + // We distinguish between strings and byte arrays. Does not matter in C++, but in Go, Java etc it does typedef std::variant Value_t; static std::string toString(const EventType v) -- 2.47.2