[libvirt] [PATCH 5/8] perf: implement a set of util functions for perf event

Jiri Denemark jdenemar at redhat.com
Tue Nov 24 12:44:53 UTC 2015


On Tue, Nov 24, 2015 at 13:23:49 +0100, Jiri Denemark wrote:
> On Tue, Nov 17, 2015 at 16:00:45 +0800, Qiaowei Ren wrote:
> > This patch implement a set of interfaces for perf event. Based on
> > these interfaces, we can implement internal driver API for perf,
> > and get the results of perf conuter you care about.
> > 
> > Signed-off-by: Qiaowei Ren <qiaowei.ren at intel.com>
...
> > diff --git a/src/util/virperf.c b/src/util/virperf.c
> > new file mode 100644
> > index 0000000..9c71858
> > --- /dev/null
> > +++ b/src/util/virperf.c
...
> > +
> > +int
> > +virPerfCmtEnable(pid_t pid,
> > +                 virPerfPtr perf)
> 
> I think 'perf' should always be the first parameter of all virPerf
> functions, since it is the object all the functions operate on.
> 
> >From a caller perspective, I think it would be a bit better to create a
> generic int virPerfEventEnable(perf, type, pid) entry point, and make
> virPerfCmtEnable static. Unless each type requires different input data.

Actually, you can just pass vm to virPerfEventEnable, that should given
enough input data to any perf event.

Jirka




More information about the libvir-list mailing list