RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1360533 - The error message need to improve when enable a perf event on a host which do not support it
Summary: The error message need to improve when enable a perf event on a host which do...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: John Ferlan
QA Contact: Jing Qi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-27 02:40 UTC by yalzhang@redhat.com
Modified: 2017-08-01 23:53 UTC (History)
7 users (show)

Fixed In Version: libvirt-2.5.0-1.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2017-08-01 17:11:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description yalzhang@redhat.com 2016-07-27 02:40:09 UTC
Description of problem:
When enable mbmt/mbml on a host didn't support mbm, the error message need to be more clear.

Version-Release number of selected component (if applicable):
libvirt-2.0.0-3.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a host with intel E5-2600 series v2 cpu which do not support intel mbm but support cmt.

2.Define a guest with below content
# virsh dumpxml rhel7.2 | grep /perf -B4
  <perf>
    <event name='cmt' enabled='no'/>
    <event name='mbmt' enabled='yes'/>
    <event name='mbml' enabled='no'/>
  </perf>

3.As the host do not support mbmt/mbml, the guest fail to start. 
# virsh start rhel7.2
error: Failed to start domain rhel7.2
error: Unable to open perf type=26 for pid=24570: Invalid argument

# virsh perf rhel7.2 --enable mbml --disable cmt,mbmt
# virsh perf rhel7.2 
cmt            : disabled
mbmt           : disabled
mbml           : enabled
# virsh start rhel7.2
error: Failed to start domain rhel7.2
error: Unable to open perf type=26 for pid=24633: Invalid argument

4. After guest start, enable mbml/mbmt
# virsh perf rhel7.2 --enable cmt --disable mbml,mbmt
# virsh start rhel7.2
Domain rhel7.2 started

# virsh perf rhel7.2 --enable mbml --disable mbmt
error: Unable to enable/disable perf events
error: Unable to open perf type=26 for pid=24713: Invalid argument



Actual results:
step 3 and step 4, the error message is not clear.

Expected results:
The error message need to be improved, such as "mbmt/mbml is not supported by host CPU"

Additional info:
When enable cmt/mbml/mbmt on a host which supports none of them, the error message is like this, pls evaluate if is needs to do together.

# virsh start rhel7.2
error: Failed to start domain rhel7.2
error: Failed to open file '/sys/devices/intel_cqm/type': No such file or directory

# virsh perf rhel7.2 --enable mbmt
error: Unable to enable/disable perf events
error: Failed to open file '/sys/devices/intel_cqm/type': No such file or directory

Comment 2 yalzhang@redhat.com 2016-07-28 06:35:13 UTC
(In reply to yalzhang from comment #0)
> Description of problem:
> When enable mbmt/mbml on a host didn't support mbm, the error message need
> to be more clear.
> 
> Version-Release number of selected component (if applicable):
> libvirt-2.0.0-3.el7.x86_64
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1.Prepare a host with intel E5-2600 series v2 cpu which do not support intel
> mbm but support cmt.
 
Correct a typo here, it should be **v3** not v2.(v3 just support cmt, and v4 support cmt and mbml/mbmt)

Comment 3 yalzhang@redhat.com 2016-07-28 06:49:16 UTC
Some more scenarios about error message issue. 

Test with libvirt-2.0.0-3.el7.x86_64 and intel E5-2640 v4 cpu.
 
1.When disable some event which is already disabled, it will report error.

# virsh start rhel7.2
Domain rhel7.2 started

# virsh perf rhel7.2
cmt            : disabled
mbmt           : disabled
mbml           : disabled

# virsh perf rhel7.2 --disable cmt
error: Unable to enable/disable perf events
error: Unable to disable perf event type=0: Bad file descriptor

# virsh perf rhel7.2 --disable mbmt
error: Unable to enable/disable perf events
error: Unable to disable perf event type=1: Bad file descriptor

# virsh perf rhel7.2 --disable mbml
error: Unable to enable/disable perf events
error: Unable to disable perf event type=2: Bad file descriptor

2. When combine enable and disable, the same error will occur, but in fact the "--enable" part succeed.

# virsh start rhel7.2
Domain rhel7.2 started

# virsh perf rhel7.2
cmt            : disabled
mbmt           : disabled
mbml           : disabled

# virsh perf rhel7.2 --enable mbmt --disable cmt
error: Unable to enable/disable perf events
error: Unable to disable perf event type=0: Bad file descriptor

# virsh perf rhel7.2
cmt            : disabled
mbmt           : enabled
mbml           : disabled

Actual results:
step 1 and 2, unexpected error occur.

Expected results:
when disable the event which is already disabled, it should not report error, ignore the error message is OK.

Additional info:
Enable the one which is already enabled works fine and no error occur. 
The guest is running:
# virsh perf rhel7.2
cmt            : enabled
mbmt           : enabled
mbml           : disabled

# virsh perf rhel7.2 --enable cmt,mbmt

# virsh perf rhel7.2
cmt            : enabled
mbmt           : enabled
mbml           : disabled

Comment 4 John Ferlan 2016-09-14 19:57:18 UTC
There's been changes made upstream that alter the error messages seen...

1. From Description: 

error: Unable to open perf type=26 for pid=24570: Invalid argument

has been altered to be:

Unable to open perf event for %s

where %s would be "cmt", "mbmt", or "mbml"

I suppose "for host CPU" could be added

This was done by: 
commit b00d7f298b7dd57d923bc9a9a6df47471e4eaab8
Author: Qiaowei Ren <qiaowei.ren>
Date:   Wed Aug 3 13:23:31 2016 -0400

    perf: Adjust the perf initialization
    
    Introduce a static attr table and refactor virPerfEventEnable() for
    general purpose usage.
    
    This patch creates a static table/matrix that converts the VIR_PERF_EVENT_*
    events into their respective "attr.type" and "attr.config" so that
    virPerfEventEnable doesn't have the switch the calling function passes
    by value the 'type'.
    
    Signed-off-by: Qiaowei Ren <qiaowei.ren>

-=-=-=-=-=-=

2. From comment 3

virsh perf rhel7.2 --disable {cmt|mbmt|mbml}

still results in the same error.  This should be fixed.

----

virsh perf rhel7.2 --enable mbmt --disable cmt

No longer enables mbmt, it gives an error :

virsh perf $dom --enable mbmt --disable cmt
error: Unable to enable/disable perf events
error: argument unsupported: unable to enable perf event for mbmt

----

Comment 5 John Ferlan 2016-10-07 12:37:46 UTC
Patches sent to resolve the disable the disabled error... Especially on systems that don't support it!

Also added a "host cpu" clarification to error messages and used the perf name in the disable failure message rather than the number (since other messages already were altered anyway).

http://www.redhat.com/archives/libvir-list/2016-October/msg00319.html

Comment 6 John Ferlan 2016-10-07 17:34:40 UTC
Patches pushed:

commit 0f3f8ac97efed4a5c574e6b51e356cea2f825fcf
Author: John Ferlan <jferlan>
Date:   Fri Oct 7 08:28:58 2016 -0400

    util: Check/ignore already disabled event
    
    If the event is already disabled, then don't bother with setting it
    disabled again.  Causes unnecessary error on systems that don't support
    the feature anyway.
...


$ git describe 0f3f8ac97efed4a5c574e6b51e356cea2f825fcf
v2.3.0-40-g0f3f8ac

Comment 8 Jing Qi 2017-01-03 05:13:30 UTC
Test passed with version libvirt-2.5.0-1.el7.x86_64.
1.In a host which doesn't support "cmt"/"mbmt"/"mbml", when the guest rhel7_perf_test is active / inactive, run below command, it returns expected error message.
   
   #virsh perf rhel7_perf_test  --enable cmt
   error: Unable to enable/disable perf events
   error: argument unsupported: unable to enable host cpu perf event for cmt


2. In a host which doesn't support "cmt"/"mbmt"/"mbml".
   #virsh perf rhel7_perf_test
    cmt                 :disabled
    mbmt                :disabled
    mbml                :disabled
    cpu_cycles          :disabled
    instructions        :disabled
    cache_references    :disabled
    cache_misses        :disabled


   #virsh perf rhel7_perf_test --disable "cmt"

   No any message returned.

Comment 9 errata-xmlrpc 2017-08-01 17:11:42 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/RHEA-2017:1846

Comment 10 errata-xmlrpc 2017-08-01 23:53:19 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/RHEA-2017:1846


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