コード例 #1
0
ファイル: systeminfo.py プロジェクト: FArian/tbf
 def _read_swap_count(self):
     try:
         return dict((k, int(v)) for k, v
                                 in util.read_key_value_pairs_from_file('/proc/vmstat')
                                 if k in ['pswpin', 'pswpout'])
     except Exception as e:
         logging.warning('Cannot read swap count from kernel: %s', e)
コード例 #2
0
 def _read_swap_count(self):
     try:
         return dict(
             (k, int(v))
             for k, v in util.read_key_value_pairs_from_file('/proc/vmstat')
             if k in ['pswpin', 'pswpout'])
     except Exception as e:
         logging.warning('Cannot read swap count from kernel: %s', e)
コード例 #3
0
ファイル: systeminfo.py プロジェクト: lachnerm/benchexec
 def _read_swap_count(self):
     try:
         return {
             k: int(v)
             for k, v in util.read_key_value_pairs_from_file("/proc/vmstat")
             if k in ["pswpin", "pswpout"]
         }
     except Exception as e:
         logging.warning("Cannot read swap count from kernel: %s", e)
コード例 #4
0
ファイル: cgroups.py プロジェクト: seahorn/benchexec
 def get_key_value_pairs(self, subsystem, filename):
     """
     Read the lines of the given file from the given subsystem
     and split the lines into key-value pairs.
     Do not include the subsystem name in the option name.
     Only call this method if the given subsystem is available.
     """
     assert subsystem in self
     return util.read_key_value_pairs_from_file(self.per_subsystem[subsystem], subsystem + '.' + filename)