'Convert status to string array.
:param pids: List of PIDs you intend to control. Use pids=[] to control
all defined PIDs.
:return: String format to table.'

def get_cpu_status_string(self, pids=[]):

    if (pids == []):
        pids = self.pids
    headers = ['NAME', ('%7s' % 'PID'), ('%5s' % 'USER'), ('%5s' % 'SYS'), ('%5s' % 'SUM')]
    if self.advanced:
        headers.extend(['MINFLT/IRQC', 'MAJFLT/SOFTIRQ'])
    headers.append(('%11s' % 'TIME'))
    textstatus = []
    for pid in pids:
        stat = self.stats[pid][1].get_status()
        time = stat[1]
        stat = stat[0]
        textstatus.append([('%s' % self.stats[pid][0]), ('%7s' % pid), ('%4.0f%%' % (stat[0] / time)), ('%4.0f%%' % (stat[1] / time)), ('%4.0f%%' % ((stat[0] + stat[1]) / time)), ('%10.3fs' % time)])
        if self.advanced:
            textstatus[(-1)].insert((-1), ('%11d' % stat[2]))
            textstatus[(-1)].insert((-1), ('%14d' % stat[3]))
    return matrix_to_string(textstatus, tuple(headers))
