On Tue, Nov 24, 2015 at 01:44:53PM +0100, Jiri Denemark wrote:
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(a)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.
The virPerfEventEnable code lives in util which is supposed to be
isolated from any conf classes, so passing 'vm' is not appropriate
Regards,
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|