Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1099148imm; Wed, 25 Jul 2018 11:28:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdBxMK22o8+IA7s0SH3HGx8BJr4sutJHAbP09r4GK33N3ZgcMmUbFDXpB89F+sO3V5rCt1Q X-Received: by 2002:a17:902:740a:: with SMTP id g10-v6mr22107986pll.204.1532543291453; Wed, 25 Jul 2018 11:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532543291; cv=none; d=google.com; s=arc-20160816; b=lpZrm8quIyW2DwYboG8jtzPE4O9FkkdivWMCUJ9Ucqk4U6NDrb2xgXhijqrRy6yPxy gD4PPQHbte6A87DucnBmSPjcLMpsb6ghpfwjJvKGbPckwjf2W6iN49qQ7KGER7RGErh0 BMHnAtKPcOOr3PpXT7t5wMUWYOTKdJ0alckyxa2ziYgYmXos5JHZ9Wn7kf56o11JRBQC LxDJSKiqrnAKktgnuNmmy96XAiHrPHBStLcynAhvuIFS+PKBzwKtIsJg5l17JtAQoR+L +UWU2tTXbkSN50Dv6z7bu1mdZyQHAtXZv+Nu0iu4lCVs2hY60o6AG2/Vo8z2W6S0bFxU 2s6g== 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:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=/dBZn6nU73J8W70hnk44SYfz54gVTT2xw3kLrZ1YU3c=; b=qGlHmfIDXTOgWAzD8oxsjyX6/pnWyPvpyoXQoDCgpYoq2FsllKkwsF/cyvB9mMwrBh 5HmpH7xUxi/Q3XLA3g3yxNg4MmM5y+WvW3YUgu36n+ol0qdMvkzNOzo+sUJWM38bkY6t VqxLB9JVTKuSe6blkRBTd85vVgtpQKf8/U75M91cPLlJfF7OTfU9XsoB1Ur66faOW+UV 0Ne4cJffM36Gj6FtJ6SIc3Hmp0IX/9WiIyOXi8bFk+ao1MvvXqAysncZpWOcum5TYwag kzTSmGMxuTdGk75+9fdCeWRSYgdGVxL3s8HElu1qxxE5N6g5jyciqi4cijhYoxktlhkP dZLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XRNogYkX; 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 p14-v6si15109735pgd.306.2018.07.25.11.27.56; Wed, 25 Jul 2018 11:28:11 -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=XRNogYkX; 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 S1730509AbeGYTkA (ORCPT + 99 others); Wed, 25 Jul 2018 15:40:00 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:43971 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729187AbeGYTkA (ORCPT ); Wed, 25 Jul 2018 15:40:00 -0400 Received: by mail-pl0-f65.google.com with SMTP id x6-v6so1950570plv.10; Wed, 25 Jul 2018 11:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=/dBZn6nU73J8W70hnk44SYfz54gVTT2xw3kLrZ1YU3c=; b=XRNogYkXdtquEh8j+6K0cHD8KNRnu2/JyasbqCNHzsOWRMTVbnDmteJSj532Ky0sGh WnLFtyq3iCQVo036qmJztGVu91wNzjhdDulOpCBUOM9+RCUlPwXazr2kO78YM4Fuuswa qNKmN+l9fAZYwa41q7gWRMeC7j0HDhHVNPldgn3JqKA65ae98+ipQ49bHWtojj57nmov 4Q/Hzu+J5p1qdVpFu4QaS34n/gL9zKYpFKMTdWOOBVEu5q5BUl3p4+cZ7bG9dxHcU3Ug vUr2qxCKChQYebLHazlaMSLhiiDAc0LoWQR43K8pct+Dz4DNraoluMKSuc3XLjH64MGU gNmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/dBZn6nU73J8W70hnk44SYfz54gVTT2xw3kLrZ1YU3c=; b=owgPET3uk9yPUso8VOHyPdNeHY2zZMAPcE9XmLbskv+tNNZEBLdjRkPXNXc/LZG0by sLq6cCPA9FJbFPNiSkBX16U/8bVe/DPt6SAD45l+O3nlJtlFhzQmNmdljoGHn5VM+VpN o6kOJfXKY2ZAFzh4eJp4Rp1l07Gw2zZN5aZ2eFo1eUgWV6HKToXikt625I0dIKHhIQBq Qk35zIBSupGYpElS1doQIebxWWmT2TNo3eAbthV9sBQqYHhCZY8rr1TxfWMd2cFk5iC1 IYN7una3tu1pFZAlv4H3aUrvF4clFaGrfka/eBlVgq/ztWsvgp7Pe6G2aLM350KBwmf+ G/5w== X-Gm-Message-State: AOUpUlGVV/6FxjAUWSwTSjgEhYDytu8ga6xt+g5XHeIMYle3cLJEH1bX tYxKmybj82tBcS3UT8MAskQ= X-Received: by 2002:a17:902:7587:: with SMTP id j7-v6mr5028484pll.256.1532543227398; Wed, 25 Jul 2018 11:27:07 -0700 (PDT) Received: from [192.168.1.35] ([14.63.105.207]) by smtp.gmail.com with ESMTPSA id e8-v6sm19045498pgi.24.2018.07.25.11.27.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 11:27:06 -0700 (PDT) Subject: Re: pahole + BTF was: Re: [Question] bpf: about a new 'tools/bpf/bpf_dwarf2btf' To: Arnaldo Carvalho de Melo Cc: Daniel Borkmann , 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> From: Taeung Song Message-ID: <35663517-26e1-c2a2-1554-5dd90be2747f@gmail.com> Date: Thu, 26 Jul 2018 03:27:01 +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: <20180725175231.GA2121@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ? > 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.. :'(