mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
hooks to support event tracing
This commit is contained in:
parent
25e096b50a
commit
39cbd7a9dc
4 changed files with 40 additions and 1 deletions
|
@ -33,6 +33,7 @@
|
|||
#include "zeek/Debug.h"
|
||||
#include "zeek/Desc.h"
|
||||
#include "zeek/Event.h"
|
||||
#include "zeek/EventTrace.h"
|
||||
#include "zeek/Expr.h"
|
||||
#include "zeek/File.h"
|
||||
#include "zeek/Frame.h"
|
||||
|
@ -401,6 +402,9 @@ ValPtr ScriptFunc::Invoke(zeek::Args* args, Frame* parent) const
|
|||
const CallExpr* call_expr = parent ? parent->GetCall() : nullptr;
|
||||
call_stack.emplace_back(CallInfo{call_expr, this, *args});
|
||||
|
||||
if ( etm && Flavor() == FUNC_FLAVOR_EVENT )
|
||||
etm->StartEvent(this, args);
|
||||
|
||||
if ( g_trace_state.DoTrace() )
|
||||
{
|
||||
ODesc d;
|
||||
|
@ -481,6 +485,9 @@ ValPtr ScriptFunc::Invoke(zeek::Args* args, Frame* parent) const
|
|||
result = val_mgr->True();
|
||||
}
|
||||
|
||||
else if ( etm && Flavor() == FUNC_FLAVOR_EVENT )
|
||||
etm->EndEvent(this, args);
|
||||
|
||||
// Warn if the function returns something, but we returned from
|
||||
// the function without an explicit return, or without a value.
|
||||
else if ( GetType()->Yield() && GetType()->Yield()->Tag() != TYPE_VOID &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue