On Tue, Feb 15, 2022 at 7:33 PM Like Xu <like.xu.linux@xxxxxxxxx> wrote: > AFAI, most cloud provider don't want to lose this flexibility as it leaves > hundreds of "profile KVM guests" cases with nowhere to land. I can only speak for Google Cloud. We'd like to be able to profile host code with system-wide pinned counters on a periodic basis, but we would like to do so without breaking PMU virtualization in the guest (and that includes not only the guest counters that run in guest mode, but also the guest counters that have to run in both guest mode and host mode, such as reference cycles unhalted). The one thing that is clear to me from these discussions is that the perf subsystem behavior needs to be more configurable than it is today. One possibility would be to separate priority from usage. Instead of having implicit priorities based on whether the event is system-wide pinned, system-wide multiplexed, thread pinned, or thread multiplexed, we could offer numeric priorities independent of the four usage modes. That should offer enough flexibility to satisfy everyone.