ia64/xen-unstable

changeset 19346:3e98bc2b6911

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>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Mar 12 15:07:20 2009 +0000 (2009-03-12)
parents a55a98b36a2a
children c9a35fb19e75
files tools/xentrace/xentrace_format
line diff
     1.1 --- a/tools/xentrace/xentrace_format	Thu Mar 12 11:33:35 2009 +0000
     1.2 +++ b/tools/xentrace/xentrace_format	Thu Mar 12 15:07:20 2009 +0000
     1.3 @@ -81,7 +81,11 @@ signal.signal(signal.SIGINT,  sighand)
     1.4  
     1.5  interrupted = 0
     1.6  
     1.7 -defs = read_defs(arg[0])
     1.8 +try:
     1.9 +    defs = read_defs(arg[0])
    1.10 +except IOError, exn:
    1.11 +    print exn
    1.12 +    sys.exit(1)
    1.13  
    1.14  # structure of trace record (as output by xentrace):
    1.15  # HDR(I) {TSC(Q)} D1(I) D2(I) D3(I) D4(I) D5(I) D6(I) D7(I)