From: Eric Dumazet <eric.dumazet@gmail.com>
To: eranian@google.com
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
mingo@elte.hu, paulus@samba.org, davem@davemloft.net,
fweisbec@gmail.com, perfmon2-devel@lists.sf.net,
eranian@gmail.com, robert.richter@amd.com, acme@redhat.com
Subject: Re: [RFC PATCH 1/2] perf_events: add support for per-cpu per-cgroup monitoring (v3)
Date: Thu, 09 Sep 2010 15:52:02 +0200 [thread overview]
Message-ID: <1284040322.2589.174.camel@edumazet-laptop> (raw)
In-Reply-To: <4c88dca1.44e7d80a.577e.3592@mx.google.com>
Le jeudi 09 septembre 2010 à 06:09 -0700, Stephane Eranian a écrit :
> This kernel patch adds the ability to filter monitoring based on
> container groups (cgroups). This is for use in per-cpu mode only.
>
> The patch adds perf_event_attr.cgroup, a boolean, to activate
> this new mode. The cgroup is designated by passing in
> perf_event_attr.cgroup_fd, an opened file descriptor to
> the <mnt>/<cgroup>/perf_event.perf file.
>
> This is the second version of this patch. It corrects the way
> time_enabled is accounted for. In cgroup mode, time_enabled reflects
> the time the cgroup was active, i.e., threads from the cgroup executed
> on the monitored CPU. This is a more useful metric than just
> wall-clock. The meaning of time_enabled without cgroup is unaffected.
>
> Signed-off-by: Stephane Eranian <eranian@google.com>
> +#ifdef CONFIG_CGROUPS
> +struct perf_cgroup_time {
> + u64 time;
> + u64 timestamp;
> +};
> +
> +struct perf_cgroup {
> + struct cgroup_subsys_state css;
> + struct perf_cgroup_time *time;
struct perf_cgroup_time __percpu *time;
Please run sparse after this "__percpu" change.
> +};
> +#endif
> +
> /*
> +
> + jc->time = alloc_percpu(struct perf_cgroup_time);
> + if (!jc->time) {
> + vfree(jc);
> + return ERR_PTR(-ENOMEM);
> + }
> +
> + for_each_possible_cpu(c) {
> + t = per_cpu_ptr(jc->time, c);
> + t->time = 0;
> + t->timestamp = 0;
> + }
alloc_percpu() is zalloc_percpu() in fact, memory is already cleared.
next prev parent reply other threads:[~2010-09-09 13:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-09 13:09 Stephane Eranian
2010-09-09 13:52 ` Eric Dumazet [this message]
2010-09-09 21:41 ` Stephane Eranian
2010-09-10 8:16 ` Peter Zijlstra
2010-09-10 8:41 ` Tejun Heo
2010-09-10 8:52 ` [PATCH percpu#for-next] percpu: clear memory allocated with the km allocator Tejun Heo
2010-09-10 8:55 ` Peter Zijlstra
2010-09-10 16:31 ` Randy Dunlap
2010-09-10 16:45 ` Ingo Molnar
2010-09-10 23:28 ` Tejun Heo
2010-09-10 8:59 ` [RFC PATCH 1/2] perf_events: add support for per-cpu per-cgroup monitoring (v3) Stephane Eranian
2010-09-10 9:03 ` [PATCH] percpu: update comments to reflect that percpu allocations are always zero-filled Tejun Heo
2010-09-10 9:07 ` Stephane Eranian
2010-09-10 9:09 ` Eric Dumazet
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=1284040322.2589.174.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=acme@redhat.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
all inboxes | Powered by JetHome®