fix: support perf2trace state without stacktraces
This commit is contained in:
parent
842015ba49
commit
1ae25a6890
@ -366,12 +366,12 @@ def perf2trace(input, verbose=1, store_runing=False, store_sleeping=True, all_tr
|
|||||||
# q
|
# q
|
||||||
last_run_time[pid] = time
|
last_run_time[pid] = time
|
||||||
continue
|
continue
|
||||||
recover_from_gil = takes_gil(last_sleep_stacktrace[pid])
|
recover_from_gil = takes_gil(last_sleep_stacktrace[pid]) if last_sleep_stacktrace[pid] else False
|
||||||
duration = time - last_sleep_time[pid]
|
duration = time - last_sleep_time[pid]
|
||||||
if verbose >= 2:
|
if verbose >= 2:
|
||||||
name = pid_names.get(pid, pid)
|
name = pid_names.get(pid, pid)
|
||||||
log(f'Waking up {name}', '(recovering from GIL)' if recover_from_gil else '', f', slept for {duration} msec')
|
log(f'Waking up {name}', '(recovering from GIL)' if recover_from_gil else '', f', slept for {duration} msec')
|
||||||
if verbose >= 3:
|
if verbose >= 3 and last_sleep_stacktrace[pid]:
|
||||||
print("Stack trace when we went to sleep:\n\t", "\t".join(last_sleep_stacktrace[pid]))
|
print("Stack trace when we went to sleep:\n\t", "\t".join(last_sleep_stacktrace[pid]))
|
||||||
if store_sleeping:
|
if store_sleeping:
|
||||||
if recover_from_gil:
|
if recover_from_gil:
|
||||||
|
Loading…
Reference in New Issue
Block a user