qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: "Markus Armbruster" <armbru@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-devel@nongnu.org,
	"Dr. David Alan Gilbert" <dave@treblig.org>,
	qemu-ppc@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: Examining device state via monitor for debugging
Date: Tue, 11 Jun 2024 09:46:55 +0100	[thread overview]
Message-ID: <ZmgO_-VlMIAE3xSl@redhat.com> (raw)
In-Reply-To: <887ef788-53b2-469d-bb36-d4a9ea795a38@ilande.co.uk>

On Tue, Jun 11, 2024 at 09:13:00AM +0100, Mark Cave-Ayland wrote:
> On 11/06/2024 08:57, Daniel P. Berrangé wrote:
> 
> > On Tue, Jun 11, 2024 at 07:49:12AM +0200, Markus Armbruster wrote:
> > > Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> > > 
> > > > Officialise the QMP command, use the existing
> > > > hmp_info_human_readable_text() helper.
> > > 
> > > I'm not sure "officialise" is a word :)
> > > 
> > > Taking a step back...  "info via" and its new QMP counterpart
> > > x-query-mos6522-devices dump device state.  I understand why examining
> > > device state via monitor can be useful for debugging.  However, we have
> > > more than 2000 devices in the tree.  Clearly, we don't want 2000 device
> > > state queries.  Not even 100.  Could we have more generic means instead?
> > > 
> > > We could use QOM (read-only) properties to expose device state.
> > > 
> > > If we use one QOM property per "thing", examining device state becomes
> > > quite tedious.  Also, you'd have to stop the guest to get a consistent
> > > view, and adding lots of QOM properties bloats the code.
> > > 
> > > If we use a single, object-valued property for the entire state, we get
> > > to define the objects in QAPI.  Differently tedious, and bloats the
> > > generated code.
> > > 
> > > We could use a single string-valued property.  Too much of an abuse of
> > > QOM?
> > 
> > Yeah, I'd suggest we just keep it dumb and free form, adding a
> > callback like this to the QOM base class:
> > 
> >    HumanReadableText (*debug_state)(Error **errp);
> 
> I think that's a little bit too restrictive: certainly I can see the need
> for allowing parameters for the output to be customised, and there may also
> be cases where a device may want to register more than one debug (or
> monitor) command.
> 
> Currently I quite like Manos' solution since it allows a MonitorInterface to
> be defined, and that could have separate methods for registering both "info"
> and "debug" commands. Longer term this could allow for e.g. TYPE_TCG_ACCEL
> to register "info jit" and devices can add whatever debug monitor commands
> they need.

The downside is that this wires the monitor APIs into the internals of the
devices, instead of having internals work exclusively in terms of QAPI
types.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2024-06-11  8:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10 15:07 [PATCH 0/2] hw/misc/mos6522: Do not open-code hmp_info_human_readable_text() Philippe Mathieu-Daudé
2024-06-10 15:07 ` [PATCH 1/2] hw/misc/mos6522: Expose x-query-mos6522-devices QMP command Philippe Mathieu-Daudé
2024-06-10 17:08   ` Daniel P. Berrangé
2024-06-11  5:36   ` Markus Armbruster
2024-06-10 15:07 ` [PATCH 2/2] hw/misc/mos6522: Do not open-code hmp_info_human_readable_text() Philippe Mathieu-Daudé
2024-06-10 17:09   ` Daniel P. Berrangé
2024-06-11  5:49 ` Examining device state via monitor for debugging (was: [PATCH 0/2] hw/misc/mos6522: Do not open-code hmp_info_human_readable_text()) Markus Armbruster
2024-06-11  6:09   ` Examining device state via monitor for debugging Mark Cave-Ayland
2024-06-11  6:58     ` Manos Pitsidianakis
2024-06-11  8:06       ` Mark Cave-Ayland
2024-06-11  7:57   ` Examining device state via monitor for debugging (was: [PATCH 0/2] hw/misc/mos6522: Do not open-code hmp_info_human_readable_text()) Daniel P. Berrangé
2024-06-11  8:13     ` Examining device state via monitor for debugging Mark Cave-Ayland
2024-06-11  8:46       ` Daniel P. Berrangé [this message]
2024-06-11  8:30   ` Examining device state via monitor for debugging (was: [PATCH 0/2] hw/misc/mos6522: Do not open-code hmp_info_human_readable_text()) Peter Maydell
2024-06-11 12:23     ` Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZmgO_-VlMIAE3xSl@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dave@treblig.org \
    --cc=eduardo@habkost.net \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).