[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v3 04/11] contrib/plugins: add plugin showcasing new dico
From: |
Julian Ganz |
Subject: |
Re: [RFC PATCH v3 04/11] contrib/plugins: add plugin showcasing new dicontinuity related API |
Date: |
Thu, 05 Dec 2024 13:00:19 +0000 |
Hi Pierrick,
December 5, 2024 at 12:14 AM, "Pierrick Bouvier" wrote:
> On 12/2/24 11:26, Julian Ganz wrote:
> > +typedef struct {
> > + uint64_t interrupts;
> > + uint64_t exceptions;
> > + uint64_t hostcalls;
> > + bool active;
> >
> The active field can be removed, as you can query qemu_plugin_num_vcpus() to
> know (dynamically) how many vcpus were created.
Yes, if the ids of dynamically initialized VCPUs are contiguous. I
wasn't sure they really are. And I distinctly remember we originally
used some query function and ended up with the maximum number of VCPUs
supported rather then those actually used. But that may have been
another function, or some unfortunate result of me being too cautious
and doing
| qemu_plugin_vcpu_for_each(id, vcpu_init);
in qemu_plugin_install.
> >
> > + break;
> > + }
> > +}
> > +
> > +static void plugin_exit(qemu_plugin_id_t id, void *p)
> > +{
> > + g_autoptr(GString) report;
> > + report = g_string_new("VCPU, interrupts, exceptions, hostcalls\n");
> > + int vcpu;
> > +
> > + for (vcpu = 0; vcpu < max_vcpus; vcpu++) {
> >
> vcpu < qemu_plugin_num_vcpus()
Yes, max_vcpus was introduced as an optimization. If we can rely on all
VCPUs with id < qemu_plugin_num_vcpus() having been active at some point
this becomes unnecessary.
> > + qemu_plugin_register_vcpu_discon_cb(id, QEMU_PLUGIN_DISCON_TRAPS,
> > + vcpu_discon);
> > +
> >
> The change from QEMU_PLUGIN_DISCON_TRAPS to QEMU_PLUGIN_DISCON_ALL should be
> included in this patch, instead of next one.
Ah, thanks for pointing that out. I likely fumbled this at some point when
rebasing.
Regards,
Julian Ganz
- [RFC PATCH v3 00/11] tcg-plugins: add hooks for discontinuities, Julian Ganz, 2024/12/02
- [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities, Julian Ganz, 2024/12/02
- Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities, Julian Ganz, 2024/12/03
- Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities, Pierrick Bouvier, 2024/12/04
- Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities, Julian Ganz, 2024/12/05
- Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities, Pierrick Bouvier, 2024/12/05
- Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities, Julian Ganz, 2024/12/05
- Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities, Julian Ganz, 2024/12/05
- Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities, Pierrick Bouvier, 2024/12/05
- Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities, Julian Ganz, 2024/12/06