[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 35/35] plugins: Iterate on cb_lists in qemu_plugin_user_exit
From: |
Alex Bennée |
Subject: |
[PATCH v2 35/35] plugins: Iterate on cb_lists in qemu_plugin_user_exit |
Date: |
Tue, 24 Jan 2023 18:01:27 +0000 |
From: Richard Henderson <richard.henderson@linaro.org>
Rather than iterate over all plugins for all events,
iterate over plugins that have registered a given event.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230117035701.168514-4-richard.henderson@linaro.org>
---
plugins/core.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/plugins/core.c b/plugins/core.c
index 728bacef95..e04ffa1ba4 100644
--- a/plugins/core.c
+++ b/plugins/core.c
@@ -514,9 +514,10 @@ void qemu_plugin_user_exit(void)
/* un-register all callbacks except the final AT_EXIT one */
for (ev = 0; ev < QEMU_PLUGIN_EV_MAX; ev++) {
if (ev != QEMU_PLUGIN_EV_ATEXIT) {
- struct qemu_plugin_ctx *ctx;
- QTAILQ_FOREACH(ctx, &plugin.ctxs, entry) {
- plugin_unregister_cb__locked(ctx, ev);
+ struct qemu_plugin_cb *cb, *next;
+
+ QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) {
+ plugin_unregister_cb__locked(cb->ctx, ev);
}
}
}
--
2.34.1
- [PATCH v2 32/35] translator: always pair plugin_gen_insn_{start, end} calls, (continued)
- [PATCH v2 32/35] translator: always pair plugin_gen_insn_{start, end} calls, Alex Bennée, 2023/01/24
- [PATCH v2 31/35] plugins: fix optimization in plugin_gen_disable_mem_helpers, Alex Bennée, 2023/01/24
- [PATCH v2 18/35] MAINTAINERS: Fix the entry for tests/tcg/nios2, Alex Bennée, 2023/01/24
- [PATCH v2 19/35] docs: add hotlinks to about preface text, Alex Bennée, 2023/01/24
- [PATCH v2 28/35] thread: de-const qemu_spin_destroy, Alex Bennée, 2023/01/24
- [PATCH v2 34/35] cpu-exec: assert that plugin_mem_cbs is NULL after execution, Alex Bennée, 2023/01/24
- [PATCH v2 24/35] semihosting: add O_BINARY flag in host_open for NT compatibility, Alex Bennée, 2023/01/24
- [PATCH v2 25/35] tests/tcg: add memory-sve test for aarch64, Alex Bennée, 2023/01/24
- [PATCH v2 35/35] plugins: Iterate on cb_lists in qemu_plugin_user_exit,
Alex Bennée <=
- [PATCH v2 27/35] util/qht: add missing atomic_set(hashes[i]), Alex Bennée, 2023/01/24
- [PATCH v2 30/35] plugins: make qemu_plugin_user_exit's locking order consistent with fork_start's, Alex Bennée, 2023/01/24
- [PATCH v2 13/35] tests/docker: Install flex in debian-tricore-cross, Alex Bennée, 2023/01/24
- [PATCH v2 23/35] semihosting: Write back semihosting data before completion callback, Alex Bennée, 2023/01/24
- [PATCH v2 17/35] gitlab: wrap up test results for custom runners, Alex Bennée, 2023/01/24
- [PATCH v2 33/35] tcg: exclude non-memory effecting helpers from instrumentation, Alex Bennée, 2023/01/24
- [PATCH v2 20/35] docs: add a new section to outline emulation support, Alex Bennée, 2023/01/24