mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
avoid script coverage overhead (especially memory) when using ZAM
This commit is contained in:
parent
3f64858335
commit
2355f5af47
2 changed files with 7 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include "zeek/Desc.h"
|
#include "zeek/Desc.h"
|
||||||
#include "zeek/Reporter.h"
|
#include "zeek/Reporter.h"
|
||||||
#include "zeek/Type.h"
|
#include "zeek/Type.h"
|
||||||
|
#include "zeek/script_opt/ScriptOpt.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -21,7 +22,7 @@ ScriptCoverageManager::ScriptCoverageManager() : ignoring(0), delim('\t') { }
|
||||||
|
|
||||||
void ScriptCoverageManager::AddStmt(Stmt* s)
|
void ScriptCoverageManager::AddStmt(Stmt* s)
|
||||||
{
|
{
|
||||||
if ( ignoring != 0 )
|
if ( ignoring != 0 || analysis_options.gen_ZAM )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
stmts.emplace_back(NewRef{}, s);
|
stmts.emplace_back(NewRef{}, s);
|
||||||
|
@ -29,6 +30,9 @@ void ScriptCoverageManager::AddStmt(Stmt* s)
|
||||||
|
|
||||||
void ScriptCoverageManager::AddFunction(IDPtr func_id, StmtPtr body)
|
void ScriptCoverageManager::AddFunction(IDPtr func_id, StmtPtr body)
|
||||||
{
|
{
|
||||||
|
if ( analysis_options.gen_ZAM )
|
||||||
|
return;
|
||||||
|
|
||||||
func_instances.emplace_back(func_id, body);
|
func_instances.emplace_back(func_id, body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -845,7 +845,8 @@ void end_func(StmtPtr body, const char* module_name, bool free_of_conditionals)
|
||||||
|
|
||||||
id->GetVal()->AsFunc()->AddBody(*ingredients);
|
id->GetVal()->AsFunc()->AddBody(*ingredients);
|
||||||
|
|
||||||
script_coverage_mgr.AddFunction(id, ingredients->Body());
|
if ( ! analysis_options.gen_ZAM )
|
||||||
|
script_coverage_mgr.AddFunction(id, ingredients->Body());
|
||||||
|
|
||||||
auto func_ptr = cast_intrusive<FuncVal>(id->GetVal())->AsFuncPtr();
|
auto func_ptr = cast_intrusive<FuncVal>(id->GetVal())->AsFuncPtr();
|
||||||
auto func = cast_intrusive<ScriptFunc>(func_ptr);
|
auto func = cast_intrusive<ScriptFunc>(func_ptr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue