diff options
| author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-02-06 07:03:22 +0300 |
|---|---|---|
| committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-02-06 17:35:42 +0300 |
| commit | d7f356380241ad5d34756eb551fffcf351ac969b (patch) | |
| tree | 71b7fa8565fafdcc0c4330adfdf420d2bb8f2bf9 | |
| parent | 9ee963d6a1a03a4302b230cd21476a3c269af284 (diff) | |
| download | linux-d7f356380241ad5d34756eb551fffcf351ac969b.tar.xz | |
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: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
| -rwxr-xr-x | tools/testing/selftests/bpf/test_offload.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_offload.py b/tools/testing/selftests/bpf/test_offload.py index a564d1a5a1b8..c379b36a5443 100755 --- a/tools/testing/selftests/bpf/test_offload.py +++ b/tools/testing/selftests/bpf/test_offload.py @@ -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): |
