From: Stephane Eranian <eranian@google.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org, mingo@elte.hu, paulus@samba.org,
davem@davemloft.net, perfmon2-devel@lists.sf.net
Subject: Re: [PATCH] perf_events: improve x86 event scheduling
Date: Sun, 17 Jan 2010 22:53:43 +0100 [thread overview]
Message-ID: <bd4cb8901001171353v6984e89blf78b1a11788552a@mail.gmail.com> (raw)
In-Reply-To: <20100117161859.GG5035@nowhere>
hi,
Will repost a new version of the patch with these changes.
On Sun, Jan 17, 2010 at 5:19 PM, Frederic Weisbecker <fweisbec@gmail.com> wrote:
> On Sun, Jan 17, 2010 at 03:42:16PM +0100, Stephane Eranian wrote:
>> Frederic,
>>
>>
>> Here is what I have now in the x86 code.
>>
>> As for your comment on disabling the x86 event, we don't
>> need to do this because it is not actually activated yet when
>> we return from hw_perf_group_sched_in(). Activation occurs
>> really in hw_perf_enable().
>
>
> Ah, indeed.
>
>
>>
>>
>> static int x86_event_sched_in(struct perf_event *event,
>> struct perf_cpu_context *cpuctx, int cpu)
>> {
>> int ret = 0;
>>
>> event->state = PERF_EVENT_STATE_ACTIVE;
>> event->oncpu = cpu;
>> event->tstamp_running += event->ctx->time - event->tstamp_stopped;
>>
>> if (is_software_event(event))
>> ret = event->pmu->enable(event);
>>
>> if (!ret && !is_software_event(event))
>> cpuctx->active_oncpu++;
>>
>> if (!ret && event->attr.exclusive)
>> cpuctx->exclusive = 1;
>>
>> return ret;
>> }
>>
>> static void x86_event_sched_out(struct perf_event *event,
>> struct perf_cpu_context *cpuctx, int cpu)
>> {
>> event->state = PERF_EVENT_STATE_INACTIVE;
>> event->oncpu = -1;
>>
>> event->tstamp_running -= event->ctx->time - event->tstamp_stopped;
>>
>> if (is_software_event(event))
>> event->pmu->disable(event);
>>
>> if (!is_software_event(event))
>> cpuctx->active_oncpu--;
>>
>> if (event->attr.exclusive || !cpuctx->active_oncpu)
>> cpuctx->exclusive = 0;
>> }
>
>
>
> Yeah looks good.
>
> Thanks.
>
>
--
Stephane Eranian | EMEA Software Engineering
Google France | 38 avenue de l'Opéra | 75002 Paris
Tel : +33 (0) 1 42 68 53 00
This email may be confidential or privileged. If you received this
communication by mistake, please
don't forward it to anyone else, please erase all copies and
attachments, and please let me know that
it went to the wrong person. Thanks
next prev parent reply other threads:[~2010-01-17 21:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-12 10:50 Stephane Eranian
2010-01-12 16:10 ` Peter Zijlstra
2010-01-13 9:54 ` Stephane Eranian
2010-01-13 16:29 ` Peter Zijlstra
2010-01-13 16:52 ` Stephane Eranian
2010-01-13 17:22 ` Stephane Eranian
2010-01-17 14:12 ` Frederic Weisbecker
2010-01-17 14:42 ` Stephane Eranian
2010-01-17 16:19 ` Frederic Weisbecker
2010-01-17 21:53 ` Stephane Eranian [this message]
2010-01-18 11:13 ` Peter Zijlstra
2010-01-18 11:53 ` [PATCH] perf: fix the is_software_event() definition Peter Zijlstra
2010-01-18 12:07 ` Frederic Weisbecker
2010-01-18 12:19 ` Peter Zijlstra
2010-01-18 13:46 ` [perfmon2] " stephane eranian
2010-01-18 12:57 ` stephane eranian
2010-01-18 13:06 ` Frederic Weisbecker
2010-01-18 12:53 ` stephane eranian
2010-01-18 13:00 ` Peter Zijlstra
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=bd4cb8901001171353v6984e89blf78b1a11788552a@mail.gmail.com \
--to=eranian@google.com \
--cc=davem@davemloft.net \
--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 \
/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
all inboxes | Powered by JetHome®