From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Wang Nan <wangnan0@huawei.com>
Cc: namhyung@kernel.org, lizefan@huawei.com, pi3orama@163.com,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Jiri Olsa <jolsa@kernel.org>,
Alexei Starovoitov <ast@plumgrid.com>
Subject: Re: [PATCH 1/5] bpf tools: Improve libbpf error reporting
Date: Thu, 5 Nov 2015 12:36:47 -0300 [thread overview]
Message-ID: <20151105153647.GU13236@kernel.org> (raw)
In-Reply-To: <20151105153511.GT13236@kernel.org>
Em Thu, Nov 05, 2015 at 12:35:11PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Nov 05, 2015 at 12:26:07PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Thu, Nov 05, 2015 at 04:26:58AM +0000, Wang Nan escreveu:
> > > In this patch, a series libbpf specific error numbers and
> > > libbpf_strerror() are created to help reporting error to caller.
> > > Functions are updated to pass correct error number through macro
> > > CHECK_ERR().
> > >
> > > All users of bpf_object__open{_buffer}() and bpf_program__title()
> > > in perf are modified accordingly. In addition, due to error code
> > > changing, bpf__strerror_load() also modified to use new error code.
> > >
> > > bpf__strerror_head() is also changed accordingly so it can parse
> > > libbpf error. bpf_loader_strerror() is introduced for it, and will
> > > be improved by following patch.
> >
> > I am applying this, test shows a improvement in error reporting, but
> > please look below for some suggestions:
>
> I take that back, better fix this now, see the other message about the
> BPF loader part too.
And please add something like this so that we can see how it was before
your change and how it became, to make it clear the value of your patch,
i.e. what is that the user will see before and after your patch:
Committer note:
Before:
the foo.o object has an invalid kernel version:
# /tmp/oldperf record -e /tmp/foo.o sleep 1
event syntax error: '/tmp/foo.o'
\___ Invalid argument: Are you root and runing a CONFIG_BPF_SYSCALL kernel?
(add -v to see detail)
Run 'perf list' for a list of valid events
Usage: perf record [<options>] [<command>]
or: perf record [<options>] -- <command> [<options>]
-e, --event <event> event selector. use 'perf list' to list available events
After:
# perf record -e /tmp/foo.o sleep 1
event syntax error: '/tmp/foo.o'
\___ Failed to load program: Validate your program and check 'license'/'version' sections in your object
(add -v to see detail)
Run 'perf list' for a list of valid events
Usage: perf record [<options>] [<command>]
or: perf record [<options>] -- <command> [<options>]
-e, --event <event> event selector. use 'perf list' to list available events
#
next prev parent reply other threads:[~2015-11-05 15:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-05 4:26 [PATCH 0/5] perf tools: improve BPF related error delivering and testing Wang Nan
2015-11-05 4:26 ` [PATCH 1/5] bpf tools: Improve libbpf error reporting Wang Nan
2015-11-05 15:26 ` Arnaldo Carvalho de Melo
2015-11-05 15:35 ` Arnaldo Carvalho de Melo
2015-11-05 15:36 ` Arnaldo Carvalho de Melo [this message]
2015-11-05 4:26 ` [PATCH 2/5] perf tools: Improve BPF related error messages output Wang Nan
2015-11-05 15:34 ` Arnaldo Carvalho de Melo
2015-11-05 4:27 ` [PATCH 3/5] perf test: Enforce LLVM test: update basic BPF test program Wang Nan
2015-11-05 4:27 ` [PATCH 4/5] perf test: Enforce LLVM test: add kbuild test Wang Nan
2015-11-05 4:27 ` [PATCH 5/5] perf test: Add 'perf test BPF' Wang Nan
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=20151105153647.GU13236@kernel.org \
--to=acme@kernel.org \
--cc=ast@plumgrid.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=pi3orama@163.com \
--cc=wangnan0@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox