From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752102AbcG3Dms (ORCPT ); Fri, 29 Jul 2016 23:42:48 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:26794 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750799AbcG3Dml (ORCPT ); Fri, 29 Jul 2016 23:42:41 -0400 Subject: Re: [PATCH] perf/core: Add a tracepoint for perf sampling To: Brendan Gregg , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin References: <1468970448-3309-1-git-send-email-bgregg@netflix.com> CC: , Alexei Starovoitov From: "Wangnan (F)" Message-ID: <579C2059.9@huawei.com> Date: Sat, 30 Jul 2016 11:34:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.579C206D.0032,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 73db8ba5c9031cdbab92d361e3c26760 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/7/30 2:05, Brendan Gregg wrote: > On Tue, Jul 19, 2016 at 4:20 PM, Brendan Gregg wrote: >> When perf is performing hrtimer-based sampling, this tracepoint can be used >> by BPF to run additional logic on each sample. For example, BPF can fetch >> stack traces and frequency count them in kernel context, for an efficient >> profiler. > Any comments on this patch? Thanks, > > Brendan Sorry for the late. I think it is a useful feature. Could you please provide an example to show how to use it in perf? If I understand correctly, I can have a BPF script run 99 times per second using # perf -e cpu-clock/freq=99/ -e mybpf.c ... And in mybpf.c, attach a BPF script on the new tracepoint. Right? Also, since we already have timer:hrtimer_expire_entry, please provide some further information about why we need a new tracepoint. Thank you.