diff options
Diffstat (limited to 'scripts/simpletrace.py')
-rwxr-xr-x | scripts/simpletrace.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py index d60b3a08f7..f1be6e419a 100755 --- a/scripts/simpletrace.py +++ b/scripts/simpletrace.py @@ -42,7 +42,15 @@ def get_record(edict, idtoname, rechdr, fobj): event_id = rechdr[0] name = idtoname[event_id] rec = (name, rechdr[1], rechdr[3]) - event = edict[name] + try: + event = edict[name] + except KeyError, e: + import sys + sys.stderr.write('%s event is logged but is not declared ' \ + 'in the trace events file, try using ' \ + 'trace-events-all instead.\n' % str(e)) + sys.exit(1) + for type, name in event.args: if is_string(type): l = fobj.read(4) |