diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2024-03-14 19:27:28 -1000 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2024-04-30 16:12:05 -0700 |
commit | 5e379b08bceb04631401fda674c4c9f7ab1e3f94 (patch) | |
tree | b6200f1a8cc5f013b56854962612a142b0d6ad4b /include | |
parent | 7e53aa213e319ce905f26c64164f6eaf8360e73d (diff) |
plugins: Merge qemu_plugin_tb_insn_get to plugin-gen.c
Merge qemu_plugin_insn_alloc and qemu_plugin_tb_insn_get into
plugin_gen_insn_start, since it is used nowhere else.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/qemu/plugin.h | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index f5a08b1220..18062528c1 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -129,14 +129,6 @@ static inline void qemu_plugin_insn_cleanup_fn(gpointer data) g_byte_array_free(insn->data, true); } -static inline struct qemu_plugin_insn *qemu_plugin_insn_alloc(void) -{ - struct qemu_plugin_insn *insn = g_new0(struct qemu_plugin_insn, 1); - - insn->data = g_byte_array_sized_new(4); - return insn; -} - /* Internal context for this TranslationBlock */ struct qemu_plugin_tb { GPtrArray *insns; @@ -154,37 +146,6 @@ struct qemu_plugin_tb { }; /** - * qemu_plugin_tb_insn_get(): get next plugin record for translation. - * @tb: the internal tb context - * @pc: address of instruction - */ -static inline -struct qemu_plugin_insn *qemu_plugin_tb_insn_get(struct qemu_plugin_tb *tb, - uint64_t pc) -{ - struct qemu_plugin_insn *insn; - - if (unlikely(tb->n == tb->insns->len)) { - struct qemu_plugin_insn *new_insn = qemu_plugin_insn_alloc(); - g_ptr_array_add(tb->insns, new_insn); - } - - insn = g_ptr_array_index(tb->insns, tb->n++); - g_byte_array_set_size(insn->data, 0); - insn->calls_helpers = false; - insn->mem_helper = false; - insn->vaddr = pc; - if (insn->insn_cbs) { - g_array_set_size(insn->insn_cbs, 0); - } - if (insn->mem_cbs) { - g_array_set_size(insn->mem_cbs, 0); - } - - return insn; -} - -/** * struct CPUPluginState - per-CPU state for plugins * @event_mask: plugin event bitmap. Modified only via async work. */ |