On Tue, Oct 19, 2021 at 8:02 AM Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote: > > On 19/10/21 02:04, Jing Zhang wrote: > > There are situations we need to group some stats in a structure (like > > the VM/VCPU generic stats). Improve stats macros to decouple the > > exported stats name from its field name in C structure. This also > > removes the specific macros for VM/VCPU generic stats. > > Do you have other uses in mind than generic stats? Yeah we have stats internally (that are in our queue to send upstream :) which store stats in sub-structs so that we can compute the same stats in multiple ways (e.g. snapshot vs. cumulative). When Jing was upgrading these stats from our internal API to the fd-based API I suggested breaking out the name to keep the stat names consistent across the upgrade. Then we noticed this would also clean up the VM/VCPU_GENERIC stuff as well. > I didn't like the > "generic" macros very much either, but not being able to use "#" at all > is also not nice. > > Paolo >