Re: [PATCH 6/9] perf: expose perf capability to other modules.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 11/01/2011 10:13 AM, Gleb Natapov wrote:
> On Tue, Nov 01, 2011 at 09:49:19AM -0600, David Ahern wrote:
>> On 10/30/2011 10:53 AM, Gleb Natapov wrote:
>>> KVM needs to know perf capability to decide which PMU it can expose to a
>>> guest.
>>>
>>> Signed-off-by: Gleb Natapov <gleb@xxxxxxxxxx>
>>> ---
>>>  arch/x86/include/asm/perf_event.h      |   11 +++++++++++
>>>  arch/x86/kernel/cpu/perf_event.c       |   11 +++++++++++
>>>  arch/x86/kernel/cpu/perf_event.h       |    2 ++
>>>  arch/x86/kernel/cpu/perf_event_intel.c |    3 +++
>>>  4 files changed, 27 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h
>>> index f61c62f..7d7e57f 100644
>>> --- a/arch/x86/include/asm/perf_event.h
>>> +++ b/arch/x86/include/asm/perf_event.h
>>> @@ -201,7 +201,18 @@ struct perf_guest_switch_msr {
>>>  	u64 host, guest;
>>>  };
>>>  
>>> +struct x86_pmu_capability {
>>> +	int version;
>>> +	int num_counters_gp;
>>> +	int num_counters_fixed;
>>> +	int bit_width_gp;
>>> +	int bit_width_fixed;
>>> +	unsigned int events_mask;
>>> +	int events_mask_len;
>>> +};
>>> +
>>>  extern struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr);
>>> +extern void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap);
>>>  #else
>>>  static inline perf_guest_switch_msr *perf_guest_get_msrs(int *nr)
>>>  {
>>
>> What about version of perf_get_x86_pmu_capability for CONFIG_PERF_EVENTS
>> not enabled in host kernel? Next patch for KVM assumes the function is
>> defined.
>>
> As far as I understand it is not possible to build x86 without
> CONFIG_PERF_EVENTS right now. Actually kvm pmu code depends on
> CONFIG_PERF_EVENTS been enabled. I can easily provide the stub if
> needed though.

Right. Originally it could be enabled/disabled. Right now it cannot be,
but I believe Frederic is working on making it configurable again.

David
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux