From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757682AbbJVQNP (ORCPT ); Thu, 22 Oct 2015 12:13:15 -0400 Received: from mail.kernel.org ([198.145.29.136]:41456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756963AbbJVQNN (ORCPT ); Thu, 22 Oct 2015 12:13:13 -0400 Date: Thu, 22 Oct 2015 13:13:09 -0300 From: Arnaldo Carvalho de Melo To: "Wangnan (F)" Cc: ast@plumgrid.com, brendan.d.gregg@gmail.com, a.p.zijlstra@chello.nl, daniel@iogearbox.net, dsahern@gmail.com, hekuang@huawei.com, jolsa@kernel.org, lizefan@huawei.com, masami.hiramatsu.pt@hitachi.com, namhyung@kernel.org, paulus@samba.org, linux-kernel@vger.kernel.org, pi3orama@163.com, xiakaixu@huawei.com Subject: Re: [PATCH 04/31] perf record, bpf: Create probe points for BPF programs Message-ID: <20151022161309.GG2455@kernel.org> References: <1444826502-49291-1-git-send-email-wangnan0@huawei.com> <1444826502-49291-5-git-send-email-wangnan0@huawei.com> <20151020191214.GA9591@kernel.org> <5627072D.2070601@huawei.com> <20151021132803.GG10639@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151021132803.GG10639@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Oct 21, 2015 at 10:28:03AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Wed, Oct 21, 2015 at 11:31:57AM +0800, Wangnan (F) escreveu: > > >bpf: config program 'do_fork' > > >symbol:do_fork file:(null) line:0 offset:0 return:0 lazy:(null) > > >bpf: 'do_fork': event name is missing > > > > BPF report the problem, but it is a little bit hard to understand... > > > > >event syntax error: '/tmp/foo.o' > > > \___ Invalid argument > > > > > >(add -v to see detail) > > >Run 'perf list' for a list of valid events > > > > > > Usage: perf record [] [] > > > or: perf record [] -- [] > > > > > > -e, --event event selector. use 'perf list' to list available events > > >[root@felicio ~]# > > > > > >[root@felicio ~]# grep do_fork /proc/kallsyms > > >ffffffff81099ab0 T _do_fork > > >ffffffff81ccc800 d do_fork_test > > >[root@felicio ~]# > > > > > >$ echo '__attribute__((section("_do_fork"), used)) int fork(void *ctx) {return 0;} char _license[] __attribute__((section("license"), used)) = "GPL";int _version __attribute__((section("version"), used)) = 0x40100;' | clang -D__KERNEL__ $CLANG_OPTIONS $KERNEL_INC_OPTIONS -Wno-unused-value -Wno-pointer-sign -working-directory $WORKING_DIR -c - -target bpf -O2 -o /tmp/foo.o > > > In your program you only provide "do_fork", but we need "key=value" > > syntax. "key" will become the name of created kprobe. Please try > > "__attribute__((section("func=do_fork"), used)) " instead. > > > I think when event name is missing we'd better construct one name for > > it like perf probe, but then we need to deal with perf probe code > > again. It may require another patch. > > Nah, lets go with what we have, i.e. I'll take that into account and > test with the expected form. So, pushed this cset with my committer testing notes: https://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/ebpf&id=bd3c477e57233819580f5824dea3a6922a860a24 continuing... - Arnaldo