Bug 1337033
| Summary: | kvm_stat AttributeError: 'ArchPPC' object has no attribute 'exit_reasons' | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | mazhang <mazhang> |
| Component: | qemu-kvm-rhev | Assignee: | Laurent Vivier <lvivier> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.3 | CC: | dgibson, knoel, lvivier, michen, mrezanin, pbonzini, qzhang, virt-maint |
| Target Milestone: | rc | Keywords: | Regression |
| Target Release: | --- | ||
| Hardware: | ppc64le | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | qemu-kvm-rhev-2.6.0-5.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-07 21:10:16 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
kvm_stat is broken upstream since:
commit 639ce1831082084af80290c79f06a5794a3caa0b
Author: Janosch Frank <frankja.ibm.com>
Date: Mon Jan 11 16:17:39 2016 +0100
scripts/kvm/kvm_stat: Introduce main function
The main function should be the main location for initialization and
helps encapsulating variables into a scope. This way they don't have
to be global and might be mistaken for local ones.
As the providers variable is scoped now it can't be accessed from
within the Stats class. Hence, the global access to the variable was
changed to a local one.
Reviewed-by: Jason J. Herne <jjherne.ibm.com>
Signed-off-by: Janosch Frank <frankja.ibm.com>
Message-Id: <1452525484-32309-10-git-send-email-frankja.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini>
But this not the same error:
...
File "./scripts/kvm/kvm_stat", line 375, in reset
fcntl.ioctl(self.fd, IOCTL_NUMBERS['RESET'], 0)
IOError: [Errno 25] Inappropriate ioctl for device
The problem with the exit_reasons apperas later with:
commit 068294a1cac4798e4554d9c9848c7c1b31d28713
Author: Janosch Frank <frankja.ibm.com>
Date: Mon Jan 11 16:17:55 2016 +0100
scripts/kvm/kvm_stat: Group arch specific data
Using global variables and multiple initialization functions for arch
specific data makes the code hard to read. By grouping them in the
Arch classes we encapsulate and initialize them in one place.
Signed-off-by: Janosch Frank <frankja.ibm.com>
Message-Id: <1452525484-32309-26-git-send-email-frankja.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini>
commit 639ce18 wants to enable by default tracepoint provider without managing error case. So it does not introduce the bug but only reveal a bug in tracepoint provider.
The bug was introduced by:
commit fc116efad0aadb2f8a49d51240bddbfe21b631a0
Author: Wei Huang <wei>
Date: Fri Jan 23 15:56:04 2015 -0500
kvm_stat: Add RESET support for perf event ioctl
While running kvm_stat using tracepoint on ARM64 hardware (e.g. "kvm_stat
-1 -t"), the initial values of some kvm_userspace_exit counters were found
to be very suspecious. For instance the tracing tool showed that S390_TSCH
was called many times on ARM64 machine, which apparently was wrong.
This patch adds RESET ioctl support for perf monitoring. Before calling
ioctl to enable a perf event, this patch resets the counter first. With
this patch, the init counter values become correct on ARM64 hardware.
Example:
==== before patch ====
kvm_userspace_exit(S390_SIEIC) 1426 0
kvm_userspace_exit(S390_TSCH) 339 0
==== after patch ====
kvm_userspace_exit(S390_SIEIC) 0 0
kvm_userspace_exit(S390_TSCH) 0 0
Signed-off-by: Wei Huang <wei>
The problem with RESET on POWER is the ioctl command number is not the good one for POWER. Patches sent upstream: - to fix 'exit_reasons': http://patchwork.ozlabs.org/patch/624386/ - to fix event queue RESET: http://patchwork.ozlabs.org/patch/624421/ Since qemu-kvm-tools-rhev-2.5.0-4.el7.ppc64le doesn't has this problem, set this bug as Regression. The fix that will be applied upstream will be: http://patchwork.ozlabs.org/patch/611965/ Hrm. Laurent's fix doesn't appear to have gone upstream, and now kvm_stat has been removed entirely from the qemu tree (because it's in the kernel tree). Since we're basing on qemu-2.6, I think we should keep to kvm_stat in qemu, rather than the kernel. So, it looks like we might need to carry this as a downstream only patch. Laurent, does that sound reasonable? (In reply to David Gibson from comment #9) > Hrm. Laurent's fix doesn't appear to have gone upstream, and now kvm_stat > has been removed entirely from the qemu tree (because it's in the kernel > tree). > > Since we're basing on qemu-2.6, I think we should keep to kvm_stat in qemu, > rather than the kernel. So, it looks like we might need to carry this as a > downstream only patch. > > Laurent, does that sound reasonable? Paolo has sent me an email saying he will take the patch from someone else sent in April (but it is the same fix): http://patchwork.ozlabs.org/patch/611965/ I was waiting this patch been applied upstream in qemu or linux kvm_stat to backport it in qemu kvm_stat (to keep them in sync). Paolo, any comment? I've found the commit in linux repo, I'm backporting it to qemu. Fix included in qemu-kvm-rhev-2.6.0-5.el7 Verify this bug on qemu-kvm-tools-rhev-2.6.0-5.el7.ppc64le kvm_stat work well. kvm statistics - summary Event Total Current kvm_userspace_exit 209133 10268 kvm_ppc_instr 952 0 This bug has been fixed. 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://rhn.redhat.com/errata/RHBA-2016-2673.html |
Description of problem: Version-Release number of selected component (if applicable): Host: qemu-kvm-tools-rhev-2.6.0-2.el7.ppc64le How reproducible: 100% Steps to Reproduce: # kvm_stat Traceback (most recent call last): File "/usr/bin/kvm_stat", line 825, in <module> main() File "/usr/bin/kvm_stat", line 813, in main providers = get_providers(options) File "/usr/bin/kvm_stat", line 778, in get_providers providers.append(TracepointProvider()) File "/usr/bin/kvm_stat", line 416, in __init__ self.filters = get_filters() File "/usr/bin/kvm_stat", line 315, in get_filters if ARCH.exit_reasons: AttributeError: 'ArchPPC' object has no attribute 'exit_reasons' Actual results: Expected results: Work fine Additional info: