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 get_threads_blocked_on_mutex(mtx): sq = gdb.parse_and_eval("sleepq_lookup((void *)%d)" % mtx.address) return map(lambda n: n.string(), tailq.collect_values(sq['sq_blocked'], 'td_name'))
def get_all_threads(): tdq = gdb.parse_and_eval('all_threads') return tailq.collect_values(tdq, 'td_all')
def get_threads_blocked_on_mutex(mtx): ts = mtx['turnstile'] return map(lambda t: t['td_name'].string(), tailq.collect_values(ts['td_queue'], 'td_lock'))
def get_all_segments(self): segq = gdb.parse_and_eval('seglist') return tailq.collect_values(segq, 'segq')
def dump_segment_freeq(self, idx, freeq, size): pages = tailq.collect_values(freeq, 'freeq') return [[idx, size, as_hex(page['paddr']), as_hex(page['vaddr'])] for page in pages]