]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
tools/kvm_stat: simplify initializers
authorStefan Raspl <raspl@linux.vnet.ibm.com>
Wed, 7 Jun 2017 19:08:32 +0000 (21:08 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 8 Jun 2017 16:15:45 +0000 (18:15 +0200)
commitc469117df05955901d2950b6130770e526b1dbf4
tree808cfa9cf15255ef4f3b0f9c454ed727a88c8e01
parent5e3823a49c50d70cc6b92808c262a43cf3505f3c
tools/kvm_stat: simplify initializers

Simplify a couple of initialization routines:
* TracepointProvider and DebugfsProvider: Pass pid into __init__() instead
  of switching to the requested value in an extra call after initializing
  to the default first.
* Pass a single options object into Stats.__init__(), delaying options
  evaluation accordingly, instead of evaluating options first and passing
  several parts of the options object to Stats.__init__() individually.
* Eliminate Stats.update_provider_pid(), since this 2-line function is now
  used in a single place only.
* Remove extra call to update_drilldown() in Tui.__init__() by getting the
  value of options.fields right initially when parsing options.
* Simplify get_providers() logic.
* Avoid duplicate fields initialization by handling it once in the
  providers' __init__() methods.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/kvm/kvm_stat/kvm_stat