From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966288AbbLRIzr (ORCPT ); Fri, 18 Dec 2015 03:55:47 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:34311 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934228AbbLRIzm (ORCPT ); Fri, 18 Dec 2015 03:55:42 -0500 Date: Fri, 18 Dec 2015 09:55:38 +0100 From: Ingo Molnar To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , David Ahern , Jiri Olsa , Kan Liang , Namhyung Kim , Peter Zijlstra , Wang Nan Subject: Re: [GIT PULL 00/43] perf/core new feature: 'perf stat record/report' Message-ID: <20151218085538.GE30339@gmail.com> References: <1450381644-25674-1-git-send-email-acme@kernel.org> <20151218084804.GD30339@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151218084804.GD30339@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Ingo Molnar wrote: > > * Arnaldo Carvalho de Melo wrote: > > > From: Arnaldo Carvalho de Melo > > > > Hi Ingo, > > > > Please consider pulling, cool new feature! This is on top of the > > perf-core-for-mingo-2.1 tag, with that RHEL6.7 bugfix, I had also to go > > over this one fixing stuff in many spots :-\ > > > > - Arnaldo > > > > The following changes since commit 1843b4e057b7717db21a3ad96fa16d6b4ee8f6c4: > > > > tools subcmd: Rename subcmd header include guards (2015-12-17 14:27:14 -0300) > > > > are available in the git repository at: > > > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-3 > > > > for you to fetch changes up to 89af4e05c21d68f22e07fe66940ea675615a49ed: > > > > perf stat report: Allow to override aggr_mode (2015-12-17 16:30:30 -0300) > > > > ---------------------------------------------------------------- > > perf/core improvement. > > > > User visible: > > > > - Generate perf.data files from 'perf stat', to tap into the scripting > > capabilities perf has instead of defining a 'perf stat' specific scripting > > support to calculate event ratios, etc. Simple example: > > > > $ perf stat record -e cycles usleep 1 > > > > Performance counter stats for 'usleep 1': > > > > 1,134,996 cycles > > > > 0.000670644 seconds time elapsed > > > > $ perf stat report > > > > Performance counter stats for '/home/acme/bin/perf stat record -e cycles usleep 1': > > > > 1,134,996 cycles > > > > 0.000670644 seconds time elapsed > > > > $ > > > > It generates PERF_RECORD_ userspace records to store the details: > > > > $ perf report -D | grep PERF_RECORD > > 0xf0 [0x28]: PERF_RECORD_THREAD_MAP nr: 1 thread: 27637 > > 0x118 [0x12]: PERF_RECORD_CPU_MAP nr: 1 cpu: 65535 > > 0x12a [0x40]: PERF_RECORD_STAT_CONFIG > > 0x16a [0x30]: PERF_RECORD_STAT > > -1 -1 0x19a [0x40]: PERF_RECORD_MMAP -1/0: [0xffffffff81000000(0x1f000000) @ 0xffffffff81000000]: x [kernel.kallsyms]_text > > 0x1da [0x18]: PERF_RECORD_STAT_ROUND > > [acme@ssdandy linux]$ > > > > An effort was made to make perf.data files generated like this to not > > generate cryptic messages when processed by older tools. > > > > The 'perf script' bits need rebasing, will go up later. > > Nice feature! I tried it out, and it works as expected, cool stuff! Btw., a very small usability observation: maybe 'perf report' should be enhanced to recognize 'stat record' generated perf.data files, and display a matching message? Right now if I do 'perf report' on such a perf.data then I'll get a "no samples" TUI message, which is technically correct but somewhat misleading. It's no big deal - and maybe you guys can think of a better solution than displaying an error message: maybe 'perf report' should automatically switch to 'perf stat report'? It would be a bit shorter to type as well and would continue to strengthen the very nice level of integration that the various subcommands already have today. But maybe it would be confusing - don't know. Thanks, Ingo