From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaldo Carvalho de Melo Subject: Re: [PATCH bpf-next v5 00/10] BTF: BPF Type Format Date: Thu, 7 Jun 2018 17:25:24 -0300 Message-ID: <20180607202524.GH17292@kernel.org> References: <20180607190510.qtj7gq4wbfewcn4g@kafai-mbp> <20180607193029.GG17292@kernel.org> <20180607200701.bvsjzoq56rnggwfd@kafai-mbp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , kernel-team@fb.com, Wang Nan , Jiri Olsa , Namhyung Kim , Ingo Molnar To: Martin KaFai Lau Return-path: Received: from mail.kernel.org ([198.145.29.99]:56168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932491AbeFGUZ2 (ORCPT ); Thu, 7 Jun 2018 16:25:28 -0400 Content-Disposition: inline In-Reply-To: <20180607200701.bvsjzoq56rnggwfd@kafai-mbp> Sender: netdev-owner@vger.kernel.org List-ID: Em Thu, Jun 07, 2018 at 01:07:01PM -0700, Martin KaFai Lau escreveu: > On Thu, Jun 07, 2018 at 04:30:29PM -0300, Arnaldo Carvalho de Melo wrote: > > So this must be available in a newer llvm version? Which one? > I should have put in the details in my last email or > in the commit message, my bad. > 1. The tools/testing/selftests/bpf/Makefile has the CLANG_FLAGS and > LLC_FLAGS needed to compile the bpf prog. It requires a new > "-mattr=dwarf" llc option which was added to the future > llvm 7.0. > Hence, I have been using the llvm's master in github which > also has the llvm-objcopy. > 2. The kernel's btf part only focus on the BPF map. > Hence, the testing bpf program should have the map's key > and map's value. e.g. tools/testing/selftests/bpf/test_btf_haskv.c Thanks for the version required to test this, but where is this test_btf_haskv.c file? Which tree? net-next? Ok, just pulled torvalds/master and there it is. Gotcha. struct bpf_map_def SEC("maps") __bpf_stdout__ = { .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY, .key_size = sizeof(int), .value_size = sizeof(u32), .max_entries = __NR_CPUS__, }; This map is in the above hello.c example, but I guess its way too simple :-) Ok, I'll test this at home in another machine where I have the llvm's git repo. - Arnaldo