aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xentrace
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-03-12 15:07:20 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-03-12 15:07:20 +0000
commit677a041f1f521c43ecaba52d1d663785d22d57b7 (patch)
tree67b2f31fa4e8cbed3ce6561c65e5da8e5aa1d194 /tools/xentrace
parent7caeec9358d229ff90fb4aaa617240deca3d63ed (diff)
downloadxen-677a041f1f521c43ecaba52d1d663785d22d57b7.tar.gz
xen-677a041f1f521c43ecaba52d1d663785d22d57b7.tar.bz2
xen-677a041f1f521c43ecaba52d1d663785d22d57b7.zip
xentrace: error handling on non-existent formats file
Attached patch does proper error handling when specified formats file doesn't exist. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'tools/xentrace')
-rw-r--r--tools/xentrace/xentrace_format6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/xentrace/xentrace_format b/tools/xentrace/xentrace_format
index d66cb74578..f0127309ab 100644
--- a/tools/xentrace/xentrace_format
+++ b/tools/xentrace/xentrace_format
@@ -81,7 +81,11 @@ signal.signal(signal.SIGINT, sighand)
interrupted = 0
-defs = read_defs(arg[0])
+try:
+ defs = read_defs(arg[0])
+except IOError, exn:
+ print exn
+ sys.exit(1)
# structure of trace record (as output by xentrace):
# HDR(I) {TSC(Q)} D1(I) D2(I) D3(I) D4(I) D5(I) D6(I) D7(I)