diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-06-12 14:51:30 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-06-12 14:51:30 +0100 |
commit | 5093f028ce6529034efc8fdc06cec2aa2e2eea63 (patch) | |
tree | a0352a06f1e305d41bf38c8ef602b000fc75f645 /scripts | |
parent | 2a8469aaabdc86c369bf4aeb77f87de7361f464b (diff) | |
parent | 249e9f792c4c6e52058570e83b550ec8310f621e (diff) |
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
# gpg: Signature made Wed 07 Jun 2017 19:55:32 BST
# gpg: using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8
* remotes/stefanha/tags/tracing-pull-request:
simpletrace: Improve the error message if event is not declared
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts')
-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) |