[libvirt] [PATCH 1/1] perf: add more perf events support

Peter Krempa pkrempa at redhat.com
Thu Jun 9 11:50:03 UTC 2016


On Tue, May 31, 2016 at 10:48:15 +0800, Qiaowei Ren wrote:
> With current perf framework, this patch adds support to more perf
> events, including cache missing, cache peference, cpu cycles,
> instrction, etc..
> 
> Signed-off-by: Qiaowei Ren <qiaowei.ren at intel.com>
> ---
>  include/libvirt/libvirt-domain.h | 39 ++++++++++++++++++++++++
>  src/libvirt-domain.c             |  8 +++++
>  src/qemu/qemu_driver.c           | 23 +++++++-------
>  src/util/virperf.c               | 65 +++++++++++++++++++++++++++++++++++++++-
>  src/util/virperf.h               |  4 +++
>  5 files changed, 126 insertions(+), 13 deletions(-)
> 
> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
> index cba4fa5..99c4c48 100644
> --- a/include/libvirt/libvirt-domain.h
> +++ b/include/libvirt/libvirt-domain.h
> @@ -1928,6 +1928,45 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats);
>   */
>  # define VIR_PERF_PARAM_MBML "mbml"

[...]

> +/**
> + * VIR_PERF_PARAM_INSTRUCTIONS:
> + *
> + * Macro for typed parameter name that represents instructions perf
> + * event which can be used to measure the amount of instructions
> + * by applications running on the platform. It corresponds to the
> + * "perf.instructions" field in the *Stats APIs.

I'm not sure if I understand the implications and usability of this stat
parameter. Could you elaborate on how this can be used?

> + */
> +# define VIR_PERF_PARAM_INSTRUCTIONS "instructions"
> +
> +/**
> + * VIR_PERF_PARAM_CPU_CYCLES:
> + *
> + * Macro for typed parameter name that represents cpu_cycles perf event
> + * which can be used to measure how many cycles one instruction needs.
> + * It corresponds to the "perf.cpu_cycles" field in the *Stats APIs.

And same for this. I don't really see how this can be used.

> + */
> +# define VIR_PERF_PARAM_CPU_CYCLES "cpu_cycles"
> +

The rest of this patch looks good and applies cleanly.

Peter




More information about the libvir-list mailing list