else
{
sw->suspend();
+ pc.offload_suspends++;
return true;
}
}
{
ContextSwitcher* sw = Analyzer::get_switcher();
- bool depends_on_suspended = p->flow ? p->flow->context_chain.front() : sw->non_flow_chain.front();
- bool can_offload = offloader->available();
+ bool depends_on_suspended =
+ p->flow ? p->flow->context_chain.front() : sw->non_flow_chain.front();
+
bool should_offload = p->dsize >= SnortConfig::get_conf()->offload_limit;
- if ( can_offload and should_offload )
+ if ( should_offload )
{
- return do_offload(p);
+ if ( offloader->available() )
+ return do_offload(p);
+
+ pc.offload_busy++;
}
if ( depends_on_suspended )
fp_partial(p);
p->context->searches.search_sync();
sw->suspend();
+ pc.offload_suspends++;
return true;
}
void DetectionEngine::onload(Flow* flow)
{
+ if ( flow->is_suspended() )
+ pc.onload_waits++;
+
while ( flow->is_suspended() )
{
trace_logf(detection,
#include "latency/rule_latency.h"
#include "main/snort_config.h"
#include "managers/module_manager.h"
+#include "utils/stats.h"
+
+using namespace snort;
// FIXIT-L this could be offloader specific
struct RegexRequest
{
if (batch->can_fallback())
{
- // FIXIT-M Add peg counts to record offload search fallback attempts
batch->search_sync();
+ pc.offload_fallback++;
}
- // FIXIT-M else Add peg counts to record offload search failures
+ pc.offload_failures++;
}
snort::IpsContext* c = (snort::IpsContext*)(batch->context);
{
if (c->searches.can_fallback())
{
- // FIXIT-M Add peg counts to record offload search fallback attempts
c->searches.search_sync();
+ pc.offload_fallback++;
}
- // FIXIT-M else Add peg counts to record offload search failures
+ pc.offload_failures++;
}
c->searches.items.clear();
req->offload = false;
}
snort::ModuleManager::accumulate_offload("search_engine");
+ snort::ModuleManager::accumulate_offload("detection");
// FIXIT-M break this over-coupling. In reality we shouldn't be evaluating latency in offload.
PacketLatency::tterm();
{ CountType::SUM, "event_limit", "events filtered" },
{ CountType::SUM, "alert_limit", "events previously triggered on same PDU" },
{ CountType::SUM, "context_stalls", "times processing stalled to wait for an available context" },
+ { CountType::SUM, "offload_busy", "times offload was not available" },
+ { CountType::SUM, "onload_waits", "times processing waited for onload to complete" },
+ { CountType::SUM, "offload_fallback", "fast pattern offload search fallback attempts" },
+ { CountType::SUM, "offload_failures", "fast pattern offload search failures" },
+ { CountType::SUM, "offload_suspends", "fast pattern search suspends due to offload context chains" },
{ CountType::END, nullptr, nullptr }
};
PegCount event_limit;
PegCount alert_limit;
PegCount context_stalls;
+ PegCount offload_busy;
+ PegCount onload_waits;
+ PegCount offload_fallback;
+ PegCount offload_failures;
+ PegCount offload_suspends;
};
struct ProcessCount