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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ...
> > > 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 :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]