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

@ -75,6 +75,12 @@ struct AnalyOpt {
// Produce a profile of ZAM execution.
bool profile_ZAM = false;
// ZAM profiling sampling rate. Set via ZEEK_ZAM_PROF_SAMPLING_RATE.
int profile_sampling_rate = 100;
// An associated file to which to write the profile.
FILE* profile_file = nullptr;
// If true, dump out transformed code: the results of reducing
// interpreted scripts, and, if optimize is set, of then optimizing
// them.
@ -217,6 +223,10 @@ extern void analyze_global_stmts(Stmt* stmts);
// Returns the body and scope for the previously analyzed global statements.
extern std::pair<StmtPtr, ScopePtr> get_global_stmts();
// Informs script optimization that parsing is switching to the given module.
// Used to associate module names with profiling information.
extern void switch_to_module(const char* module);
// Add a pattern to the "only_funcs" list.
extern void add_func_analysis_pattern(AnalyOpt& opts, const char* pat);