mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +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
|
@ -748,6 +748,14 @@ protected:
|
|||
*/
|
||||
virtual void InitPostScript();
|
||||
|
||||
/**
|
||||
* Third-stage initialization of the plugin called just before enqueueing
|
||||
* zeek_init(), after script analysis and optimization completed.
|
||||
* This can be overridden by derived classes; they must however call the
|
||||
* parent's implementation.
|
||||
*/
|
||||
virtual void InitPreExecution();
|
||||
|
||||
/**
|
||||
* Finalizer method that derived classes can override for performing
|
||||
* custom tasks at shutdown. This can be overridden by derived
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue