linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, acme@redhat.com,
	robert.richter@amd.com, peterz@infradead.org, mingo@elte.hu,
	joro@8bytes.org, gleb@redhat.com, joerg.roedel@amd.com
Subject: Re: [PATCH] perf tools: fix guest mode monitoring on AMD
Date: Mon, 27 Feb 2012 11:00:04 -0700	[thread overview]
Message-ID: <4F4BC4A4.10006@gmail.com> (raw)
In-Reply-To: <CABPqkBRUzp-gBANhiMerHanN7yaTnJbxHNEjz_mw+XRYT8ZHUw@mail.gmail.com>

On 2/27/12 10:52 AM, Stephane Eranian wrote:
> On Mon, Feb 27, 2012 at 6:47 PM, David Ahern<dsahern@gmail.com>  wrote:
>> On 2/27/12 10:33 AM, Stephane Eranian wrote:
>>>
>>> Commit:
>>>
>>> 1aed267 perf kvm: Do guest-only counting by default
>>>
>>> introduced a bug on AMD systems whereby simple commands:
>>>
>>> $ perf stat ls
>>> Performance counter stats for 'ls':
>>>                   0 cycles                    #    0.000 GHz
>>>         0.003704596 seconds time elapsed
>>>
>>> would not count anything anymore. Same results for perf record.
>>>
>>> I tracked it down to guest mode exclusion being enabled
>>> by default leading to attr->exclude_guest = 1. When
>>> not operating under any sort of virtualization, this
>>> causes the PMU not to count anything.
>>>
>>> The fix disables guest exclusion by default.
>>>
>>> Signed-off-by: Stephane Eranian<eranian@google.com>
>>> ---
>>>
>>> diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
>>> index 8109a90..c1017b3 100644
>>> --- a/tools/perf/util/util.c
>>> +++ b/tools/perf/util/util.c
>>> @@ -6,7 +6,7 @@
>>>    * XXX We need to find a better place for these things...
>>>    */
>>>   bool perf_host  = true;
>>> -bool perf_guest = false;
>>> +bool perf_guest = true;
>>
>>
>> This was recently reverted to false by
>> c4a7dca92bbb9881a5d678720f1d0c2153499749
>>
>> See: https://lkml.org/lkml/2012/2/8/234
>>
> Yeah, but that causes simple commands such as "perf stat -e cycles ls"
> to return 0 count.
>
> So either you get a segfault or you get zero count. There is something
> else going on here...

agreed. Did you try reverting exclude_guest by default?


  reply	other threads:[~2012-02-27 18:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-27 17:33 [PATCH] perf tools: fix guest mode monitoring on AMD Stephane Eranian
2012-02-27 17:39 ` Gleb Natapov
2012-02-27 17:47 ` David Ahern
2012-02-27 17:52   ` Stephane Eranian
2012-02-27 18:00     ` David Ahern [this message]
2012-02-27 18:23     ` Joerg Roedel
2012-02-28 15:55       ` [PATCH] perf/x86: Fix HO/GO counting with SVM disabled Joerg Roedel
2012-02-28 17:24         ` Avi Kivity
2012-02-28 17:36           ` David Ahern
2012-02-28 17:38             ` Avi Kivity
2012-02-29 13:24               ` Joerg Roedel
2012-02-29 13:57         ` [PATCH v2] " Joerg Roedel
2012-02-29 17:00           ` Avi Kivity
2012-02-29 17:03             ` Gleb Natapov
2012-02-29 17:05             ` Joerg Roedel
2012-02-29 17:08               ` Avi Kivity
2012-02-29 17:24               ` Peter Zijlstra
2012-02-29 17:44           ` Peter Zijlstra
2012-03-02 14:54           ` [tip:perf/urgent] perf/x86/kvm: Fix Host-Only/ Guest-Only " tip-bot for Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F4BC4A4.10006@gmail.com \
    --to=dsahern@gmail.com \
    --cc=acme@redhat.com \
    --cc=eranian@google.com \
    --cc=gleb@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=robert.richter@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).