Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751357AbdH1T2A (ORCPT ); Mon, 28 Aug 2017 15:28:00 -0400 Received: from mail-io0-f179.google.com ([209.85.223.179]:34010 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbdH1T17 (ORCPT ); Mon, 28 Aug 2017 15:27:59 -0400 X-Google-Smtp-Source: ADKCNb6WydDPb3GM+kT4+OJk2ow4r7wj5GvvAweutWmIE+x+lK+t4Kr+WyWDROZhZBbL4k9sAgflD4C91HCgMnufavA= MIME-Version: 1.0 In-Reply-To: References: <1503342849-2036-1-git-send-email-eranian@google.com> <87wp5wr0cb.fsf@firstfloor.org> <20170822012545.GJ2482@two.firstfloor.org> <20170822070332.GA21829@krava> From: Stephane Eranian Date: Mon, 28 Aug 2017 12:27:57 -0700 Message-ID: Subject: Re: [PATCH] perf record: enable multiplexing scaling via -R To: Jiri Olsa Cc: Andi Kleen , LKML , Arnaldo Carvalho de Melo , Peter Zijlstra , "mingo@elte.hu" , "Liang, Kan" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2418 Lines: 70 Hi, On Tue, Aug 22, 2017 at 12:24 AM, Stephane Eranian wrote: > On Tue, Aug 22, 2017 at 12:03 AM, Jiri Olsa wrote: >> >> On Mon, Aug 21, 2017 at 06:25:45PM -0700, Andi Kleen wrote: >> > On Mon, Aug 21, 2017 at 05:13:29PM -0700, Stephane Eranian wrote: >> > > On Mon, Aug 21, 2017 at 4:02 PM, Andi Kleen wrote: >> > > > >> > > > Stephane Eranian writes: >> > > > > >> > > > > To activate, the user must use: >> > > > > $ perf record -a -R .... >> > > > >> > > > I don't know why you're overloading the existing raw mode? >> > > > >> > > > It has nothing to do with that. >> > > > >> > > I explained this in the changelog. So that is does not change any of >> > > the processing in perf report, i.e., no faced with data it does not >> > > know how to handle. >> > > Also trying to avoid adding yet another option. >> > >> > But raw is needed for some of the non Intel PMUs. I believe it's >> > the only way to use AMD IBS. You may as well break their usage. >> > >> > You'll need a new option. >> >> I agree with Andi, I don't think we should mix those, >> we should have a way to switch it on/off >> > Ok, then. I will add an option to turn this on. This is a useful mode > for many advanced users. > I looked at the perf source code again over the weekend. It seems there is no need for a new patch. Whatever is needed to capture time_running/time_enabled is already there. The kernel can only record the timings when PERF_SAMPLE_READ is set. The way to enable this with current perf is to use the S modified on events: $ perf record -e cycles:S ..... That captures the timings, though they are in a read struct inside the record. But this is exactly what my earlier patch was doing. The modifier also works with the more developed syntax: $ perf record -e cpu/event=0xc0,umask=1/S .... So I think we are good to go. to capture multiplexing scaling factor when sampling simply use the S modifier. But to my surprise, newer kernels are not happy with the cmdline: $ perf record -e cycles:S noploop 1 Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cycles:Su). /bin/dmesg may provide additional information. No CONFIG_PERF_EVENTS=y kernel support configured? That looks like a bug to me. Why would that not work? I have not yet had the time to look into this. Jiri? Thanks. >> >> jirka