Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031441AbbKEBsb (ORCPT ); Wed, 4 Nov 2015 20:48:31 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:21848 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753048AbbKEBsa (ORCPT ); Wed, 4 Nov 2015 20:48:30 -0500 Message-ID: <563AB553.8010300@huawei.com> Date: Thu, 5 Nov 2015 09:48:03 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: , , , Subject: Re: [PATCH v2 3/4] bpf tools: Improve libbpf error reporting References: <1446603959-233500-1-git-send-email-wangnan0@huawei.com> <1446603959-233500-4-git-send-email-wangnan0@huawei.com> <20151104220108.GK13236@kernel.org> In-Reply-To: <20151104220108.GK13236@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.563AB561.003B,ss=1,re=0.000,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2011-05-27 18:58:46 X-Mirapoint-Loop-Id: 04286516b51e3a411dceeb486a382e3c Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1960 Lines: 60 On 2015/11/5 6:01, Arnaldo Carvalho de Melo wrote: > Em Wed, Nov 04, 2015 at 02:25: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. > So, before I get: > > [root@zoo ~]# perf 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 > > > And now: > > [root@zoo ~]# perf record -e /tmp/foo.o sleep 1 > event syntax error: '/tmp/foo.o' > \___ Unknown error 4006 > > (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@zoo ~]# > > Can you please fix this? The relevant strerror() routine should know about the > errors it handles and produce an informative message. > > - Arnaldo > An libbpf related patches are losted because yesterday I didn't know your head. Today I'd like to merge my two patchsets and send them to you together. Thank you. -- 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/