Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
client.profilers: Make params to accept arbitrary args
Browse files Browse the repository at this point in the history
Make all client profilers to accept arbitrary args keyword
dict in addition to existing params. This way we can
generically add parameters to the cartesian config file
and make them being correctly passed to any profiler.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
  • Loading branch information
Yunping Zheng authored and lmr committed Nov 2, 2012
1 parent 7bb32c6 commit 982ca30
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion client/profilers/catprofile/catprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class catprofile(profiler.profiler):

# filenames: list of filenames to cat
def initialize(self, filenames = ['/proc/meminfo', '/proc/slabinfo'],
outfile = 'monitor', interval = 1):
outfile = 'monitor', interval = 1, **dargs):
self.filenames = filenames
self.outfile = outfile
self.interval = interval
Expand Down
2 changes: 1 addition & 1 deletion client/profilers/cmdprofile/cmdprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class cmdprofile(profiler.profiler):


def initialize(self, cmds=['ps'], interval=60, outputfile='cmdprofile',
outputfiles=None):
outputfiles=None, **dargs):

# do some basic sanity checking on the parameters
if not outputfiles and not outputfile:
Expand Down
2 changes: 1 addition & 1 deletion client/profilers/cpistat/cpistat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class cpistat(profiler.profiler):
version = 1

def initialize(self, interval = 1):
def initialize(self, interval = 1, **dargs):
self.interval = interval


Expand Down
2 changes: 1 addition & 1 deletion client/profilers/iostat/iostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class iostat(profiler.profiler):
version = 2

def initialize(self, interval = 1, options = ''):
def initialize(self, interval = 1, options = '', **dargs):
# Usage: iostat [ options... ] [ <interval> [ <count> ] ]
# e.g, iostat -tmx 2
self.interval = interval
Expand Down
2 changes: 1 addition & 1 deletion client/profilers/kvm_modload/kvm_modload.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class kvm_modload(profiler.profiler):
version = 4


def initialize(self, interval=None, options=None):
def initialize(self, interval=None, options=None, **dargs):
pass


Expand Down
2 changes: 1 addition & 1 deletion client/profilers/kvm_stat/kvm_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class kvm_stat(profiler.profiler):
test execution, redirecting its output to a file on the profile dir.
"""
version = 1
def initialize(self):
def initialize(self, **dargs):
"""
Gets path of kvm_stat and verifies if debugfs needs to be mounted.
"""
Expand Down
2 changes: 1 addition & 1 deletion client/profilers/lockmeter/lockmeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def setup(self, tarball = 'lockstat-1.4.11.tar.bz2'):
self.cmd = self.srcdir + '/lockstat'


def initialize(self):
def initialize(self, **dargs):
self.job.require_gcc()

if not os.path.exists('/proc/lockmeter'):
Expand Down
2 changes: 1 addition & 1 deletion client/profilers/mpstat/mpstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class mpstat(profiler.profiler):
version = 1


def initialize(self, interval = 1):
def initialize(self, interval = 1, **dargs):
self.interval = interval


Expand Down
2 changes: 1 addition & 1 deletion client/profilers/oprofile/oprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _pick_binaries(self, after_setup):
self._setup_oprofile()


def initialize(self, vmlinux=None, events=[], others=None, local=None):
def initialize(self, vmlinux=None, events=[], others=None, local=None, **dargs):
self.job.require_gcc()

if not vmlinux:
Expand Down
2 changes: 1 addition & 1 deletion client/profilers/perf/perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class perf(profiler.profiler):
version = 1

def initialize(self, events=["cycles","instructions"], trace=False):
def initialize(self, events=["cycles","instructions"], trace=False, **dargs):
if type(events) == str:
self.events = [events]
else:
Expand Down
2 changes: 1 addition & 1 deletion client/profilers/readprofile/readprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def setup(self, tarball = 'util-linux-2.12r.tar.bz2'):
utils.make('readprofile')


def initialize(self):
def initialize(self, **dargs):
self.job.require_gcc()

try:
Expand Down
2 changes: 1 addition & 1 deletion client/profilers/sar/sar.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class sar(profiler.profiler):
"""
version = 1

def initialize(self, interval=1):
def initialize(self, interval=1, **dargs):
"""
Set sar interval and verify what flags the installed sar supports.
Expand Down
2 changes: 1 addition & 1 deletion client/profilers/vmstat/vmstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class vmstat(profiler.profiler):
version = 1

def initialize(self, interval = 1):
def initialize(self, interval = 1, **dargs):
self.interval = interval


Expand Down

0 comments on commit 982ca30

Please sign in to comment.