Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751357AbdIEJoj (ORCPT ); Tue, 5 Sep 2017 05:44:39 -0400 Received: from merlin.infradead.org ([205.233.59.134]:50746 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750748AbdIEJoi (ORCPT ); Tue, 5 Sep 2017 05:44:38 -0400 Date: Tue, 5 Sep 2017 11:44:17 +0200 From: Peter Zijlstra To: Stephane Eranian Cc: Alexey Budankov , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Andi Kleen , Kan Liang , Dmitri Prokhorov , Valery Cherepennikov , Mark Rutland , David Carrillo-Cisneros , linux-kernel , Vince Weaver , Thomas Gleixner Subject: Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping Message-ID: <20170905094417.zu7l5mpr3unrlnad@hirez.programming.kicks-ass.net> References: <96c7776f-1f17-a39e-23e9-658596216d6b@linux.intel.com> <20170803150052.za2vofyqfgarukdr@hirez.programming.kicks-ass.net> <20170822204743.GR32112@worktop.programming.kicks-ass.net> <2a426aa2-42c8-e839-1cec-aa3971651f3e@linux.intel.com> <20170831171837.njnc6r6elsvkl7lt@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1026 Lines: 30 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!