'Get mandatory_stats: for all processes.
Needed for the sorting/filter step.
Stats grabbed inside this method:
* \'name\', \'cpu_times\', \'status\', \'ppid\'
* \'username\', \'cpu_percent\', \'memory_percent\''

def __get_mandatory_stats(self, proc, procstat):

    procstat['mandatory_stats'] = True
    try:
        procstat.update(proc.as_dict(attrs=['name', 'cpu_times', 'status', 'ppid'], ad_value=''))
    except psutil.NoSuchProcess:
        return None
    else:
        procstat['status'] = str(procstat['status'])[:1].upper()
    try:
        procstat.update(proc.as_dict(attrs=['username', 'cpu_percent', 'memory_percent'], ad_value=''))
    except psutil.NoSuchProcess:
        return None
    if ((procstat['cpu_percent'] == '') or (procstat['memory_percent'] == '')):
        return None
    for k in self._max_values_list:
        if (procstat[k] > self.get_max_values(k)):
            self.set_max_values(k, procstat[k])
    if (procstat['pid'] not in self.cmdline_cache):
        try:
            self.cmdline_cache[procstat['pid']] = proc.cmdline()
        except (AttributeError, EnvironmentError, UnicodeDecodeError, psutil.AccessDenied, psutil.NoSuchProcess):
            self.cmdline_cache[procstat['pid']] = ''
    procstat['cmdline'] = self.cmdline_cache[procstat['pid']]
    try:
        proc_io = proc.io_counters()
        io_new = [proc_io.read_bytes, proc_io.write_bytes]
    except (psutil.AccessDenied, psutil.NoSuchProcess, NotImplementedError):
        procstat['io_counters'] = ([0, 0] + [0, 0])
        io_tag = 0
    except AttributeError:
        return procstat
    else:
        try:
            procstat['io_counters'] = (io_new + self.io_old[procstat['pid']])
        except KeyError:
            procstat['io_counters'] = (io_new + [0, 0])
        self.io_old[procstat['pid']] = io_new
        io_tag = 1
    procstat['io_counters'] += [io_tag]
    return procstat
