#include "latency/packet_latency.h"
#include "latency/rule_latency.h"
#include "main/snort_config.h"
+#include "managers/module_manager.h"
// FIXIT-L this could be offloader specific
struct RegexRequest
else if (resp_ret == snort::Mpse::MPSE_RESP_COMPLETE_FAIL)
{
- if (!c->searches.can_fallback())
+ if (c->searches.can_fallback())
{
// FIXIT-M Add peg counts to record offload search fallback attempts
c->searches.search_sync();
if (resp_ret == snort::Mpse::MPSE_RESP_COMPLETE_FAIL)
{
- if (!batch.can_fallback())
+ if (batch.can_fallback())
{
// FIXIT-M Add peg counts to record offload search fallback attempts
batch.search_sync();
batch.items.clear();
req->offload = false;
}
+ snort::ModuleManager::accumulate_offload("search_engine");
// FIXIT-M break this over-coupling. In reality we shouldn't be evaluating latency in offload.
PacketLatency::tterm();
std::lock_guard<std::mutex> lock(stats_mutex);
}
+void ModuleManager::accumulate_offload(const char* name)
+{
+ ModHook* p = get_hook(name);
+ if ( p )
+ {
+ std::lock_guard<std::mutex> lock(stats_mutex);
+ p->mod->prep_counts();
+ p->mod->sum_stats(true);
+ }
+ std::lock_guard<std::mutex> lock(stats_mutex);
+}
+
void ModuleManager::reset_stats(SnortConfig*)
{
for ( auto p : s_modules )
static void dump_stats(SnortConfig*, const char* skip = nullptr, bool dynamic = false);
static void accumulate(SnortConfig*);
+ static void accumulate_offload(const char* name);
static void reset_stats(SnortConfig*);
static std::set<uint32_t> gids;