':param pids: List of pids to be monitored. If pid = 0 whole system will
be monitored. pid == 0 means whole system.
:param advanced: monitor add value for system irq count and softirq
for process minor and maior page fault
:param time_step: Time step for continuous monitoring.
:param cpu_cont: If True monitor CPU load continuously.
:param use_log: If true every monitoring is logged for dump.'

def __init__(self, pids, advanced=False, time_step=0.1, cpu_cont=False, use_log=False):

    self.pids = []
    self.stats = {}
    for pid in pids:
        if (pid == 0):
            cpu = FileFieldMonitor('/proc/stat', [('cpu', 0), ('cpu', 2), ('intr', 0), ('softirq', 0)], True, cpu_cont, use_log, '    +', time_step)
            mem = FileFieldMonitor('/proc/meminfo', [('MemTotal:', 0), ('MemFree:', 0), ('Buffers:', 0), ('Cached:', 0)], False, True, use_log, '    +', time_step)
            self.stats[pid] = ['TOTAL', cpu, mem]
            self.pids.append(pid)
        else:
            name = ''
            if (type(pid) is int):
                self.pids.append(pid)
                name = get_process_name(pid)
            else:
                self.pids.append(pid[0])
                name = pid[1]
            cpu = FileFieldMonitor(('/proc/%d/stat' % self.pids[(-1)]), [('', 13), ('', 14), ('', 9), ('', 11)], True, cpu_cont, use_log, '    +', time_step)
            mem = FileFieldMonitor(('/proc/%d/status' % self.pids[(-1)]), [('VmSize:', 0), ('VmRSS:', 0), ('VmPeak:', 0), ('VmSwap:', 0)], False, True, use_log, '    +', time_step)
            self.stats[self.pids[(-1)]] = [name, cpu, mem]
    self.advanced = advanced
