projects
/
platform
/
upstream
/
bcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7ab443
)
trace: Exit with nonzero return code on error
author
Sasha Goldshtein
<goldshtn@gmail.com>
Tue, 14 Feb 2017 01:25:32 +0000
(20:25 -0500)
committer
Sasha Goldshtein
<goldshtn@gmail.com>
Sat, 11 Mar 2017 19:41:35 +0000
(19:41 +0000)
tools/trace.py
patch
|
blob
|
history
diff --git
a/tools/trace.py
b/tools/trace.py
index
1c6b339
..
aac60e3
100755
(executable)
--- a/
tools/trace.py
+++ b/
tools/trace.py
@@
-691,10
+691,13
@@
trace 'p::SyS_nanosleep(struct timespec *ts) "sleep for %lld ns", ts->tv_nsec'
self._attach_probes()
self._main_loop()
except:
+ exc_info = sys.exc_info()
+ sys_exit = exc_info[0] is SystemExit
if self.args.verbose:
traceback.print_exc()
- elif sys.exc_info()[0] is not SystemExit:
- print(sys.exc_info()[1])
+ elif not sys_exit:
+ print(exc_info[1])
+ exit(0 if sys_exit else 1)
if __name__ == "__main__":
Tool().run()