[libvirt] [PATCH perl v2] Add constants for new perf event support
John Ferlan
jferlan at redhat.com
Mon Mar 6 19:55:21 UTC 2017
On 02/24/2017 01:49 AM, Nitesh Konkar wrote:
> Signed-off-by: Nitesh Konkar <nitkon12 at linux.vnet.ibm.com>
> ---
> Changes | 9 +++++++++
> Virt.xs | 9 +++++++++
> lib/Sys/Virt/Domain.pm | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 72 insertions(+)
>
This will be OK with a couple of adjustments that I can make once Daniel
creates the 3.1 libvirt-perl ...
Thanks for doing this at least saves me a couple of steps.
John
> diff --git a/Changes b/Changes
> index 842f21f..7d637f5 100644
> --- a/Changes
> +++ b/Changes
> @@ -5,6 +5,15 @@ Revision history for perl module Sys::Virt
> - Add VIR_CONNECT_LIST_STORAGE_POOLS_VSTORAGE constant
> - Add VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM constant
> - Add virDomainSetVcpu API
> + - Add PERF_PARAM_CPU_CLOCK constant
> + - Add PERF_PARAM_TASK_CLOCK constant
> + - Add PERF_PARAM_PAGE_FAULTS constant
> + - Add PERF_PARAM_CONTEXT_SWITCHES constant
> + - Add PERF_PARAM_CPU_MIGRATIONS constant
> + - Add PERF_PARAM_PAGE_FAULTS_MIN constant
> + - Add PERF_PARAM_PAGE_FAULTS_MAJ constant
> + - Add PERF_PARAM_ALIGNMENT_FAULTS constant
> + - Add PERF_PARAM_EMULATION_FAULTS constant
These will all end up in a 3.2.0 section once it's created.
>
> 3.0.0 2017-01-19
>
> diff --git a/Virt.xs b/Virt.xs
> index 9728fb0..e80182f 100644
> --- a/Virt.xs
> +++ b/Virt.xs
> @@ -8500,6 +8500,15 @@ BOOT:
> REGISTER_CONSTANT_STR(VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND, PERF_PARAM_STALLED_CYCLES_FRONTEND);
> REGISTER_CONSTANT_STR(VIR_PERF_PARAM_STALLED_CYCLES_BACKEND, PERF_PARAM_STALLED_CYCLES_BACKEND);
> REGISTER_CONSTANT_STR(VIR_PERF_PARAM_REF_CPU_CYCLES, PERF_PARAM_REF_CPU_CYCLES);
> + REGISTER_CONSTANT_STR(VIR_PERF_PARAM_CPU_CLOCK, PERF_PARAM_CPU_CLOCK);
> + REGISTER_CONSTANT_STR(VIR_PERF_PARAM_TASK_CLOCK, PERF_PARAM_TASK_CLOCK);
> + REGISTER_CONSTANT_STR(VIR_PERF_PARAM_PAGE_FAULTS, PERF_PARAM_PAGE_FAULTS);
> + REGISTER_CONSTANT_STR(VIR_PERF_PARAM_CONTEXT_SWITCHES, PERF_PARAM_CONTEXT_SWITCHES);
> + REGISTER_CONSTANT_STR(VIR_PERF_PARAM_CPU_MIGRATIONS, PERF_PARAM_CPU_MIGRATIONS);
> + REGISTER_CONSTANT_STR(VIR_PERF_PARAM_PAGE_FAULTS_MIN, PERF_PARAM_PAGE_FAULTS_MIN);
> + REGISTER_CONSTANT_STR(VIR_PERF_PARAM_PAGE_FAULTS_MAJ, PERF_PARAM_PAGE_FAULTS_MAJ);
> + REGISTER_CONSTANT_STR(VIR_PERF_PARAM_ALIGNMENT_FAULTS, PERF_PARAM_ALIGNMENT_FAULTS);
> + REGISTER_CONSTANT_STR(VIR_PERF_PARAM_EMULATION_FAULTS, PERF_PARAM_EMULATION_FAULTS);
>
> REGISTER_CONSTANT_STR(VIR_DOMAIN_BANDWIDTH_IN_AVERAGE, BANDWIDTH_IN_AVERAGE);
> REGISTER_CONSTANT_STR(VIR_DOMAIN_BANDWIDTH_IN_PEAK, BANDWIDTH_IN_PEAK);
> diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm
> index 6b36e73..eea8b26 100644
> --- a/lib/Sys/Virt/Domain.pm
> +++ b/lib/Sys/Virt/Domain.pm
> @@ -2814,6 +2814,60 @@ frequency scaling by applications running on the platform.
> It corresponds to the "perf.ref_cpu_cycles" field in the
> *Stats APIs.
>
> +=item Sys::Virt::Domain::PERF_PARAM_CPU_CLOCK
> +The cpu_clock perf event counter which can be used to
> +measure the count of cpu clock time by applications
> +running on the platform. It corresponds to the
> +"perf.cpu_clock" field in the *Stats APIs.
> +
> +=item Sys::Virt::Domain::PERF_PARAM_TASK_CLOCK
> +The task_clock perf event counter which can be used to
> +measure the count of task clock time by applications
> +running on the platform. It corresponds to the
> +"perf.task_clock" field in the *Stats APIs.
> +
> +=item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS
> +The page_faults perf event counter which can be used to
> +measure the count of page faults by applications running
> +on the platform. It corresponds to the "perf.page_faults"
> +field in the *Stats APIs.
> +
> +=item Sys::Virt::Domain::PERF_PARAM_CONTEXT_SWITCHES
> +The context_switches perf event counter which can be used to
> +measure the count of context switches by applications running
> +on the platform. It corresponds to the "perf.context_switches"
> +field in the *Stats APIs.
> +
> +=item Sys::Virt::Domain::PERF_PARAM_CPU_MIGRATIONS
> +The cpu_migrations perf event counter which can be used to
> +measure the count of cpu migrations by applications running
> +on the platform. It corresponds to the "perf.cpu_migrations"
> +field in the *Stats APIs.
> +
> +=item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS_MIN
> +The page_faults_min perf event counter which can be used to
> +measure the count of minor page faults by applications running
> +on the platform. It corresponds to the "perf.page_faults_min"
> +field in the *Stats APIs.
> +
> +=item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS_MAJ
> +The page_faults_maj perf event counter which can be used to
> +measure the count of major page faults by applications running
> +on the platform. It corresponds to the "perf.page_faults_maj"
> +field in the *Stats APIs.
> +
> +=item Sys::Virt::Domain::PERF_PARAM_ALIGNMENT_FAULTS
> +The alignment_faults perf event counter which can be used to
> +measure the count of alignment faults by applications running
> +on the platform. It corresponds to the "perf.alignment_faults"
> +field in the *Stats APIs.
> +
> +=item Sys::Virt::Domain::PERF_PARAM_EMULATION_FAULTS
> +The emulation_faults perf event counter which can be used to
> +measure the count of emulation faults by applications running
> +on the platform. It corresponds to the "perf.emulation_faults"
> +field in the *Stats APIs.
> +
> =back
>
> =head2 VCPU FLAGS
>
More information about the libvir-list
mailing list