Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

From: Peter Zijlstra
Date: Tue Sep 05 2017 - 05:44:44 EST


On Tue, Sep 05, 2017 at 12:51:35AM -0700, Stephane Eranian wrote:
> >> Esp the cgroup stuff is entirely untested since I simply don't know how
> >> to operate that. I did run Vince's tests on it, and I think it doesn't
> >> regress, but I'm near a migraine so I can't really see straight atm.
> >>
> >> Vince, Stephane, could you guys have a peek?
> >>
> > okay, I will run some tests with cgroups on my systems.
> >
> I ran some cgroups tests, including multiplexing and so far it appears to work
> normally.

Shiny!

> It is easy to create a cgroup and move a shell into it:
> $ mount -t cgroup none /sys/fs/cgroups
> $ cd /sys/fs/cgroups/perf_events
> $ mkdir memtoy
> $ cd memtoy
> $ echo $$ >tasks
>
> At this point your shell is part of the cgroup.
> Then you can use perf to monitor globally or inside the cgroup:
>
> $ perf stat -a -e cycles,cycles -G memtoy -I 1000 sleep 1000
>
> That monitors cycles on all CPUs twice, once only when a member
> of the cgroup memtoy runs, and the other globally.

Right, thanks!