From: Alexei Starovoitov <ast@plumgrid.com>
To: Kaixu Xia <xiakaixu@huawei.com>, daniel@iogearbox.net
Cc: wangnan0@huawei.com, linux-kernel@vger.kernel.org,
pi3orama@163.com, hekuang@huawei.com, netdev@vger.kernel.org
Subject: Re: [PATCH v7 5/5] samples/bpf: example of get selected PMU counter value
Date: Tue, 11 Aug 2015 18:59:46 -0700 [thread overview]
Message-ID: <55CAA892.80403@plumgrid.com> (raw)
In-Reply-To: <1438844556-27064-6-git-send-email-xiakaixu@huawei.com>
On 8/6/15 12:02 AM, Kaixu Xia wrote:
> This is a simple example and shows how to use the new ability
> to get the selected Hardware PMU counter value.
>
> Signed-off-by: Kaixu Xia <xiakaixu@huawei.com>
> ---
> samples/bpf/Makefile | 4 +++
> samples/bpf/bpf_helpers.h | 2 ++
> samples/bpf/tracex6_kern.c | 26 ++++++++++++++++++
> samples/bpf/tracex6_user.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++
1.
I see a bunch of warnings building it:
HOSTCC samples/bpf/tracex6_user.o
../samples/bpf/tracex6_user.c: In function ‘test_bpf_perf_event’:
../samples/bpf/tracex6_user.c:49:2: warning: passing argument 1 of
‘close’ makes integer from pointer without a cast [enabled by default]
In file included from ../samples/bpf/tracex6_user.c:2:0:
/usr/include/unistd.h:354:12: note: expected ‘int’ but argument is of
type ‘int *’
../samples/bpf/tracex6_user.c:20:16: warning: unused variable ‘value’
[-Wunused-variable]
../samples/bpf/tracex6_user.c:42:8: warning: ignoring return value of
‘system’, declared with attribute warn_unused_result [-Wunused-result]
../samples/bpf/tracex6_user.c:43:8: warning: ignoring return value of
‘system’, declared with attribute warn_unused_result [-Wunused-result]
../samples/bpf/tracex6_user.c:44:8: warning: ignoring return value of
‘system’, declared with attribute warn_unused_result [-Wunused-result]
HOSTLD samples/bpf/tracex6
HOSTCC samples/bpf/lathist_user.o
HOSTLD samples/bpf/lathist
clang -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.7/include
-I../arch/x86/include -Iarch/x86/include/generated/uapi
-Iarch/x86/include/generated -I../include -Iinclude
-I../arch/x86/include/uapi -Iarch/x86/include/generated/uapi
-I../include/uapi -Iinclude/generated/uapi -include
../include/linux/kconfig.h \
-D__KERNEL__ -Wno-unused-value -Wno-pointer-sign \
-O2 -emit-llvm -c ../samples/bpf/tracex6_kern.c -o -|
../tools/bpf/llvm/bld/Debug+Asserts/bin/llc -march=bpf -filetype=obj -o
samples/bpf/tracex6_kern.o
../samples/bpf/tracex6_kern.c:13:22: warning: declaration of 'struct
pt_regs' will not be visible outside of this function [-Wvisibility]
int bpf_prog1(struct pt_regs *ctx)
Please fix.
2.
the example is incomplete.
Please add read_trace_pipe() otherwise it exits without printing
anything useful.
3.
please replace ls and pwd with ls > /dev/null
the spam on the screen is unnecessary.
next prev parent reply other threads:[~2015-08-12 1:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-06 7:02 [PATCH v7 0/5] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter Kaixu Xia
2015-08-06 7:02 ` [PATCH v7 1/5] perf: add the necessary core perf APIs when accessing events counters in eBPF programs Kaixu Xia
2015-08-06 7:02 ` [PATCH v7 2/5] bpf: Make the bpf_prog_array_map more generic Kaixu Xia
2015-08-06 7:02 ` [PATCH v7 3/5] bpf: Add new bpf map type to store the pointer to struct perf_event Kaixu Xia
2015-08-06 7:02 ` [PATCH v7 4/5] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter Kaixu Xia
2015-08-06 7:02 ` [PATCH v7 5/5] samples/bpf: example of get selected PMU counter value Kaixu Xia
2015-08-12 1:59 ` Alexei Starovoitov [this message]
2015-08-10 5:50 ` [PATCH v7 0/5] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter David Miller
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=55CAA892.80403@plumgrid.com \
--to=ast@plumgrid.com \
--cc=daniel@iogearbox.net \
--cc=hekuang@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pi3orama@163.com \
--cc=wangnan0@huawei.com \
--cc=xiakaixu@huawei.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.