提交 f9ca75c6 authored 作者: Frederic Bastien's avatar Frederic Bastien

Better backtrace storage.

Raise the backtrace limit to caught where v1 + v2 is created in user script. Remove the add_tag_trace from the bt.
上级 bb611ee2
...@@ -259,7 +259,9 @@ AddConfigVar('gpuelemwise.sync', ...@@ -259,7 +259,9 @@ AddConfigVar('gpuelemwise.sync',
AddConfigVar('traceback.limit', AddConfigVar('traceback.limit',
"The number of stack to trace. -1 mean all.", "The number of stack to trace. -1 mean all.",
IntParam(5), # We default to 6 to be able to know where v1 + v2 is created in the
# user script. The bigger this number is, the more run time it takes.
IntParam(6),
in_c_key=False) in_c_key=False)
AddConfigVar('experimental.mrg', AddConfigVar('experimental.mrg',
......
...@@ -12,7 +12,13 @@ def add_tag_trace(thing): ...@@ -12,7 +12,13 @@ def add_tag_trace(thing):
limit = config.traceback.limit limit = config.traceback.limit
if limit == -1: if limit == -1:
limit = None limit = None
thing.tag.trace = traceback.extract_stack(limit=limit)[:-1] tr = traceback.extract_stack(limit=limit)[:-1]
# Different python version use different sementic for
# limit. python 2.7 include the call to extrack_stack. The -1 get
# rid of it. We also want to get rid of the add_tag_trace call.
if tr and "add_tag_trace" in tr[-1][-1]:
tr = tr[:-1]
thing.tag.trace = tr
return thing return thing
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论