Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758598AbcDANaU (ORCPT ); Fri, 1 Apr 2016 09:30:20 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:59024 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752833AbcDANaS (ORCPT ); Fri, 1 Apr 2016 09:30:18 -0400 Subject: Re: perf trace + BPF To: Arnaldo Carvalho de Melo References: <20160331180803.GB10112@kernel.org> CC: David Ahern , Jiri Olsa , "Namhyung Kim" , Linux Kernel Mailing List From: "Wangnan (F)" Message-ID: <56FE77D0.50900@huawei.com> Date: Fri, 1 Apr 2016 21:29:52 +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: <20160331180803.GB10112@kernel.org> 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.0A020201.56FE77E0.035B,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a728a965a778a9c063afea8b6725264b Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1460 Lines: 47 On 2016/4/1 2:08, Arnaldo Carvalho de Melo wrote: > Hi Wang, > > Trying to get back at working with 'perf trace' + BPF and I'm > noticing that the perf_event_attr->sample_type for the BPF events are > different than the ones for the raw_syscalls:sys_{enter,exit} or to > other tracepoint events we may ask 'perf trace' to set up, for instance, > for: > > perf trace -vv -T --ev sched:sched_switch --ev bpf-output/no-inherit,name=evt/ --ev /home/acme/bpf/test_bpf_trace.c/map:channel.event=evt/ usleep 10 > > We get these sample types (full perf_event_attr dump at the end of this > message): > > sched:sched_switch: > sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER > > [root@jouet ~]# perf probe -l > perf_bpf_probe:func_begin (on SyS_nanosleep@linux/kernel/time/hrtimer.c) > perf_bpf_probe:func_end (on SyS_nanosleep%return@linux/kernel/time/hrtimer.c) > > sample_type IP|TID|RAW|IDENTIFIER > > raw_syscalls:sys_{enter,exit}: > > sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER > > I guess this is an interaction with that "no-inherit" part, probably we need to > set PERF_SAMPLE_TIME by some other means... Please see [1]. Not related to no-inherit, just because the bpf-output event is not a tracepoint. And glad to see you restart working on my patches again! Thank you. [1] http://lkml.kernel.org/g/1459517202-42320-1-git-send-email-wangnan0@huawei.com > - Arnaldo >