[libvirt] [PATCH 1/1] perf: add more perf events support
Ren, Qiaowei
qiaowei.ren at intel.com
Sun Jun 12 02:14:29 UTC 2016
> -----Original Message-----
> From: Peter Krempa [mailto:pkrempa at redhat.com]
> Sent: Thursday, June 9, 2016 7:50 PM
> To: Ren, Qiaowei <qiaowei.ren at intel.com>
> Cc: libvir-list at redhat.com
> Subject: Re: [libvirt] [PATCH 1/1] perf: add more perf events support
>
> 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.
>
Peter, thanks for your feedback!
Instructions and cycles can be used to gain IPC (Instructions Per Clock, = Instructions/Cycles), and a low IPC ratio indicates the code of the process makes poor use of the CPU.
Thanks,
Qiaowei
More information about the libvir-list
mailing list