aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tracetool')
-rw-r--r--scripts/tracetool/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 0670ec1..a744e26 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -300,13 +300,18 @@ def read_events(fobj):
"""
events = []
- for line in fobj:
+ for lineno, line in enumerate(fobj, 1):
if not line.strip():
continue
if line.lstrip().startswith('#'):
continue
- event = Event.build(line)
+ try:
+ event = Event.build(line)
+ except ValueError as e:
+ arg0 = 'Error on line %d: %s' % (lineno, e.args[0])
+ e.args = (arg0,) + e.args[1:]
+ raise
# transform TCG-enabled events
if "tcg" not in event.properties: