From: "Wangnan (F)" <wangnan0@huawei.com>
To: Vince Weaver <vincent.weaver@maine.edu>,
linux-perf-users@vger.kernel.org
Subject: Re: perf bpf-output example program
Date: Tue, 25 Oct 2016 11:20:02 +0800 [thread overview]
Message-ID: <580ECF62.8020900@huawei.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1610231302040.27722@macbook-air>
On 2016/10/24 1:10, Vince Weaver wrote:
> Does anyone have a working perf bpf-output example program?
>
> The one from the original commit to the kernel
> 03e0a7df3efd959e40cd7ff40b1fabddc234ec5a
> does not work for me:
>
> sudo perf record -a -e bpf-output/no-inherit,name=evt/ -e
> ./test_bpf_output.c/map:channel:event=evt/ ls /
Sorry. the API has changed. You should use map:channel.event=evt,
not ...channel:event...
> WARNING: unable to get correct kernel building directory.
> Hint: Set correct kbuild directory using 'kbuild-dir' option in [llvm]
> section of ~/.perfconfig or set it to "" to suppress kbuild
> detection.
>
> event syntax error: './test_bpf_output.c/map:channel:event=evt/'
> \___ Failed to load program for unknown reason
>
> Vince
>
This is my test result:
$ cat ~/.perfconfig
[llvm]
clang-path = "/tmp/oxygen_root/usr/bin/clang"
$ sudo ./perf record -a -e bpf-output/no-inherit,name=evt/ -e
./test_bpf_output.c/map:channel.event=evt/ ls /
bin cdrom etc initrd.img lib32 libx32 media opt root
sbin sys usr vmlinuz
boot dev home lib lib64 lost+found mnt proc run
srv tmp var
[ perf record: Woken up 0 times to write data ]
[ perf record: Captured and wrote 0.772 MB perf.data (501 samples) ]
$ sudo ~/perf script
perf 15478 [001] 6571474.169705: 0
evt: ffffffff81238c41 sys_write+0x1 (/lib/module
BPF output: 0000: 23 b3 78 d3 b6 58 17 00 #.x..X..
0008: 01 00 00 00
....
But in your case it reports can't locate kbuild dir. Please fix it, or the
#include <uapi/linux/bpf.h>
at the head of test-bpf-output.c causes failure.
Thank you.
next prev parent reply other threads:[~2016-10-25 3:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-23 17:10 perf bpf-output example program Vince Weaver
2016-10-25 3:20 ` Wangnan (F) [this message]
2016-10-25 5:37 ` Vince Weaver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=580ECF62.8020900@huawei.com \
--to=wangnan0@huawei.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=vincent.weaver@maine.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).