From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933012AbdHVPBA (ORCPT ); Tue, 22 Aug 2017 11:01:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:59890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932329AbdHVPA6 (ORCPT ); Tue, 22 Aug 2017 11:00:58 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 398F22170C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Tue, 22 Aug 2017 12:00:55 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Andi Kleen , jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH v2 04/19] perf, tools: Tighten detection of BPF events Message-ID: <20170822150055.GM10891@kernel.org> References: <20170811232634.30465-1-andi@firstfloor.org> <20170811232634.30465-4-andi@firstfloor.org> <20170822082007.GA23985@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170822082007.GA23985@krava> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Aug 22, 2017 at 10:20:07AM +0200, Jiri Olsa escreveu: > On Fri, Aug 11, 2017 at 04:26:19PM -0700, Andi Kleen wrote: > > From: Andi Kleen > > > > perf stat -e cpu/uops_executed.core,cmask=1/ > > > > would be detected as a BPF source event because the .c matches the .c > > source BPF pattern. > > > > v2: > > > > Originally I tried to use lex lookahead, but it doesn't seem to work. > > > > This now extends the BPF pattern to match longer events, but then > > does an extra check in the C code to reject BPF matches that > > do not end with .c/.o/.obj > > > > This uses REJECT, which makes the flex scanner slower, but > > that shouldn't be a big problem for the perf events. > > > > Signed-off-by: Andi Kleen > > seems ok, Arnaldo, could you run it with BPF/clang test machinery? ;-) Seems to work now: [root@jouet bpf]# perf trace -e write -e /home/acme/bpf/tracepoint.c cat /etc/passwd > /dev/null 0.000 ( 0.006 ms): cat/18485 write(fd: 1, buf: 0x7f59eebe1000, count: 3494 ) ... 0.006 ( ): raw_syscalls:sys_enter:NR 1 (1, 7f59eebe1000, da6, 22, 7f59eebe0010, 0)) 0.008 ( ): perf_bpf_probe:_write:(ffffffff9626b2c0)) 0.000 ( 0.010 ms): cat/18485 ... [continued]: write()) = 3494 [root@jouet bpf]# I'll try and add this as a "shell test", looking if all the required components are in place, etc. - Arnaldo