mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
plugin: Add InitPreExecution()
Currently, plugins do not have a way to further inspect or even mutate script functions after ZAM optimization ran. One use-case here is zeek-perf-support [1]. This plugin wraps Stmt instances of functions, events and hooks hooks with a small assembly stub to support JIT map files [2] and for integration with perf tools. This change introduces a new InitPreExecution() hook that runs after ZAM optimization completed, just before the zeek_init() event is enqueued. Additionally, remove the existing CPP_activation_hook. It doesn't seem to be used. If it becomes necessary in the future, the new InitPreExecution() hook can be leveraged instead. [1] https://github.com/zeek/zeek-perf-support [2] https://github.com/torvalds/linux/blob/master/tools/perf/Documentation/jit-interface.txt
This commit is contained in:
parent
2125a1f558
commit
993cdd03e0
7 changed files with 27 additions and 7 deletions
|
@ -26,7 +26,6 @@ AnalyOpt analysis_options;
|
|||
std::unordered_set<const Func*> non_recursive_funcs;
|
||||
|
||||
void (*CPP_init_hook)() = nullptr;
|
||||
void (*CPP_activation_hook)() = nullptr;
|
||||
|
||||
// Tracks all of the loaded functions (including event handlers and hooks).
|
||||
static std::vector<FuncInfo> funcs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue