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)
def dump_entrylo(self, vpn, lo): if not is_valid(lo): return "-" vpn = as_hex(vpn) ppn = as_hex(ppn_of(lo)) dirty = '-D'[is_dirty(lo)] globl = '-G'[is_global(lo)] return "%s => %s %c%c" % (vpn, ppn, dirty, globl)
def dump_segment_freeq(self, idx, freeq, size): pages = tailq.collect_values(freeq, 'freeq') return [[ str(idx), str(size), as_hex(page['paddr']), as_hex(page['vaddr']) ] for page in pages]
def dump_segment_freeq(self, idx, freeq, size): pages = TailQueue(freeq, 'freeq') return [[ str(idx), str(size), as_hex(page['paddr']), as_hex(page['vaddr']) ] for page in pages]
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)
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')
def dump_segment_freeq(self, idx, freeq, size): pages = TailQueue(freeq, 'freeq') return [[str(idx), str(size), as_hex(page['paddr']), as_hex(page['vaddr'])] for page in pages]
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')