Tracing patches
The following changes since commit dc65a5bdc9fa543690a775b50d4ffbeb22c56d6d:
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.0-20200108' into staging (2020-01-10 16:15:04 +0000)
are available in the Git repository at:
https://github.com/stefanha/qemu.git tags/tracing-pull-request
for you to fetch changes up to 3f0097169bb60268cc5dda0c5ea47c31ab57b22f:
trace: update qemu-trace-stap to Python 3 (2020-01-13 16:42:20 +0000)
----------------------------------------------------------------
Pull request
----------------------------------------------------------------
Stefan Hajnoczi (1):
trace: update qemu-trace-stap to Python 3
scripts/qemu-trace-stap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.24.1
[PULL 1/1] trace: update qemu-trace-stap to Python 3
qemu-trace-stap does not support Python 3 yet:
$ scripts/qemu-trace-stap list path/to/qemu-system-x86_64
Traceback (most recent call last):
File "scripts/qemu-trace-stap", line 175, in <module>
main()
File "scripts/qemu-trace-stap", line 171, in main
args.func(args)
File "scripts/qemu-trace-stap", line 118, in cmd_list
print_probes(args.verbose, "*")
File "scripts/qemu-trace-stap", line 114, in print_probes
if line.startswith(prefix):
TypeError: startswith first arg must be bytes or a tuple of bytes, not strNow that QEMU requires Python 3.5 or later we can switch to pure Python
3. Use Popen()'s universal_newlines=True argument to treat stdout as text instead of binary.
Message-id: [email protected]
Message-Id: <[email protected]>
--- scripts/qemu-trace-stap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
scripts/qemu-trace-stap +4 -4
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # -*- python -*- # # Copyright (C) 2019 Red Hat, Inc
@@ -18,8 +18,6 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, see <http://www.gnu.org/licenses/>. -from __future__ import print_function - import argparse import copy import os.path
@@ -104,7 +102,9 @@ def cmd_list(args): if verbose: print("Listing probes with name '%s'" % script) proc = subprocess.Popen(["stap", "-l", script], - stdout=subprocess.PIPE, env=tapset_env(tapsets)) + stdout=subprocess.PIPE, + universal_newlines=True, + env=tapset_env(tapsets)) out, err = proc.communicate() if proc.returncode != 0: print("No probes found, are the tapsets installed in %s" % tapset_dir(args.binary))
Signature · 1 line
2.24.1
Re: [PULL 1/1] trace: update qemu-trace-stap to Python 3
Quoted 18 lines · Stefan Hajnoczi
qemu-trace-stap does not support Python 3 yet:
$ scripts/qemu-trace-stap list path/to/qemu-system-x86_64 Traceback (most recent call last): File "scripts/qemu-trace-stap", line 175, in <module> main() File "scripts/qemu-trace-stap", line 171, in main args.func(args) File "scripts/qemu-trace-stap", line 118, in cmd_list print_probes(args.verbose, "*") File "scripts/qemu-trace-stap", line 114, in print_probes if line.startswith(prefix): TypeError: startswith first arg must be bytes or a tuple of bytes, not strNow that QEMU requires Python 3.5 or later we can switch to pure Python
3. Use Popen()'s universal_newlines=True argument to treat stdout as text instead of binary.
Quoted 6 lines
Fixes 62dd1048c0bd ("trace: add ability to do simple printf logging via systemtap")Signed-off-by Stefan Hajnoczi <[email protected]>Reviewed-by Daniel P. Berrangé <[email protected]>Message-id: [email protected]
Message-Id: <[email protected]>
One Message-Id is enough ;)
Quoted 36 lines
Signed-off-by Stefan Hajnoczi <[email protected]>--- scripts/qemu-trace-stap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)scripts/qemu-trace-stap +4
-4@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # -*- python -*- # # Copyright (C) 2019 Red Hat, Inc@@ -18,8 +18,6 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, see <http://www.gnu.org/licenses/>. -from __future__ import print_function - import argparse import copy import os.path@@ -104,7 +102,9 @@ def cmd_list(args): if verbose: print("Listing probes with name '%s'" % script) proc = subprocess.Popen(["stap", "-l", script], - stdout=subprocess.PIPE, env=tapset_env(tapsets)) + stdout=subprocess.PIPE, + universal_newlines=True, + env=tapset_env(tapsets)) out, err = proc.communicate() if proc.returncode != 0: print("No probes found, are the tapsets installed in %s" % tapset_dir(args.binary))
Peter Maydell
AppliedQuoted 9 lines · Stefan Hajnoczi
The following changes since commit
dc65a5bdc9fa543690a775b50d4ffbeb22c56d6d:Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.0-20200108' into staging (2020-01-10 16:15:04 +0000)
are available in the Git repository at:
https://github.com/stefanha/qemu.git tags/tracing-pull-request
Quoted 8 lines
for you to fetch changes up to
3f0097169bb60268cc5dda0c5ea47c31ab57b22f:trace: update qemu-trace-stap to Python 3 (2020-01-13 16:42:20 +0000)
----------------------------------------------------------------
Pull request----------------------------------------------------------------
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/5.0
for any user-visible changes.
-- PMM