MCPcopy Create free account
hub / github.com/apache/brpc / bthread_list

Function bthread_list

tools/lldb_bthread_stack.py:206–219  ·  view source on GitHub ↗

r"""list all bthreads, print format is 'id\ttid\tfunction\thas stack

(debugger, command, result, internal_dict)

Source from the content-addressed store, hash-verified

204
205
206def bthread_list(debugger, command, result, internal_dict):
207 r"""list all bthreads, print format is 'id\ttid\tfunction\thas stack'"""
208 if not global_state.started:
209 print("Not in bthread debug mode")
210 return
211
212 print("id\t\ttid\t\tfunction\t\t\t\thas stack\t\t\ttotal:{}".format(
213 len(global_state.bthreads)))
214 for i, t in enumerate(global_state.bthreads):
215 tid = get_child(t, "tid").GetValueAsUnsigned()
216 fn = get_child(t, "fn")
217 has_stack = get_child(t, "stack").GetLocation() == "0x0"
218 print("#{}\t\t{}\t\t{}\t\t{}".format(
219 i, tid, fn, "no" if has_stack else "yes"))
220
221
222def bthread_num(debugger, command, result, internal_dict):

Callers

nothing calls this directly

Calls 2

get_childFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected