Пример #1
0
    def __init__(self, name, config, logger=None):

        if name is None or not isinstance(name, str):
            raise TypeError("name attribute is not a string")

        if config and not isinstance(config, rtevalCfgSection):
            raise TypeError("config attribute is not a rtevalCfgSection() object")

        if logger and not isinstance(logger, Log):
            raise TypeError("logger attribute is not a Log() object")

        rtevalModulePrototype.__init__(self, "load", name, logger)
        self.builddir = config.setdefault('builddir', os.path.abspath("../build"))	# abs path to top dir
        self.srcdir = config.setdefault('srcdir', os.path.abspath("../loadsource"))	# abs path to src dir
        self.num_cpus = config.setdefault('numcores', 1)
        self.source = config.setdefault('source', None)
        self.reportdir = config.setdefault('reportdir', os.getcwd())
        self.memsize = config.setdefault('memsize', (0, 'GB'))
        self._logging = config.setdefault('logging', True)
        self._cfg = config
        self.mydir = None
        self.jobs = 0
        self.args = None

        if not os.path.exists(self.builddir):
            os.makedirs(self.builddir)
Пример #2
0
    def __init__(self, config, logger=None):
        rtevalModulePrototype.__init__(self, 'measurement', 'cyclictest', logger)
        self.__cfg = config

        # Create a RunData object per CPU core
        f = open('/proc/cpuinfo')
        self.__numanodes = int(self.__cfg.setdefault('numanodes', 0))
        self.__priority = int(self.__cfg.setdefault('priority', 95))
        self.__buckets = int(self.__cfg.setdefault('buckets', 2000))
        self.__numcores = 0
        self.__cyclicdata = {}
        for line in f:
            if line.startswith('processor'):
                core = line.split()[-1]
                self.__cyclicdata[core] = RunData(core, 'core',self.__priority,
                                                  logfnc=self._log)
                self.__numcores += 1
            if line.startswith('model name'):
                desc = line.split(': ')[-1][:-1]
                self.__cyclicdata[core].description = ' '.join(desc.split())
        f.close()

        # Create a RunData object for the overall system
        self.__cyclicdata['system'] = RunData('system', 'system', self.__priority,
                                              logfnc=self._log)
        self.__cyclicdata['system'].description = ("(%d cores) " % self.__numcores) + self.__cyclicdata['0'].description
        self._log(Log.DEBUG, "system has %d cpu cores" % self.__numcores)
        self.__started = False
        self.__cyclicoutput = None
        self.__breaktraceval = None
Пример #3
0
    def __init__(self, config, logger=None):
        rtevalModulePrototype.__init__(self, 'measurement', 'hwlatdetect', logger)

        self.__cfg = config
        self.__hwlat = None
        self.__exceeding = None
        self.__samples = []
Пример #4
0
    def __init__(self, name, config, logger=None):

        if name is None or not isinstance(name, str):
            raise TypeError("name attribute is not a string")

        if config and not isinstance(config, rtevalCfgSection):
            raise TypeError(
                "config attribute is not a rtevalCfgSection() object")

        if logger and not isinstance(logger, Log):
            raise TypeError("logger attribute is not a Log() object")

        rtevalModulePrototype.__init__(self, "load", name, logger)
        self.builddir = config.setdefault(
            'builddir', os.path.abspath("../build"))  # abs path to top dir
        self.srcdir = config.setdefault(
            'srcdir', os.path.abspath("../loadsource"))  # abs path to src dir
        self.num_cpus = config.setdefault('numcores', 1)
        self.source = config.setdefault('source', None)
        self.reportdir = config.setdefault('reportdir', os.getcwd())
        self.memsize = config.setdefault('memsize', (0, 'GB'))
        self._logging = config.setdefault('logging', True)
        self._cfg = config
        self.mydir = None
        self.jobs = 0
        self.args = None

        if not os.path.exists(self.builddir):
            os.makedirs(self.builddir)
Пример #5
0
 def __init__(self, config, logger=None):
     rtevalModulePrototype.__init__(self, 'measurement', 'sysstat', logger)
     self.__cfg = config
     self.__started = False
     self.__logentry = 0
     self.__bin_sadc = "/usr/lib64/sa/sadc"  # FIXME: Do dynamically
     self.__datadir = os.path.join(self.__cfg.reportdir, 'sysstat')
     self.__datafile = os.path.join(self.__datadir, "sysstat.dat")
Пример #6
0
 def __init__(self, config, logger=None):
     rtevalModulePrototype.__init__(self, 'measurement', 'sysstat', logger)
     self.__cfg      = config
     self.__started  = False
     self.__logentry = 0
     self.__bin_sadc = "/usr/lib64/sa/sadc" # FIXME: Do dynamically
     self.__datadir  =  os.path.join(self.__cfg.reportdir, 'sysstat')
     self.__datafile = os.path.join(self.__datadir, "sysstat.dat")
Пример #7
0
    def __init__(self, config, logger=None):
        rtevalModulePrototype.__init__(self, 'measurement', 'cyclictest',
                                       logger)
        self.__cfg = config

        # Create a RunData object per CPU core
        self.__numanodes = int(self.__cfg.setdefault('numanodes', 0))
        self.__priority = int(self.__cfg.setdefault('priority', 95))
        self.__buckets = int(self.__cfg.setdefault('buckets', 2000))
        self.__numcores = 0
        self.__cpus = []
        self.__cyclicdata = {}
        self.__sparse = False

        if self.__cfg.cpulist:
            self.__cpulist = self.__cfg.cpulist
            self.__cpus = expand_cpulist(self.__cpulist)
            self.__sparse = True
        else:
            self.__cpus = online_cpus()

        self.__numcores = len(self.__cpus)

        info = cpuinfo()

        # create a RunData object for each core we'll measure
        for core in self.__cpus:
            self.__cyclicdata[core] = RunData(core,
                                              'core',
                                              self.__priority,
                                              logfnc=self._log)
            self.__cyclicdata[core].description = info[core]['model name']

        # Create a RunData object for the overall system
        self.__cyclicdata['system'] = RunData('system',
                                              'system',
                                              self.__priority,
                                              logfnc=self._log)
        self.__cyclicdata['system'].description = (
            "(%d cores) " % self.__numcores) + info['0']['model name']

        if self.__sparse:
            self._log(Log.DEBUG, "system using %d cpu cores" % self.__numcores)
        else:
            self._log(Log.DEBUG, "system has %d cpu cores" % self.__numcores)
        self.__started = False
        self.__cyclicoutput = None
        self.__breaktraceval = None
Пример #8
0
    def __init__(self, config, logger=None):
        rtevalModulePrototype.__init__(self, 'measurement', 'cyclictest',
                                       logger)
        self.__cfg = config

        # Create a RunData object per CPU core
        f = open('/proc/cpuinfo')
        self.__numanodes = int(self.__cfg.setdefault('numanodes', 0))
        self.__priority = int(self.__cfg.setdefault('priority', 95))
        self.__buckets = int(self.__cfg.setdefault('buckets', 2000))
        self.__numcores = 0
        self.__cyclicdata = {}
        for line in f:
            if line.startswith('processor'):
                core = line.split()[-1]
                self.__cyclicdata[core] = RunData(core,
                                                  'core',
                                                  self.__priority,
                                                  logfnc=self._log)
                self.__numcores += 1
            if line.startswith('model name'):
                desc = line.split(': ')[-1][:-1]
                self.__cyclicdata[core].description = ' '.join(desc.split())
        f.close()

        # Create a RunData object for the overall system
        self.__cyclicdata['system'] = RunData('system',
                                              'system',
                                              self.__priority,
                                              logfnc=self._log)
        self.__cyclicdata['system'].description = (
            "(%d cores) " %
            self.__numcores) + self.__cyclicdata['0'].description
        self._log(Log.DEBUG, "system has %d cpu cores" % self.__numcores)
        self.__started = False
        self.__cyclicoutput = None
        self.__breaktraceval = None