MCPcopy Create free account
hub / github.com/iovisor/bcc / _stack_to_string

Method _stack_to_string

tools/trace.py:557–570  ·  view source on GitHub ↗
(self, bpf, stack_id, tgid)

Source from the content-addressed store, hash-verified

555 return self.tp_event
556
557 def _stack_to_string(self, bpf, stack_id, tgid):
558 if stack_id < 0:
559 return (" %d" % stack_id)
560
561 stackstr = ''
562 stack = list(bpf.get_table(self.stacks_name).walk(stack_id))
563 for addr in stack:
564 stackstr += ' '
565 if Probe.print_address:
566 stackstr += ("%16x " % addr)
567 symstr = bpf.sym(addr, tgid, show_module=True, show_offset=True)
568 stackstr += ('%s\n' % (symstr.decode('utf-8')))
569
570 return stackstr
571
572 def _format_message(self, bpf, tgid, values):
573 # Replace each %K with kernel sym and %U with user sym in tgid

Callers 1

print_eventMethod · 0.95

Calls 5

listFunction · 0.85
walkMethod · 0.80
symMethod · 0.80
decodeMethod · 0.80
get_tableMethod · 0.45

Tested by

no test coverage detected