Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756131AbbKEUvJ (ORCPT ); Thu, 5 Nov 2015 15:51:09 -0500 Received: from mail.kernel.org ([198.145.29.136]:60770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751965AbbKEUvH (ORCPT ); Thu, 5 Nov 2015 15:51:07 -0500 Date: Thu, 5 Nov 2015 17:51:01 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: lkml , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra , "Liang, Kan" Subject: Re: [PATCH 02/25] perf stat record: Add record command Message-ID: <20151105205101.GY13236@kernel.org> References: <1446734469-11352-1-git-send-email-jolsa@kernel.org> <1446734469-11352-3-git-send-email-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1446734469-11352-3-git-send-email-jolsa@kernel.org> X-Url: http://acmel.wordpress.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 Content-Length: 3508 Lines: 93 Em Thu, Nov 05, 2015 at 03:40:46PM +0100, Jiri Olsa escreveu: > Add 'perf stat record' command support. It creates simple > (header only) perf.data file ATM. > > The record command could be specified anywhere among stat > options. All stat command options are valid for stat record > command with '-o' option exception. If specified for record > command it denotes the perf data file name. > > Tested-by: Kan Liang > Link: http://lkml.kernel.org/n/tip-0av5yfkwyywwgoiali88w4hi@git.kernel.org > Signed-off-by: Jiri Olsa Still stopping here: [acme@zoo linux]$ rm -f perf.data [acme@zoo linux]$ perf stat record usleep 1 Performance counter stats for 'usleep 1': 0.621181 task-clock (msec) # 0.455 CPUs utilized 1 context-switches # 0.002 M/sec 0 cpu-migrations # 0.000 K/sec 54 page-faults # 0.087 M/sec 917,006 cycles # 1.476 GHz 611,746 stalled-cycles-frontend # 66.71% frontend cycles idle stalled-cycles-backend 654,410 instructions # 0.71 insns per cycle # 0.93 stalled cycles per insn 132,653 branches # 213.550 M/sec 7,432 branch-misses # 5.60% of all branches 0.001365369 seconds time elapsed [acme@zoo linux]$ ls -la perf.data -rw-------. 1 acme acme 1384 Nov 5 17:42 perf.data [acme@zoo linux]$ perf evlist WARNING: The perf.data file's data size field is 0 which is unexpected. Was the 'perf record' command properly terminated? non matching sample_type[acme@zoo linux]$ -------------------------------- When we pass one event it gets a bit better: [acme@zoo linux]$ rm -f perf.data [acme@zoo linux]$ perf stat -e cycles record usleep 1 Performance counter stats for 'usleep 1': 1,056,818 cycles 0.000715850 seconds time elapsed [acme@zoo linux]$ ls -la perf.data -rw-------. 1 acme acme 232 Nov 5 17:44 perf.data [acme@zoo linux]$ perf evlist WARNING: The perf.data file's data size field is 0 which is unexpected. Was the 'perf record' command properly terminated? cycles [acme@zoo linux]$ ----- In the second case it almost works, modulo that warning. I think that what we need to achieve is for older tools to be able to, with a file produced by 'perf stat record', to show this: [root@zoo ~]# perf report --no-header --stdio Error: The perf.data file has no samples! # To display the perf.data header info, please use --header/--header-only options. # [root@zoo ~]# I.e. the file should look like one that is produced by this command, purposely to not create any sample: # perf record -e syscalls:sys_enter_accept usleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.018 MB perf.data ] I applied the first patch and added it to that perf/stat branch. - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/