Pierrick Bouvier
76b70dcb8f
plugins/cpp: register callbacks using captureless lambda
...
We can now demonstrate what previous changes allow us to do. Since all
callbacks have a userdata pointer, we can use that mechanism to move an
object through all of them.
In other words, we can now have stateful plugins without resorting to
any global variable.
As an example, we implement tb counting plugin with our cpp plugin. It
produces an output similar to hotblocks, with same performance.
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-27-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
285c40aaac
plugins: add userdata to qemu_plugin_vcpu_tb_trans_cb_t
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-17-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
ab24e19b42
plugins: remove qemu_plugin_id from qemu_plugin_vcpu_tb_trans_cb_t
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-16-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
396d005e4b
contrib/plugins/cpp: use __has_include
...
This make sure we can include all possible headers without breaking
build for environments missing them. It fixes compilation on openbsd.
We don't want to pollute configure script, as it's really a special case
here to make sure we don't have a compilation regression with
qemu-plugins header.
Tested-by: John Snow <jsnow@redhat.com >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260214061025.1239457-1-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
2026-02-19 12:34:11 -08:00
Pierrick Bouvier
20fc9c3f8b
contrib/plugins: add empty cpp plugin
...
This plugin makes sure we can compile in C++ while including qemu-plugin
header. It includes all C++ standard headers, up to C++23 standard,
minus the ones that are missing in the oldest environments we need to
build for.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260124182921.531562-12-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
2026-01-29 09:34:14 -08:00