All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corey Ashford <cjashfor@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Stephane Eranian <eranian@googlemail.com>
Subject: Re: [BUG] perf_event: when events are grouped, the time enabled / running values are incorrect
Date: Wed, 12 May 2010 11:15:15 -0700	[thread overview]
Message-ID: <4BEAF033.7080802@linux.vnet.ibm.com> (raw)
In-Reply-To: <1273686646.1626.145.camel@laptop>

Thanks, Peter,

I had copied and pasted the patch from the web gossamer-threads lkml archive (I didn't have access to my email at the time), and had problems with the patch program complaining that the patch was in improper format.  I couldn't see anything wrong with what it was complaining about, so I assumed that it was something to do with the code it was actually patching.  Probably a bad assumption in retrospect.

I will try your patch for 2.6.33.3, and since I have access to my email again, there probably won't be any problems.   Stay tuned :)

- Corey

On 5/12/2010 10:50 AM, Peter Zijlstra wrote:
> On Wed, 2010-05-12 at 10:25 -0700, Corey Ashford wrote:
> 
>> Thanks for looking into this problem!  Unfortunately, I've been unable 
>> to test your patch.  It doesn't apply to 2.6.33.3 
> 
> Strange the code looks very similar, the below is a diff against a
> virgin v2.6.33.3.
> 
> ---
>  kernel/perf_event.c |   26 +++++++++++++-------------
>  1 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/kernel/perf_event.c b/kernel/perf_event.c
> index 32d0ae2..e8ae0c2 100644
> --- a/kernel/perf_event.c
> +++ b/kernel/perf_event.c
> @@ -290,6 +290,18 @@ static void update_event_times(struct perf_event *event)
>  }
> 
>  /*
> + * Update total_time_enabled and total_time_running for all events in a group.
> + */
> +static void update_group_times(struct perf_event *leader)
> +{
> +	struct perf_event *event;
> +
> +	update_event_times(leader);
> +	list_for_each_entry(event, &leader->sibling_list, group_entry)
> +		update_event_times(event);
> +}
> +
> +/*
>   * Add a event from the lists for its context.
>   * Must be called with ctx->mutex and ctx->lock held.
>   */
> @@ -337,7 +349,7 @@ list_del_event(struct perf_event *event, struct perf_event_context *ctx)
>  	if (event->group_leader != event)
>  		event->group_leader->nr_siblings--;
> 
> -	update_event_times(event);
> +	update_group_times(event);
> 
>  	/*
>  	 * If event was in error state, then keep it
> @@ -508,18 +520,6 @@ retry:
>  }
> 
>  /*
> - * Update total_time_enabled and total_time_running for all events in a group.
> - */
> -static void update_group_times(struct perf_event *leader)
> -{
> -	struct perf_event *event;
> -
> -	update_event_times(leader);
> -	list_for_each_entry(event, &leader->sibling_list, group_entry)
> -		update_event_times(event);
> -}
> -
> -/*
>   * Cross CPU call to disable a performance event
>   */
>  static void __perf_event_disable(void *info)
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Regards,

- Corey

Corey Ashford
Software Engineer
IBM Linux Technology Center, Linux Toolchain
Beaverton, OR 
503-578-3507 
cjashfor@us.ibm.com


  reply	other threads:[~2010-05-12 18:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-08  1:56 [BUG] perf_event: when events are grouped, the time enabled / running values are incorrect Corey Ashford
2010-05-08  2:24 ` Corey Ashford
2010-05-11 14:42 ` Peter Zijlstra
2010-05-11 15:43   ` [tip:perf/core] perf: Fix exit() vs event-groups tip-bot for Peter Zijlstra
2010-05-11 19:55   ` [BUG] perf_event: when events are grouped, the time enabled / running values are incorrect stephane eranian
2010-05-11 20:11     ` Peter Zijlstra
2010-05-11 20:23       ` Stephane Eranian
2010-05-11 20:27         ` Peter Zijlstra
2010-05-12 17:25   ` Corey Ashford
2010-05-12 17:50     ` Peter Zijlstra
2010-05-12 18:15       ` Corey Ashford [this message]
2010-05-12 18:42       ` Corey Ashford
2010-05-13  0:10     ` Paul Mackerras
2010-05-13 10:17       ` Paul Mackerras
2010-05-13 17:37         ` Corey Ashford

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=4BEAF033.7080802@linux.vnet.ibm.com \
    --to=cjashfor@linux.vnet.ibm.com \
    --cc=eranian@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.