From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754115AbcGTN2p (ORCPT ); Wed, 20 Jul 2016 09:28:45 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37643 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753503AbcGTN2j (ORCPT ); Wed, 20 Jul 2016 09:28:39 -0400 To: Peter Zijlstra , jolsa@redhat.com Cc: "Linux-Kernel@Vger. Kernel. Org" , andi@firstfloor.org From: Nikolay Borisov Subject: Strange behavior of perf top with PEBS Message-ID: <578F7C82.6090500@kyup.com> Date: Wed, 20 Jul 2016 16:28:34 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Running perf version 4.4.14.g0cb188d (no modification to the PMU/perf code) I observed that "perf top" counts no cycles and produces no output. After a bit of head scratching and testing I figured that running "perf top -e cycles" actually works whereas the default option is equivalent to running "perf top -e cycles:p". So the latter version seems to not work on my machine. Here is what my CPU is: cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Xeon(R) CPU E5450 @ 3.00GHz stepping : 6 microcode : 0x60f cpu MHz : 2992.637 cache size : 6144 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dtherm tpr_shadow vnmi flexpriority And the PEBS that is detected: Performance Events: PEBS fmt0+, 4-deep LBR, Core2 events, Intel PMU driver Looking at the code in arch/x86/kernel/cpu/perf_event_intel_ds.c it seems that the number after the fmt decides the level (according to http://man7.org/linux/man-pages/man1/perf-list.1.html#EVENT%C2%A0MODIFIERS) So in this case fmt0 should means that :p is not supported but perf top doesn't give any error. Increasing the number of p's : "perf top -e cycles:pp" shows the following error: 'precise' request may not be supported. Try removing 'p' modifier. In this case shouldn't adding even a single :p modifier cause the aforementioned error to be printed?