Re: [PATCH v7 07/12] perf/x86: no counter allocation support

From: Wei Wang
Date: Tue Jul 09 2019 - 07:31:28 EST


On 07/09/2019 05:43 PM, Peter Zijlstra wrote:
That's almost a year ago; I really can't remember that and you didn't
put any of that in your Changelog to help me remember.

(also please use: https://lkml.kernel.org/r/$msgid style links)

OK, I'll put this link in the cover letter or commit log for a reminder.


In the previous version, we added a "no_counter" bit to perf_event_attr, and
that will be exposed to user ABI, which seems not good.
(https://lkml.org/lkml/2019/2/14/791)
So we wrap a new kernel API above to support this.

Do you have a different suggestion to do this?
(exclude host/guest just clears the enable bit when on VM-exit/entry,
still consumes the counter)
Just add an argument to perf_event_create_kernel_counter() ?

Yes. I didn't find a proper place to add this "no_counter" indicator, so added a
wrapper to avoid changing existing callers of perf_event_create_kernel_counter.

Best,
Wei