* Daniel P. BerrangĂ© ([email protected]) wrote:
> On Thu, Jan 08, 2026 at 09:32:49AM +0100, Markus Armbruster wrote:
> > Commit c10eb740108 (accel/system: Add 'info accel' on human monitor)
> > inserted "info accel" in the middle of "info sync-profile".  Move it
> > behind "info sync-profile".
> 
> Opps, we have this kind of mistake over & over again. The .hx format
> is really horrible and easy to make this mistake with, and makes me
> rather wish we could eliminate it :-(

Yeh; would the tools need any change at all if we were to change it 

 from:  --------------->
    {
        .name       = "accel",
        .args_type  = "",
        .params     = "",
        .help       = "show accelerator statistics",
    },
    
SRST
  ``info accel``
    Show accelerator statistics.
ERST


 to:  --------------->
    {
        .name       = "accel",
        .args_type  = "",
        .params     = "",
        .help       = "show accelerator statistics",
SRST
  ``info accel``
    Show accelerator statistics.
ERST
    },

 --------------------
    

which might stop them separating from each other?

I can also imagine we could pretty easily add a check for a
definition that's missing an SRST/ERST section or an SRST/ERST
section that's missing a .name entry.

It also feels like it wouldn't be that hard to do:

s/SRST/#ifdef SRST/
s/ERST/#endif/
s@HXCOMM@//@

and then we can just #include the .hx files directly as headers
and fix up the docs script.

Dave

> 
> 
> > 
> > Signed-off-by: Markus Armbruster <[email protected]>
> > ---
> >  hmp-commands-info.hx | 24 ++++++++++++------------
> >  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> Reviewed-by: Daniel P. BerrangĂ© <[email protected]>
> 
> > 
> > diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
> > index 41674dcbe1..74c741f80e 100644
> > --- a/hmp-commands-info.hx
> > +++ b/hmp-commands-info.hx
> > @@ -267,18 +267,6 @@ ERST
> >          .cmd        = hmp_info_sync_profile,
> >      },
> >  
> > -    {
> > -        .name       = "accel",
> > -        .args_type  = "",
> > -        .params     = "",
> > -        .help       = "show accelerator statistics",
> > -    },
> > -
> > -SRST
> > -  ``info accel``
> > -    Show accelerator statistics.
> > -ERST
> > -
> >  SRST
> >    ``info sync-profile [-m|-n]`` [*max*]
> >      Show synchronization profiling info, up to *max* entries (default: 10),
> > @@ -294,6 +282,18 @@ SRST
> >      being coalesced.
> >  ERST
> >  
> > +    {
> > +        .name       = "accel",
> > +        .args_type  = "",
> > +        .params     = "",
> > +        .help       = "show accelerator statistics",
> > +    },
> > +
> > +SRST
> > +  ``info accel``
> > +    Show accelerator statistics.
> > +ERST
> > +
> >      {
> >          .name       = "kvm",
> >          .args_type  = "",
> > -- 
> > 2.52.0
> > 
> > 
> 
> 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 :|
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

Reply via email to