VPP/elog
From fd.io
Introduction
The vppinfra event logger provides very lightweight (sub-100ns), precisely time-stamped event-logging services. Serialization support makes it easy to save and ultimately to combine a set of event logs. In a distributed system running NTP over a local LAN, we find that event logs collected from multiple system elements can be combined with a temporal uncertainty no worse than 50us.
Example 1
A typical event definition and a related log entry creation sequence looks like this:
ELOG_TYPE_DECLARE (e) = { .format = "tx-msg: stream %d local seq %d attempt %d", .format_args = "i4i4i4", }; struct { u32 stream_id, local_sequence, retry_count; } * ed; ed = ELOG_DATA (m->elog_main, e); ed->stream_id = stream_id; ed->local_sequence = local_sequence; ed->retry_count = retry_count;