From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932585AbbJ0Omw (ORCPT ); Tue, 27 Oct 2015 10:42:52 -0400 Received: from mail.kernel.org ([198.145.29.136]:55534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932262AbbJ0Omu (ORCPT ); Tue, 27 Oct 2015 10:42:50 -0400 Date: Tue, 27 Oct 2015 11:42:44 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: lkml , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra , "Liang, Kan" Subject: Re: [PATCH 31/52] perf stat record: Synthesize stat record data Message-ID: <20151027144244.GE9405@kernel.org> References: <1445784728-21732-1-git-send-email-jolsa@kernel.org> <1445784728-21732-32-git-send-email-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445784728-21732-32-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 Em Sun, Oct 25, 2015 at 03:51:47PM +0100, Jiri Olsa escreveu: > Synthesizing needed stat record data for report/script: > - cpu/thread maps > - stat config After this it gets a bit better, but then I expected that to specify an event I would be able to use: [root@zoo linux]# perf stat record -e cycles usleep 1 Error: unknown switch `e' Usage: perf record [] [] or: perf record [] -- [] -o, --output output file name But I need to do it as: [root@zoo linux]# perf stat -e cycles record usleep 1 Performance counter stats for 'usleep 1': 948417 cycles 0.000749965 seconds time elapsed [root@zoo linux]# -------------------------------------------------- This is confusing... Anyway, now the perf.data file doesn't produce that many confusing messages, just one, and the error reporting continues needing a newline, oops just noticed another problem: [root@zoo linux]# perf stat record usleep 1 Performance counter stats for 'usleep 1': 0.520959 task-clock (msec) # 0.504 CPUs utilized 1 context-switches # 0.002 M/sec 0 cpu-migrations # 0.000 K/sec 51 page-faults # 0.098 M/sec 929738 cycles # 1.785 GHz 625885 stalled-cycles-frontend # 67.32% frontend cycles idle stalled-cycles-backend 634514 instructions # 0.68 insns per cycle # 0.99 stalled cycles per insn 128859 branches # 247.350 M/sec 7602 branch-misses # 5.90% of all branches 0.001034675 seconds time elapsed [root@zoo linux]# perf evlist non matching sample_type[root@zoo linux]# But, if I specify an event: [root@zoo linux]# perf stat -e cycles record usleep 1 Performance counter stats for 'usleep 1': 876987 cycles 0.001285050 seconds time elapsed [root@zoo linux]# perf evlist cycles [root@zoo linux]# perf evlist -v cycles: size: 112, read_format: TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING, disabled: 1, inherit: 1, enable_on_exec: 1, exclude_guest: 1 [root@zoo linux]# ------------------------- It then works as expected, lists the event collected, no confusing message about 'sample_type' stuff is emitted. Ditto for 'perf report' [root@zoo linux]# perf report --stdio Warning: Kernel address maps (/proc/{kallsyms,modules}) were restricted. Check /proc/sys/kernel/kptr_restrict before running 'perf record'. As no suitable kallsyms nor vmlinux was found, kernel samples can't be resolved. Samples in kernel modules can't be resolved as well. Error: The perf.data file has no samples! # To display the perf.data header info, please use --header/--header-only options. # [root@zoo linux]# ------------------------------------------------ I.e. when I explicitely state what events should be collected, it behaves nicely, modulo this message about kernel address maps being restricted in 'report', so it looks like just some fix is needed to make it work like that when no events are specified. So, I'm creating a perf/stat branch and putting what I processed so far, with the changelog edits and changes in some function/struct names I partially mentioned, please try to continue from there, ok? - Arnaldo