Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1191833imm; Wed, 25 Jul 2018 13:13:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeO5cZX/+3uOWFk5Uuc8GNJjir4pkC7sd1scFvfVwBj5oxejbmP8S49YTKPClvfGXq+m6XY X-Received: by 2002:a63:4924:: with SMTP id w36-v6mr22036442pga.143.1532549639778; Wed, 25 Jul 2018 13:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532549639; cv=none; d=google.com; s=arc-20160816; b=pT0XWa7TZQsTbeqUh4NvwBpXjSeLj4q6e3NdkzOb1SDw8SR3z0O+s8TurOVHiw2fCz 3KenBelEukjbQ7qTrYwl5DuA7a4XohVGRtxe37Zrv38CE2ekkLkd/4syToCDaiQj5trK fFtBw/rsHcMLhKt9P6vFtY3SDZNWqDfKcTMHEQTD+EFTrs0f4brHEYw6RSN5TGm5BP/h gxIAIdHiJqSiPMQCUkgzJ/8N0W0c5hoUqOAPgynEBKZKZIW1kUcU8yvPxHBlayaI34QE mBIfAcXxViX8Rrsjj2Pm0BfDbqyh5/Lgvf1gcvi2ta1rGlsSRCfyCJYQr9grTgCub1pW hDYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=TpR+5DjqhLKNffptvQQCiKN5cJhvrEmRHfP4KDmaCsY=; b=zrsV55uxc6JqC+n4CRocE+xPL22zioULywTkJJEGAlKc5z0FxS2OqsBj4qaOIBbJR+ GAOpNoxZy9fB/SXu5LOS2q0doUM7RJdNhtg+iT38ZlR54pZM3uf28LHGsIY+wDsNP1dm N5dE8LdZ1PrX/Yrkw3VwTwy5w46kZpcDwP2cdHeo2wa30oR2L/bjrn2ILefaIWvQ9D9B ZcPYGBJptpozDuolUu0iAXeOMQpUyhFiigllDtbTPuGGw1cgaCrmszLK4BI7YbhlH7Zh y1Ia6OzvYQh3c5VcF+5xBaAM0OgSXEBwwpjFS6aE6f3UKuvtLFHSIchA4HJMRIfYHb6A MdaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=eXa8scfB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y186-v6si14861449pgb.395.2018.07.25.13.13.44; Wed, 25 Jul 2018 13:13:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=eXa8scfB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730701AbeGYV0K (ORCPT + 99 others); Wed, 25 Jul 2018 17:26:10 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:48804 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729868AbeGYV0J (ORCPT ); Wed, 25 Jul 2018 17:26:09 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6PKBqi4022465; Wed, 25 Jul 2018 13:12:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=facebook; bh=TpR+5DjqhLKNffptvQQCiKN5cJhvrEmRHfP4KDmaCsY=; b=eXa8scfBExRqnxTqEfTRq24+E4RlNDUEOW3fskZ7mp3n17vJ0vgw4uC2qJlo+PRnuRHN 01xCanQvtC6VbEif86L6v0HMyz7v26VeUHLyLDXc9EuIlnP/4c60U7nD25lhSc3DMrTU 34e7BRzf4t+SAqGvXXYRInmXI4CBG08YFj4= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2kevtkrkde-3 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 25 Jul 2018 13:12:25 -0700 Received: from PRN-CHUB02.TheFacebook.com (2620:10d:c081:35::11) by PRN-CHUB04.TheFacebook.com (2620:10d:c081:35::13) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 25 Jul 2018 13:11:26 -0700 Received: from kafai-mbp.dhcp.thefacebook.com (192.168.52.123) by mail.thefacebook.com (192.168.16.12) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 25 Jul 2018 13:11:23 -0700 Date: Wed, 25 Jul 2018 13:11:22 -0700 From: Martin KaFai Lau To: Taeung Song , Arnaldo Carvalho de Melo CC: Daniel Borkmann , Alexei Starovoitov , , Thomas Girard , Martin Cermak , , Subject: Re: pahole + BTF was: Re: [Question] bpf: about a new 'tools/bpf/bpf_dwarf2btf' Message-ID: <20180725201122.h7ostqw3qtfvz7sn@kafai-mbp.dhcp.thefacebook.com> References: <47cfb90e-a9f4-8127-2b89-0e20d9fda2f0@gmail.com> <20180725175231.GA2121@redhat.com> <35663517-26e1-c2a2-1554-5dd90be2747f@gmail.com> <592c6325-23d0-771b-cc28-6a66842a1265@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <592c6325-23d0-771b-cc28-6a66842a1265@gmail.com> User-Agent: NeoMutt/20180512 X-Originating-IP: [192.168.52.123] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-25_04:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2018 at 04:21:31AM +0900, Taeung Song wrote: > > > On 07/26/2018 03:27 AM, Taeung Song wrote: > > Hi Arnaldo, > > > > On 07/26/2018 02:52 AM, Arnaldo Carvalho de Melo wrote: > > > Em Thu, Jul 26, 2018 at 02:23:32AM +0900, Taeung Song escreveu: > > > > Hi, > > > > > > > > Building bpf programs with .BTF section, > > > > I thought it'd be better to convert dwarf info to .BTF by > > > > a new tool such as 'tools/bpf/bpf_dwarf2btf' instead of pahole > > > > in the future. > > > > Currently for bpf binary that have .BTF section, > > > > we need to use pahole from https://github.com/iamkafai/pahole/tree/btf > > > > with the command line such as "pahole -J bpf_prog.o". > > > > I think it is great but if implementing new 'bpf_dwarf2btf' > > > > (dwarf parsing + btf encoder code written by Martin KaFai Lau on > > > > the pahole project i.e. btf.h, btf_encoder.c, btf_encoder.h, > > > > libbtf.c, libbtf.h), > > > > BPF developers would more easily use functionalities based on BTF. > > > > > > What would be easier exactly? Not having to install a package but build > > > it from the kernel sources? > > > > > > Many kernel developers already have pahole installed for other uses, so > > > no need to install anything. > > > > > > > Understood, but I think there are many non-kernel developers > > developing BPF programs and they mightn't have or use pahole. > > > > So, if providing the 'dwarf2btf' feature on tools/bpf or tools/bpf/bpftool, > > non-kernel developers can also more easily build bpf prog with .BPF, no ? Some quick thoughts, IMO, I suspect if it is in the distro's pahole package, it should be easy enough for kernel and non kernel developer to install. BTF usage is still evolving, we might re-evaluate going forward but at this point I think leveraging pahole's existing capability is a good option. > > > > Or, if tools/lib/bpf/ have the 'dwarf2btf' feature, > I think BPF developers can just use bpf programs that have dwarf info > after compiling with clang '-g' and llc '-mattr=dwarfris', even though not > using pahole. > Isn't it good way ? > > > > BTW, Daniel, I just pushed to pahole's main repository at: > > > > > > ?? git://git.kernel.org/pub/scm/devel/pahole/pahole.git > > > > > > with the Martin's BTF patch, so no need to pull from the github one, > > > I'll tag v1.12 and announce the release so that distro package > > > maintainers can update their packages. Awesome! Thanks, Arnaldo! - Martin