public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: stephane eranian <eranian@googlemail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Stephane Eranian <eranian@google.com>,
	linux-kernel@vger.kernel.org, peterz@infradead.org,
	paulus@samba.org, davem@davemloft.net, fweisbec@gmail.com,
	robert.richter@amd.com, perfmon2-devel@lists.sf.net
Subject: Re: [PATCH] perf: fix stat attach bogus counts
Date: Thu, 18 Mar 2010 19:16:37 +0100	[thread overview]
Message-ID: <7c86c4471003181116i6ea31333tecf79eb487fcad7b@mail.gmail.com> (raw)
In-Reply-To: <20100318173615.GA2456@elte.hu>

On Thu, Mar 18, 2010 at 6:36 PM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Stephane Eranian <eranian@google.com> wrote:
>
>>       When perf stat -p pid is used, the events must be enabled
>>       immediately as there is no exec and thus no enable_on_exec.
>>
>>       Signed-off-by: Stephane Eranian <eranian@google.com>
>>
>> --
>>  builtin-stat.c |    6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
>> index 95db31c..3a91fad 100644
>> --- a/tools/perf/builtin-stat.c
>> +++ b/tools/perf/builtin-stat.c
>> @@ -159,8 +159,10 @@ static void create_perf_stat_counter(int counter, int pid)
>>               }
>>       } else {
>>               attr->inherit        = inherit;
>> -             attr->disabled       = 1;
>> -             attr->enable_on_exec = 1;
>> +             if (target_pid == -1) {
>> +                     attr->disabled       = 1;
>> +                     attr->enable_on_exec = 1;
>> +             }
>
> Mind checking latest -tip, which has these commits:
>
> d6d901c: perf events: Change perf parameter --pid to process-wide collection instead of thread-wid
> 46be604: perf record: Enable counters only when kernel is execing subcommand
> 6be2850: perf stat: Enable counters when collecting process-wide or system-wide data
>
> as they fix/improve various --pid related behavioral aspects of perf. Does it
> work fine for you now?
>
They indeed included the same fix.
So that's fine now.

      reply	other threads:[~2010-03-18 18:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 13:11 [PATCH] perf: fix stat attach bogus counts Stephane Eranian
2010-03-18 17:36 ` Ingo Molnar
2010-03-18 18:16   ` stephane eranian [this message]

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=7c86c4471003181116i6ea31333tecf79eb487fcad7b@mail.gmail.com \
    --to=eranian@googlemail.com \
    --cc=davem@davemloft.net \
    --cc=eranian@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=perfmon2-devel@lists.sf.net \
    --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