Nir Soffer has posted comments on this change.

Change subject: profiling: Add an application wide profile
......................................................................


Patch Set 9:

(1 comment)

http://gerrit.ovirt.org/#/c/26113/9/lib/vdsm/profile.py
File lib/vdsm/profile.py:

Line 45:         logging.debug("Stopping profiling")
Line 46:         yappi.stop()
Line 47:         stats = yappi.get_func_stats()
Line 48:         path = os.path.join(constants.P_VDSM_RUN, 'vdsmd.prof')
Line 49:         stats.save(path, config.get('vars', 'profile_format'))
> As personal taste, I'd like to see the input sanitized here.
This is done by yappi, and you will get an exception when saving. In this 
example i used this configuration:

  # Profile file format (pstat, callgrind, ystat)
  profile_format = junk

Note the list of valid values in the comment. But I was brave and decided to 
use the "junk" format:

  MainThread::ERROR::2014-05-02 13:09:55,248::vdsm::132::vds::(run) Exception 
raised
  Traceback (most recent call last):
    File "/usr/share/vdsm/vdsm", line 130, in run
      serve_clients(log)
    File "/usr/share/vdsm/vdsm", line 86, in serve_clients
      profile.stop()
    File "/usr/lib64/python2.7/site-packages/vdsm/profile.py", line 49, in stop
      stats.save(path, config.get('vars', 'profile_format'))
    File "/usr/lib64/python2.7/site-packages/yappi.py", line 558, in save
      raise NotImplementedError('Saving in "%s" format is not possible 
currently.' % (type))
  NotImplementedError: Saving in "JUNK" format is not possible currently.

I think this is similar to other configuration values - use bad value and the 
system blows.

Can you elaborate on how to improve this?
Line 50: 
Line 51: 
Line 52: def is_enabled():
Line 53:     return config.getboolean('vars', 'profile_enable')


-- 
To view, visit http://gerrit.ovirt.org/26113
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I523f52c981f7bb34f3168d3117f00ed5eb6962f8
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegu...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizr...@redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to