framework for --enable-ZAM-profiling configuration

profiles go to zprof.log rather than stdout
This commit is contained in:
Vern Paxson 2024-03-10 13:35:07 -07:00 committed by Tim Wojtulewicz
parent 8d762eea54
commit dc376953fa
6 changed files with 67 additions and 5 deletions

View file

@ -20,6 +20,7 @@
#include "zeek/Val.h"
#include "zeek/module_util.h"
#include "zeek/script_opt/IDOptInfo.h"
#include "zeek/script_opt/ScriptOpt.h"
#include "zeek/script_opt/StmtOptInfo.h"
#include "zeek/script_opt/UsageAnalyzer.h"
@ -399,7 +400,10 @@ void add_type(ID* id, TypePtr t, std::unique_ptr<std::vector<AttrPtr>> attr) {
static std::set<std::string> all_module_names;
void add_module(const char* module_name) { all_module_names.emplace(module_name); }
void add_module(const char* module_name) {
all_module_names.emplace(module_name);
switch_to_module(module_name);
}
const std::set<std::string>& module_names() { return all_module_names; }