[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 3/5] i386/kvm: Support event with select & umask format in K
From: |
Zhao Liu |
Subject: |
Re: [RFC v2 3/5] i386/kvm: Support event with select & umask format in KVM PMU filter |
Date: |
Thu, 6 Feb 2025 18:23:11 +0800 |
> > > > +##
> > > > +# @KVMPMUX86DefalutEventVariant:
>
> Typo s/Defalut/Default/ - repeated many times in this patch.
My bad! Will fix!
> > > > +#
> > > > +# The variant of KVMPMUX86DefalutEvent with the string, rather than
> > > > +# the numeric value.
> > > > +#
> > > > +# @select: x86 PMU event select field. This field is a 12-bit
> > > > +# unsigned number string.
> > > > +#
> > > > +# @umask: x86 PMU event umask field. This field is a uint8 string.
> > >
> > > Why are these strings? How are they parsed into numbers?
> >
> > In practice, the values associated with PMU events (code for arm, select&
> > umask for x86) are often expressed in hexadecimal. Further, from linux
> > perf related information (tools/perf/pmu-events/arch/*/*/*.json), x86/
> > arm64/riscv/nds32/powerpc all prefer the hexadecimal numbers and only
> > s390 uses decimal value.
> >
> > Therefore, it is necessary to support hexadecimal in order to honor PMU
> > conventions.
>
> IMHO having a data format that matches an arbitrary external tool is not
> a goal for QMP. It should be neutral and exclusively use the normal JSON
> encoding, ie base-10 decimal. Yes, this means a user/client may have to
> convert from hex to dec before sending data over QMP. This is true of
> many areas of QMP/QEMU config though and thus normal/expected behaviour.
>
Thanks! This will simplify the code a lot.