Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752111AbbH2B2h (ORCPT ); Fri, 28 Aug 2015 21:28:37 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35966 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751477AbbH2B2g (ORCPT ); Fri, 28 Aug 2015 21:28:36 -0400 Subject: Re: [RFC PATCH 0/4] perf tools: Use the new ability of eBPF programs to access hardware PMU counter To: Kaixu Xia , davem@davemloft.net, daniel@iogearbox.net, acme@kernel.org, mingo@redhat.com, a.p.zijlstra@chello.nl, masami.hiramatsu.pt@hitachi.com, jolsa@kernel.org References: <1440672142-89311-1-git-send-email-xiakaixu@huawei.com> Cc: linux-kernel@vger.kernel.org, wangnan0@huawei.com, pi3orama@163.com From: Alexei Starovoitov Message-ID: <55E10AC1.1000706@plumgrid.com> Date: Fri, 28 Aug 2015 18:28:33 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1440672142-89311-1-git-send-email-xiakaixu@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1127 Lines: 24 On 8/27/15 3:42 AM, Kaixu Xia wrote: > An example is pasted at the bottom of this cover letter. In that example, > we can get the cpu_cycles and exception taken in sys_write. > > $ cat /sys/kernel/debug/tracing/trace_pipe > $ ./perf record --event perf-bpf.o ls > ... > cat-1653 [003] d..1 88174.613854: : ente: CPU-3 cyc:48746333 exc:84 > cat-1653 [003] d..2 88174.613861: : exit: CPU-3 cyc:48756041 exc:84 nice. probably more complex example that computes the delta of the pmu counters on the kernel side would be even more interesting. Do you think you can extend 'perf stat' with a flag that does stats collection for a given kernel or user function instead of the whole process ? Then we can use perf record/report to figure out hot functions and follow with 'perf stat -f my_hot_func my_process' to drill into particular function stats. -- 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/