Пример #1
0
 def dump_list(threads):
     rows = [['Id', 'Name', 'State', 'Waiting Point']]
     curr_tid = Thread.current().td_tid
     rows.extend([['', '(*) '][curr_tid == td.td_tid] + str(td.td_tid),
                  td.td_name, str(td.td_state), str(td.td_waitpt)]
                 for td in threads)
     ptable.ptable(rows, fmt='rlll', header=True)
Пример #2
0
 def dump_segments(self):
     segments = self.get_all_segments()
     rows = [['Segment', 'Start', 'End', 'Pages no']]
     for idx, seg in enumerate(segments):
         rows.append([str(idx), as_hex(seg['start']), as_hex(seg['end']),
                      str(seg['npages'])])
     ptable(rows, header=True)
Пример #3
0
 def dump_segments(self):
     segments = self.get_all_segments()
     rows = [['Segment', 'Start', 'End', 'Pages no']]
     for idx, seg in enumerate(segments):
         rows.append([idx, as_hex(seg['start']), as_hex(seg['end']),
                      seg['npages']])
     ptable(rows, header=True)
Пример #4
0
 def dump_messages(self, klog):
     rows = [['Time', 'Source', 'System', 'Message']]
     for entry in klog:
         rows.append(["%.6f" % entry.timestamp.as_float(),
                      "%s:%d" % (entry.source, entry.line),
                      entry.origin, entry.format_msg()])
     ptable(rows, header=True, fmt='rrrl')
Пример #5
0
 def dump_messages(self, klog):
     rows = [['Time', 'Id', 'Source', 'System', 'Message']]
     for entry in klog:
         rows.append(["%.6f" % entry.timestamp.as_float(), str(entry.tid),
                      "%s:%d" % (entry.source, entry.line),
                      entry.origin, entry.format_msg()])
     ptable(rows, header=True, fmt='rrrrl')
Пример #6
0
def dump_threads(threads):
    extractors = [thread_id, thread_name, thread_state]
    rows = [['Id', 'Name', 'State']]
    column_sizes = [0, 0, 0]
    for thread in threads:
        row = [f(thread) for f in extractors]
        rows.append(row)
    ptable.ptable(rows, fmt="llll", header=True)
Пример #7
0
 def invoke(self):
     rows = [["Index", "ASID", "PFN0", "PFN1"]]
     for idx in range(TLB.size()):
         row = TLB.read(idx).dump()
         if row is None:
             continue
         rows.append([str(idx)] + row)
     ptable(rows, fmt="rrll", header=True)
Пример #8
0
 def dump_list(threads):
     rows = [['Id', 'Name', 'State', 'Waiting Point']]
     curr_tid = Thread.current().td_tid
     rows.extend([['', '(*) '][curr_tid == td.td_tid] +
                  str(td.td_tid), td.td_name,
                  str(td.td_state),
                  str(td.td_waitpt)] for td in threads)
     ptable.ptable(rows, fmt='rlll', header=True)
Пример #9
0
 def invoke(self):
     rows = [["Index", "ASID", "PFN0", "PFN1"]]
     for idx in range(TLB.size()):
         row = TLB.read(idx).dump()
         if row is None:
             continue
         rows.append([str(idx)] + row)
     ptable(rows, fmt="rrll", header=True)
Пример #10
0
 def dump_tlb(self):
     tlb_size = self.get_tlb_size()
     rows = [["Index", "ASID", "PFN0", "PFN1"]]
     for idx in range(tlb_size):
         entry = self.get_tlb_entry(idx)
         hi, lo0, lo1 = entry['hi'], entry['lo0'], entry['lo1']
         row = self.dump_tlb_index(idx, hi, lo0, lo1)
         if not row:
             continue
         rows.append(row)
     ptable(rows, fmt="rrll", header=True)
Пример #11
0
 def dump_tlb(self):
     tlb_size = self.get_tlb_size()
     rows = [["Index", "ASID", "PFN0", "PFN1"]]
     for idx in range(tlb_size):
         entry = self.get_tlb_entry(idx)
         hi, lo0, lo1 = entry['hi'], entry['lo0'], entry['lo1']
         row = self.dump_tlb_index(idx, hi, lo0, lo1)
         if not row:
             continue
         rows.append(row)
     ptable(rows, fmt="rrll", header=True)
Пример #12
0
 def dump(self):
     rows = [[name, str(val)] for name, val in self.regs.items()]
     ptable.ptable(rows, fmt='lr')
Пример #13
0
 def dump_info(self, klog):
     rows = [['Mask', as_hex(klog.mask)],
             ['Verbose', str(klog.verbose)],
             ['Messages', str(len(klog))]]
     ptable(rows, header=False, fmt='rl')
Пример #14
0
 def dump_free_pages(self):
     segments = self.get_all_segments()
     rows = [['Segment', 'Page size', 'Physical', 'Virtual']]
     for idx, seg in enumerate(segments):
         rows.extend(self.dump_segment_free_pages(idx, seg))
     ptable(rows, header=True)
Пример #15
0
 def dump(self):
     rows = [[name, str(val)] for name, val in self.regs.items()]
     ptable.ptable(rows, fmt='lr')
Пример #16
0
 def dump_info(self, klog):
     rows = [['Mask', as_hex(klog.mask)],
             ['Verbose', str(klog.verbose)],
             ['Messages', str(len(klog))]]
     ptable(rows, header=False, fmt='rl')
Пример #17
0
 def dump_kernel_logs(self, messages):
     rows_data = [["Time", "Line", "File", "Origin", "Message"]]
     rows_data.extend(messages)
     ptable(rows_data, header=True, fmt='ccrcl')
Пример #18
0
 def dump_general_info(self, number_of_logs, klog):
     rows_general = [["Mask", "Verbose", "Log number"]]
     mask = as_hex(klog['mask'])
     verbose = bool(klog['verbose'])
     rows_general.append([mask, str(verbose), str(number_of_logs)])
     ptable(rows_general, header=True, fmt='l')
Пример #19
0
 def dump_free_pages(self):
     segments = self.get_all_segments()
     rows = [['Segment', 'Page size', 'Physical', 'Virtual']]
     for idx, seg in enumerate(segments):
         rows.extend(self.dump_segment_free_pages(idx, seg))
     ptable(rows, header=True)