From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28D79C43462 for ; Fri, 14 May 2021 06:34:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E1E8B6144B for ; Fri, 14 May 2021 06:34:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231180AbhENGfZ (ORCPT ); Fri, 14 May 2021 02:35:25 -0400 Received: from pegase2.c-s.fr ([93.17.235.10]:37459 "EHLO pegase2.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230329AbhENGfY (ORCPT ); Fri, 14 May 2021 02:35:24 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4FhJdv1Shwz9sZK; Fri, 14 May 2021 08:34:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T1_jWZQjZv-c; Fri, 14 May 2021 08:34:11 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4FhJdv0Rs5z9sZJ; Fri, 14 May 2021 08:34:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E2D018B7F7; Fri, 14 May 2021 08:34:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id mVreRObY4o1i; Fri, 14 May 2021 08:34:10 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D62098B7F6; Fri, 14 May 2021 08:34:07 +0200 (CEST) Subject: Re: [PATCH bpf-next 1/2] bpf: Remove bpf_jit_enable=2 debugging mode To: Quentin Monnet , Alexei Starovoitov Cc: Ian Rogers , Song Liu , "open list:DOCUMENTATION" , Zi Shen Lim , Paul Walmsley , Alexei Starovoitov , Andrii Nakryiko , Paul Mackerras , Sandipan Das , "H. Peter Anvin" , sparclinux@vger.kernel.org, Shubham Bansal , Mahesh Bandewar , Will Deacon , Nicolas Dichtel , linux-s390 , Ilya Leoshkevich , paulburton@kernel.org, Jonathan Corbet , Mauro Carvalho Chehab , Masahiro Yamada , X86 ML , John Fastabend , Russell King , linux-riscv , Christian Borntraeger , Ingo Molnar , linux-arm-kernel , Catalin Marinas , "Naveen N . Rao" , Jakub Kicinski , Tobias Klauser , linux-mips@vger.kernel.org, grantseltzer@gmail.com, Xi Wang , Albert Ou , Kees Cook , Vasily Gorbik , Luke Nelson , LKML , Heiko Carstens , ppc-dev , KP Singh , iecedge@gmail.com, Simon Horman , Borislav Petkov , Alexander Viro , Yonghong Song , Thomas Gleixner , Dmitry Vyukov , tsbogend@alpha.franken.de, Daniel Borkmann , Hideaki YOSHIFUJI , Network Development , David Ahern , Wang YanQing , Martin KaFai Lau , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Palmer Dabbelt , bpf , Jianlin Lv , "David S. Miller" References: <20210415093250.3391257-1-Jianlin.Lv@arm.com> <9c4a78d2-f73c-832a-e6e2-4b4daa729e07@iogearbox.net> <0dea05ba-9467-0d84-4515-b8766f60318e@csgroup.eu> <58296f87-ad00-a0f5-954b-2150aa84efc4@isovalent.com> From: Christophe Leroy Message-ID: <52171382-1eca-58e2-b3d1-b2cc6b431e27@csgroup.eu> Date: Fri, 14 May 2021 08:34:07 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <58296f87-ad00-a0f5-954b-2150aa84efc4@isovalent.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Le 23/04/2021 à 12:26, Quentin Monnet a écrit : > 2021-04-23 09:19 UTC+0200 ~ Christophe Leroy > > [...] > >> I finally managed to cross compile bpftool with libbpf, libopcodes, >> readline, ncurses, libcap, libz and all needed stuff. Was not easy but I >> made it. > > Libcap is optional and bpftool does not use readline or ncurses. May I > ask how you tried to build it? > >> >> Now, how do I use it ? >> >> Let say I want to dump the jitted code generated from a call to >> 'tcpdump'. How do I do that with 'bpftool prog dump jited' ? >> >> I thought by calling this line I would then get programs dumped in a way >> or another just like when setting 'bpf_jit_enable=2', but calling that >> line just provides me some bpftool help text. > > Well the purpose of this text is to help you find the way to call > bpftool to do what you want :). For dumping your programs' instructions, > you need to tell bpftool what program to dump: Bpftool isn't waiting > until you load a program to dump it, instead you need to load your > program first and then tell bpftool to retrieve the instructions from > the kernel. To reference your program you could use a pinned path, or > first list the programs on your system with "bpftool prog show": > > > # bpftool prog show > 138: tracing name foo tag e54c922dfa54f65f gpl > loaded_at 2021-02-25T01:32:30+0000 uid 0 > xlated 256B jited 154B memlock 4096B map_ids 64 > btf_id 235 Got the following error: root@vgoip:~# ./bpftool prog show libbpf: elf: endianness mismatch in pid_iter_bpf. libbpf: failed to initialize skeleton BPF object 'pid_iter_bpf': -4003 Error: failed to open PID iterator skeleton Christophe