Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758219AbcK3QNP (ORCPT ); Wed, 30 Nov 2016 11:13:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36608 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758199AbcK3QNJ (ORCPT ); Wed, 30 Nov 2016 11:13:09 -0500 Date: Wed, 30 Nov 2016 14:12:57 -0200 From: Arnaldo Carvalho de Melo To: Wang Nan Cc: Alexei Starovoitov , ast@fb.com, lizefan@huawei.com, hekuang@huawei.com, linux-kernel@vger.kernel.org, pi3orama@163.com, joe@ovn.org, Jiri Olsa , acme@kernel.org Subject: Re: [PATCH v3 26/30] perf clang: Link BPF functions declaration into perf Message-ID: <20161130161257.GA4353@redhat.com> References: <20161126070354.141764-1-wangnan0@huawei.com> <20161126070354.141764-27-wangnan0@huawei.com> <20161126174039.GI83987@ast-mbp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161126174039.GI83987@ast-mbp.thefacebook.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 30 Nov 2016 16:13:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 945 Lines: 22 Em Sat, Nov 26, 2016 at 09:40:41AM -0800, Alexei Starovoitov escreveu: > On Sat, Nov 26, 2016 at 07:03:50AM +0000, Wang Nan wrote: > > + * } bpf_funcs[] = { > > + * EOF > > + * grep '^[[:space:]]BPF_FUNC_[^ ]*,' $KERNEL_DIR/include/uapi/linux/bpf.h | \ > > + * sed -e 's/.*BPF_FUNC_\([^,]*\),.*$/\1/g' | \ > > + * xargs -n 1 sh -c 'echo {.name = \"$1\", .id = BPF_FUNC_$1}, >> '"$MAIN" sh > > + * cat << EOF >> $MAIN > > This is pretty fragile and already broken. > Please just hardcode them as-is. There is no need to be so fancy. > > > +"static void *(*bpf_map_lookup_elem)(void *, void *) = (void *)1;\n" > > +"static long (*bpf_map_update_elem)(void *, void *, void *, unsigned long) = (void *)2;\n" > > +"static long (*bpf_map_delete_elem)(void *, void *) = (void *)3;\n" > > just hard code this way. Wang, can you please resend this? I'm trying to process this patchkit, but will take some time to get to this 26th patch. - Arnaldo