Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1149310imm; Wed, 25 Jul 2018 12:23:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfp/S7abCzMipPXX2TRGu63zpEaj+4p6yRsf91khYbCZbWElxt/4kz5n3dnuXhfS73i8buJ X-Received: by 2002:a17:902:9883:: with SMTP id s3-v6mr22137942plp.194.1532546579941; Wed, 25 Jul 2018 12:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532546579; cv=none; d=google.com; s=arc-20160816; b=r5g+sEBw6jUMekqbmLce6pgjNZrF9ElcMM/cgzRCSgswATuoMIgruo2anEHe+Qsfqt wJiqnHx49QT25BZ0OewZTAk1+4krkz2S0TnmZAki1f44EGJPt+2FwhLcuf7pnQBtwtQ+ WFHvlomV9VUJ9yEr34CbN4kZaFQM9JrDeL1aNrMU7RcZ45sF4tzcfTQyss0dc+rTrAxK EN8ZZ11QGvuiRhMY+RUWdBzlbHwxDlMKY4MmQ2h0qNaJ6irZhQuRbCZdfsBqX81zxyYu Iwqm1oqbjZ+SX6FtU7m8aOkZxL/t7kFKMv6m4zS0FPWslvpVobEI3fCq+dGY7mkpX1Yz u4Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=AnfbF7gJlwrQ6Dn1QC/QHK7dDh0qGUr0FVPf5v9nAJU=; b=H7LQDGLatpyBylXqE4py8BzEZIKEY669dUe7aVymEIswH2GgcXs26wfvvYOa3Dw8hT 5eiTka5UPscy3nRMjsSFjtFZ44XzUt7ZZ/CWMjzYVeydP1HPg6zmGNRG5IdsvOOq6AGI 53HGl1v0T0RX7voYKwBxBHpvCu3n8fQYfurzviUNn8GwZlBknf60q7BIsj83mDyZ8bw6 eKYjr9C8MHxeqZUKp60+emOkp1N1tw2/Nen/QYl+mxoH1GgF+Awomh4Ng4G4aILez5bv 6XPRKMggmwzuZW3NE+YES0S8jAikGGxIpiWHc9oTjBgRKlfs/XrbiXYMojFo1yirVIiW FB+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="RQPT/P4b"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2-v6si3122863pla.509.2018.07.25.12.22.44; Wed, 25 Jul 2018 12:22: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=@gmail.com header.s=20161025 header.b="RQPT/P4b"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730174AbeGYUek (ORCPT + 99 others); Wed, 25 Jul 2018 16:34:40 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:33414 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729354AbeGYUek (ORCPT ); Wed, 25 Jul 2018 16:34:40 -0400 Received: by mail-pl0-f65.google.com with SMTP id 6-v6so3703800plb.0; Wed, 25 Jul 2018 12:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=AnfbF7gJlwrQ6Dn1QC/QHK7dDh0qGUr0FVPf5v9nAJU=; b=RQPT/P4buUPPqBpslKWx2kJCnCZd1zUimgyrvuHwnzG3+yc3PgAkZi/w197NzPZG6a uZynFFXFTLQGfSSvVWEiX5dE+nlodHg6lrJA8/hlnJokKreAgufPe7MRIB5TQDKJft2A Fmu6IHCiVTdllTy3SxfFn4sTE5j6FP81HCrs0fLSgu6nXrzT5PaUZh6PblKWyQhPHMkP 2h+Il7eTucaLYc3530sqRtlGFdXDdGGuJCEB3cuAahldbqaTVAkG6gicbe8NvkAFmA8C aIyHSkmmIHNmTeWTQGeO9UkPe3TGLrMkW3XrNg3d1KJ6svkJ7v/+tdSW0Het0BSo1hrR RO1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=AnfbF7gJlwrQ6Dn1QC/QHK7dDh0qGUr0FVPf5v9nAJU=; b=XEuSPmY3p75lEul+2j7OenjPkRhtx1f69998sep73mu7uV2Ein0ve2YDQL4rPANrsz VklAxZHZkmP3dVa3JQZu09FlTWEc4Jnc27iiwdrlJ+2wt7PJpN0CxPXHAoRfiUozcL/p dE+B7h6ChfvCQVhOUXftV+Ha4QgO+MkZ+oo7mex4llrqgZdJwVz5sK9DQJZkur9qcUA5 Ey4XzPfmcZEVqUVH3Lb3BEF4rrnip5DSE/SEIUc4ovvGAroykYAIBPTHzjpLNS656w5q x+5ZW8IBN2cNSAphyQ/TxgWqFPlm0SQZ0JPb1+q+AdTaEpRZD5Jq+zEmtZrvleU1KTyD eftg== X-Gm-Message-State: AOUpUlEHOIdi3+MYm3IP4Mrxo9kQK6FMhtSKKIP8XCvO/xjderP3+P4k rrr1Rsl0TspZX6lFMs0HZSk= X-Received: by 2002:a17:902:da4:: with SMTP id 33-v6mr21941512plv.193.1532546496720; Wed, 25 Jul 2018 12:21:36 -0700 (PDT) Received: from [192.168.1.60] ([14.63.106.128]) by smtp.gmail.com with ESMTPSA id q85-v6sm6070720pfa.151.2018.07.25.12.21.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 12:21:35 -0700 (PDT) Subject: Re: pahole + BTF was: Re: [Question] bpf: about a new 'tools/bpf/bpf_dwarf2btf' From: Taeung Song To: Arnaldo Carvalho de Melo , Daniel Borkmann Cc: Alexei Starovoitov , Martin KaFai Lau , netdev@vger.kernel.org, Thomas Girard , Martin Cermak , linux-kernel@vger.kernel.org, acme@kernel.org References: <47cfb90e-a9f4-8127-2b89-0e20d9fda2f0@gmail.com> <20180725175231.GA2121@redhat.com> <35663517-26e1-c2a2-1554-5dd90be2747f@gmail.com> Message-ID: <592c6325-23d0-771b-cc28-6a66842a1265@gmail.com> Date: Thu, 26 Jul 2018 04:21:31 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <35663517-26e1-c2a2-1554-5dd90be2747f@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ? > 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. >>> What do you think about this ? Do you think this is needed ? >>> Or, already implementing something like this ? >>> If it is needed, I want to try to make 'tools/bpf/bpf_dwarf2btf' >>> based on the pahole code. I'd appreciate it, if you reply to this >> >> The way Martin took advantage of the work done a long time ago to >> support CTF out of the same DWARF reading codebase was really cool, not >> that much work to do, just add a new format to pahole's codebase making >> it more useful. >> > > I got it ! > > Thanks, > Taeung > >> I was just so far overly picky with testing it and kept leaving for >> later to have a good documentation about testing it, vacation and perf >> maintainership duties kept making this take like forever, grumble :-\ >> >> - Arnaldo >> > > -- > oh.. :'(