Re: [PATCH v12 02/12] perf/x86/intel/pt: Change pt_cap_get() to a public function

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

 



On Thu, 26 Jul 2018, Luwei Kang wrote:
> From: Chao Peng <chao.p.peng@xxxxxxxxxxxxxxx>
> 
> Change pt_cap_get() to a public function that KVM
> can access this function to check if specific
> feature is supported on hardware.

Changelog suggestion:

perf/x86/intel/pt: Export pt_cap_get()  

  pt_cap_get() is required by the upcoming PT support in KVM guests.

  Export it and move the capabilites enum to a global header.

Hmm?

> -static u32 pt_cap_get(enum pt_capabilities cap)
> +u32 pt_cap_get(enum pt_capabilities cap)

pt_cap_get() is fine as a local function name, but we try in general to
have clearly identifyable prefixes for global functions, types and enums.

pt_ is already used for ptrace and other things, so it makes sense to use
intel_pt_ as a prefix.

Also cap_get() is a misnomer because its not getting capabilities, it is
validating that the handed in capability is supported by the hardware.

Somehing like intel_pt_validate_cap() or intel_pt_get_supported_cap() might
be more accurate.

Thanks,

	tglx



[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