extend ZEEK_PROFILER_FILE profiling to include summaries for functions/hooks/event handlers

This commit is contained in:
Vern Paxson 2023-04-22 16:56:24 -07:00
parent 32926e8def
commit 5b98538c8b
6 changed files with 67 additions and 28 deletions

View file

@ -14,6 +14,7 @@
#include "zeek/IntrusivePtr.h"
#include "zeek/Reporter.h"
#include "zeek/Scope.h"
#include "zeek/ScriptCoverageManager.h"
#include "zeek/Stmt.h"
#include "zeek/Traverse.h"
#include "zeek/Val.h"
@ -859,6 +860,8 @@ void end_func(StmtPtr body, const char* module_name, bool free_of_conditionals)
ingredients->FrameSize(), ingredients->Priority(),
ingredients->Groups());
script_coverage_mgr.AddFunction(id, ingredients->Body());
auto func_ptr = cast_intrusive<FuncVal>(id->GetVal())->AsFuncPtr();
auto func = cast_intrusive<ScriptFunc>(func_ptr);
func->SetScope(ingredients->Scope());