summary refs log tree commit diff stats
path: root/scripts/tracetool/__init__.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-01-31 12:03:39 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-01-31 12:03:40 +0000
commit460da1005d90beaab09f34a802976c0539d30587 (patch)
tree51eba926c0c49ef37eaca57837ffcbbf54872003 /scripts/tracetool/__init__.py
parent006dce5f8fd298b4be7f1d69961ec1b46630d236 (diff)
parent57b7bdf426445d8356171135308dfe6d7d5fb612 (diff)
downloadfocaccia-qemu-460da1005d90beaab09f34a802976c0539d30587.tar.gz
focaccia-qemu-460da1005d90beaab09f34a802976c0539d30587.zip
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Pull request

User-visible changes:
 * The new qemu-trace-stap script makes it convenient to collect traces without
   writing SystemTap scripts.  See "man qemu-trace-stap" for details.

# gpg: Signature made Wed 30 Jan 2019 03:17:57 GMT
# gpg:                using RSA key 9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/tracing-pull-request:
  trace: rerun tracetool after ./configure changes
  trace: improve runstate tracing
  trace: add ability to do simple printf logging via systemtap
  trace: forbid use of %m in trace event format strings
  trace: enforce that every trace-events file has a final newline
  display: ensure qxl log_buf is a nul terminated string

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/tracetool/__init__.py')
-rw-r--r--scripts/tracetool/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 0e3c9e146c..6fca674936 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -274,6 +274,10 @@ class Event(object):
         props = groups["props"].split()
         fmt = groups["fmt"]
         fmt_trans = groups["fmt_trans"]
+        if fmt.find("%m") != -1 or fmt_trans.find("%m") != -1:
+            raise ValueError("Event format '%m' is forbidden, pass the error "
+                             "as an explicit trace argument")
+
         if len(fmt_trans) > 0:
             fmt = [fmt_trans, fmt]
         args = Arguments.build(groups["args"])
@@ -350,6 +354,8 @@ def read_events(fobj, fname):
 
     events = []
     for lineno, line in enumerate(fobj, 1):
+        if line[-1] != '\n':
+            raise ValueError("%s does not end with a new line" % fname)
         if not line.strip():
             continue
         if line.lstrip().startswith('#'):