diff --git a/userspace/libsinsp/sinsp.cpp b/userspace/libsinsp/sinsp.cpp index 9c8d7708b7..c10d79f867 100644 --- a/userspace/libsinsp/sinsp.cpp +++ b/userspace/libsinsp/sinsp.cpp @@ -1308,7 +1308,13 @@ int32_t sinsp::next(OUT sinsp_evt **puevt) get_procs_cpu_from_driver(ts); } - // this is used by things like the k8s and mesos clients + // + // Store a couple of values that we'll need later inside the event. + // These are potentially used both for parsing the event for internal + // state management, and for managing the k8s and mesos clients. + // + m_nevts++; + evt->m_evtnum = m_nevts; m_lastevent_ts = ts; if (m_automatic_threadtable_purging) @@ -1456,10 +1462,6 @@ int32_t sinsp::next(OUT sinsp_evt **puevt) m_parser->process_event(evt); #endif - // set the event number - m_nevts++; - evt->m_evtnum = m_nevts; - // // If needed, dump the event to file //