Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162006AbbKEPgx (ORCPT ); Thu, 5 Nov 2015 10:36:53 -0500 Received: from mail.kernel.org ([198.145.29.136]:41062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032952AbbKEPgw (ORCPT ); Thu, 5 Nov 2015 10:36:52 -0500 Date: Thu, 5 Nov 2015 12:36:47 -0300 From: Arnaldo Carvalho de Melo To: Wang Nan Cc: namhyung@kernel.org, lizefan@huawei.com, pi3orama@163.com, linux-kernel@vger.kernel.org, Ingo Molnar , Jiri Olsa , Alexei Starovoitov Subject: Re: [PATCH 1/5] bpf tools: Improve libbpf error reporting Message-ID: <20151105153647.GU13236@kernel.org> References: <1446697622-4072-1-git-send-email-wangnan0@huawei.com> <1446697622-4072-2-git-send-email-wangnan0@huawei.com> <20151105152607.GR13236@kernel.org> <20151105153511.GT13236@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151105153511.GT13236@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 Content-Length: 2664 Lines: 65 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 [] [] or: perf record [] -- [] -e, --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 [] [] or: perf record [] -- [] -e, --event event selector. use 'perf list' to list available events # -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/