Bug 1787395 - qemu-trace-stap list : TypeError: startswith first arg must be bytes or a tuple of bytes, not str
Summary: qemu-trace-stap list : TypeError: startswith first arg must be bytes or a tup...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Stefan Hajnoczi
QA Contact: FuXiangChun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-02 16:58 UTC by Dr. David Alan Gilbert
Modified: 2020-12-20 06:35 UTC (History)
3 users (show)

Fixed In Version: qemu-kvm-4.2.0-9.module+el8.2.0+5699+b5331ee5
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-05 09:52:22 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dr. David Alan Gilbert 2020-01-02 16:58:07 UTC
Description of problem:
[root@virtlab413 ~]# /usr/bin/qemu-trace-stap list /usr/libexec/qemu-kvm 
Traceback (most recent call last):
  File "/usr/bin/qemu-trace-stap", line 175, in <module>
    main()
  File "/usr/bin/qemu-trace-stap", line 171, in main
    args.func(args)
  File "/usr/bin/qemu-trace-stap", line 118, in cmd_list
    print_probes(args.verbose, "*")
  File "/usr/bin/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


Version-Release number of selected component (if applicable):
qemu-kvm-core-4.2.0-4.el8.bz1772774a.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Stefan Hajnoczi 2020-01-02 17:00:18 UTC
Needs Python 3 compatibility.

Comment 3 FuXiangChun 2020-01-06 09:17:31 UTC
Reproduced this bug with qemu-kvm-core-4.2.0-4.module+el8.2.0+5220+e82621dc.x86_64

# /usr/bin/qemu-trace-stap list /usr/libexec/qemu-kvm 
Traceback (most recent call last):
  File "/usr/bin/qemu-trace-stap", line 175, in <module>
    main()
  File "/usr/bin/qemu-trace-stap", line 171, in main
    args.func(args)
  File "/usr/bin/qemu-trace-stap", line 118, in cmd_list
    print_probes(args.verbose, "*")
  File "/usr/bin/qemu-trace-stap", line 107, in print_probes
    stdout=subprocess.PIPE, env=tapset_env(tapsets))
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'stap': 'stap'

# /usr/bin/qemu-trace-stap -v
usage: qemu-trace-stap [-h] [-v] {run,list} ...
qemu-trace-stap: error: the following arguments are required: command

Comment 4 Stefan Hajnoczi 2020-01-07 11:34:16 UTC
Patch sent upstream:
https://lists.gnu.org/archive/html/qemu-devel/2020-01/msg00850.html

Comment 7 Ademar Reis 2020-02-05 23:11:46 UTC
QEMU has been recently split into sub-components and as a one-time operation to avoid breakage of tools, we are setting the QEMU sub-component of this BZ to "General". Please review and change the sub-component if necessary the next time you review this BZ. Thanks

Comment 10 FuXiangChun 2020-03-02 06:04:53 UTC
Tested this bug with qemu-kvm-4.2.0-13.module+el8.2.0+5898+fb4bceae.x86_64

# /usr/bin/qemu-trace-stap list /usr/libexec/qemu-kvm 
Traceback (most recent call last):
  File "/usr/bin/qemu-trace-stap", line 175, in <module>
    main()
  File "/usr/bin/qemu-trace-stap", line 171, in main
    args.func(args)
  File "/usr/bin/qemu-trace-stap", line 118, in cmd_list
    print_probes(args.verbose, "*")
  File "/usr/bin/qemu-trace-stap", line 107, in print_probes
    env=tapset_env(tapsets))
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'stap': 'stap'

Hi Stefan, 

Is it expected result?

Comment 11 Dr. David Alan Gilbert 2020-03-02 11:48:24 UTC
> FileNotFoundError: [Errno 2] No such file or directory: 'stap': 'stap'

You need to install the systemtap packages.

Comment 12 FuXiangChun 2020-03-03 00:59:07 UTC
Verified bug with qemu-kvm-4.2.0-13.module+el8.2.0+5898+fb4bceae.x86_64 and 4.18.0-183.el8.x86_64

/usr/bin/qemu-trace-stap list /usr/libexec/qemu-kvm 
acpi_pci_down_read
acpi_pci_ej_write
acpi_pci_eject_slot
acpi_pci_features_read
acpi_pci_rmv_read
.....
wct_cmd_re
wct_cmd_sp
wct_cmd_st
wct_cmd_ts
wct_init
wct_speed
x86_iommu_iec_notify


The fixed qemu-kvm works. So set this bug as verfied.

Comment 14 errata-xmlrpc 2020-05-05 09:52:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:2017


Note You need to log in before you can comment on or make changes to this bug.