From f1ce9765eb0174225ee922419bde65c251168df4 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Fri, 29 Mar 2019 13:21:31 +0100 Subject: [PATCH] implement stub instruction profiler plugin --- .../instruction_profiler_plugin.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 mythril/laser/ethereum/plugins/implementations/instruction_profiler_plugin.py diff --git a/mythril/laser/ethereum/plugins/implementations/instruction_profiler_plugin.py b/mythril/laser/ethereum/plugins/implementations/instruction_profiler_plugin.py new file mode 100644 index 00000000..77c9a016 --- /dev/null +++ b/mythril/laser/ethereum/plugins/implementations/instruction_profiler_plugin.py @@ -0,0 +1,19 @@ +from mythril.laser.ethereum.svm import LaserEVM +from mythril.laser.ethereum.plugins.plugin import LaserPlugin +from mythril.laser.ethereum.state.global_state import GlobalState + + +class InstructionProfilerPlugin(LaserPlugin): + """ Instruction profiler plugin + + This plugin implements the logic that profiles the execution for the different instructions + It does so by measuring the frequency and duration of each operation execution + """ + + def initialize(self, symbolic_vm: LaserEVM): + """Initializes the instruction profiler + + Introduces hooks that measure the duration of each execution and the name of the instruction being executed + :param symbolic_vm: The virtual machine to initialize the plugin for + """ + pass