提交 d7f35638 编写于 作者: J Jakub Kicinski 提交者: Daniel Borkmann

selftests/bpf: print traceback when test fails

Figuring out which exact check in test_offload.py takes more
time than it should.  Print the traceback (to the screen and
the logs).
Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: NQuentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
上级 9ee963d6
......@@ -23,6 +23,7 @@ import string
import struct
import subprocess
import time
import traceback
logfile = None
log_level = 1
......@@ -78,7 +79,9 @@ def fail(cond, msg):
if not cond:
return
print("FAIL: " + msg)
log("FAIL: " + msg, "", level=1)
tb = "".join(traceback.extract_stack().format())
print(tb)
log("FAIL: " + msg, tb, level=1)
os.sys.exit(1)
def start_test(msg):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册