Skip to content
  • Stefan Hajnoczi's avatar
    3f009716
    trace: update qemu-trace-stap to Python 3 · 3f009716
    Stefan Hajnoczi authored
    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 str
    
    Now 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.
    
    Fixes: 62dd1048 ("trace: add ability to do simple printf logging via systemtap")
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1787395
    
    
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    Message-id: 20200107112438.383958-1-stefanha@redhat.com
    Message-Id: <20200107112438.383958-1-stefanha@redhat.com>
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    3f009716
    trace: update qemu-trace-stap to Python 3
    Stefan Hajnoczi authored
    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 str
    
    Now 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.
    
    Fixes: 62dd1048 ("trace: add ability to do simple printf logging via systemtap")
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1787395
    
    
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    Message-id: 20200107112438.383958-1-stefanha@redhat.com
    Message-Id: <20200107112438.383958-1-stefanha@redhat.com>
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Loading