]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3210: perf_monitor: periodically update telemetry data during thread...
authorMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 14 Dec 2021 19:40:36 +0000 (19:40 +0000)
committerMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 14 Dec 2021 19:40:36 +0000 (19:40 +0000)
Merge in SNORT/snort3 from ~SVLASIUK/snort3:perf_mon to master

Squashed commit of the following:

commit 481156c654cf73ba797febd0608cd8fd9bd8cc8e
Author: Serhii Vlasiuk <svlasiuk@cisco.com>
Date:   Thu Dec 9 15:58:52 2021 +0200

    managers: continue inspectors probe when packet has disable_inspect flag

src/managers/inspector_manager.cc

index 613747367463810f2a51b7e59117d9f14368a7d9..009cd538b51765f6a6c0531b48bf1265501b2f35 100644 (file)
@@ -1411,7 +1411,7 @@ void InspectorManager::print_config(SnortConfig* sc)
 
 template<bool T>
 static inline void execute(
-    Packet* p, PHInstance* const * prep, unsigned num)
+    Packet* p, PHInstance* const * prep, unsigned num, bool probe = false)
 {
     Stopwatch<SnortClock> timer;
     for ( unsigned i = 0; i < num; ++i, ++prep )
@@ -1451,7 +1451,7 @@ static inline void execute(
                 "exit %s, elapsed time: %" PRId64" usec\n", inspector_name, TO_USECS(timer.get()));
 
         // must check between each ::execute()
-        if ( p->disable_inspect )
+        if ( !probe && p->disable_inspect )
             return;
     }
 }
@@ -1613,7 +1613,7 @@ void InspectorManager::probe(Packet* p)
     FrameworkPolicy* fp = policy->framework_policy;
 
     if ( !trace_enabled(snort_trace, TRACE_INSPECTOR_MANAGER, DEFAULT_TRACE_LOG_LEVEL, p) )
-        ::execute<false>(p, fp->probe.vec, fp->probe.num);
+        ::execute<false>(p, fp->probe.vec, fp->probe.num, true);
     else
     {
         Stopwatch<SnortClock> timer;
@@ -1624,7 +1624,7 @@ void InspectorManager::probe(Packet* p)
 
         timer.start();
 
-        ::execute<true>(p, fp->probe.vec, fp->probe.num);
+        ::execute<true>(p, fp->probe.vec, fp->probe.num, true);
 
         trace_ulogf(snort_trace, TRACE_INSPECTOR_MANAGER, p,
             "end inspection, %s, packet %" PRId64", context %" PRId64", total time: %" PRId64" usec\n",