summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Emil Jahren2018-01-29 05:16:47 +0100
committerStefan Hajnoczi2018-02-19 14:09:44 +0100
commitfb1a66bc01b6f7376b452a313538a472451a0ba4 (patch)
treee1d5d26bc0e65cffc9ea1f74d6720d1d4d810cd5
parentMerge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20180216' into s... (diff)
downloadqemu-fb1a66bc01b6f7376b452a313538a472451a0ba4.tar.gz
qemu-fb1a66bc01b6f7376b452a313538a472451a0ba4.tar.xz
qemu-fb1a66bc01b6f7376b452a313538a472451a0ba4.zip
tracetool: Update argument format regex to non-greedy star
Using the greedy star matching, arguments like "...%"PRIx64 caused issues for functions with multiple PRI formats. The issue was only seen with the ust backend, as it is the only one using the format regex. The result for many functions was that the arguments coming after the greedy star end was left out of the tracepoint, and in some cases some of the arguments that was traced had the wrong format. Signed-off-by: Jon Emil Jahren <jonemilj@gmail.com> Message-id: 20180129041648.30884-2-jonemilj@gmail.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--scripts/tracetool/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 1a9733da9a..3646c2b9fc 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -261,8 +261,9 @@ class Event(object):
self.name,
self.args,
fmt)
-
- _FMT = re.compile("(%[\d\.]*\w+|%.*PRI\S+)")
+ # Star matching on PRI is dangerous as one might have multiple
+ # arguments with that format, hence the non-greedy version of it.
+ _FMT = re.compile("(%[\d\.]*\w+|%.*?PRI\S+)")
def formats(self):
"""List conversion specifiers in the argument print format string."""