Merge in SNORT/snort3 from ~RISHACHO/snort3:cpu_profiler_warn_msg to master
Squashed commit of the following:
commit
d23e9ce41dae05647dab0221969e20399660a91e
Author: Rishabh Choudhary <rishacho@cisco.com>
Date: Thu Jun 5 15:01:01 2025 +0530
profiler: add note for total percentage for profiler_dump
print_t(ss.str().c_str());
}
+ float get_total()
+ {
+ return total;
+ }
+
private:
const StatsTable::Field* fields;
const PrintFn print;
#include "config.h"
#endif
+#include <cmath>
+
#include "time_profiler.h"
#include "profiler_nodes.h"
ProfilerPrinter<time_stats::View> printer(time_stats::fields, time_stats::print_fn, sorter, printer_t);
printer.print_table(s_time_table_title, root, config.count, config.max_depth);
+
+ if (std::roundf(printer.get_total()) > 100.0f)
+ LogRespond(ctrlcon, "Note: Total time for a module includes time spent in submodules. Total percentage may exceed 100\n");
}
#ifdef UNIT_TEST