From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by sourceware.org (Postfix) with ESMTPS id 687F93844079 for ; Fri, 3 Jul 2020 20:42:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 687F93844079 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dxu@dxuuu.xyz Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 9A1396C2; Fri, 3 Jul 2020 16:42:30 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 03 Jul 2020 16:42:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h= content-transfer-encoding:content-type:subject:from:to:date :message-id:in-reply-to; s=fm3; bh=LzyJ7hl+FIM5ttc7ClNLxDI6RtFN2 ZWj8r+ndL6yEtg=; b=oBFFbLcXSJo3WyV0G9ulYNSF4GG9DiQJ8Y2thDwq4ivMt kPR6peOqxRCR4fbSNbn8Pxk+wgaqqRuKIe8hYCdiGsW7q0+bsCoXOU44dHhpwIRl HMKARMlIfWA4cazhcUDigrHkaYBFO7URL2HLyRP7oCZZHY8I03ln7ZgROuqLbkvV uONlhkHfCSqwlokczgpKt0OBTaEygJB2GRXx+ogk5fAC/nmp/uQnRx6In/LPMpd7 OH3bKsZzuAq2lIcRLuavvhLdlYvjD0wpKBQs8LxFDIdvyrBqboLpVb3zvP4lf3fN h8dzKyMYfEwweSwhHlbKk0RzsjkGQHeHi4hLV/sjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=LzyJ7h l+FIM5ttc7ClNLxDI6RtFN2ZWj8r+ndL6yEtg=; b=SIaU1/jJgXCrCUBXRl5ohu ON+Dw5hdCzc0Pu6Bfc+OGMJkZNvruFYkpzxK6TaBoMkWMoPijkma69wF7vF0Ot5G rrp3iBGxc6Ws/h1bC+KI8LlCqSh35ALOd09SDC4tpEGa791W07N1pCGKWxR+NwJB ohyJ54f1rNoVP2a5esKW7O/QWO79A34NAtRRGNAVjqOzOtpN8m01Or38CblALojr Me/umQlavzMxPWcXGYMSoYIpx5aSNRjRU5u8Fxkk7If4gG9ntXfRo0mCumjA2TtT huBih2sgyGUG8ZSaUpUkQ9OBjpg4pfdSuEcKjI89n1yZ6tZJeV+udJgWJPdqaAPA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrtdeigdduheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpefgtgfuhffvfffkjgesthhqredttddtjeen ucfhrhhomhepfdffrghnihgvlhcuighufdcuoegugihusegugihuuhhurdighiiiqeenuc ggtffrrghtthgvrhhnpeelveefleekvefgjeehgfekkefhvdeufeduieejieeghfdvffdv keehgeetgffhjeenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppeejfedrle efrddvgeejrddufeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Received: from localhost (c-73-93-247-134.hsd1.ca.comcast.net [73.93.247.134]) by mail.messagingengine.com (Postfix) with ESMTPA id 9446D3060069; Fri, 3 Jul 2020 16:42:29 -0400 (EDT) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH V3 0/3] eBPF support From: "Daniel Xu" To: "Jose E. Marchesi" , Date: Fri, 03 Jul 2020 13:37:40 -0700 Message-Id: In-Reply-To: <20200703124650.15272-1-jose.marchesi@oracle.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, JMQ_SPF_NEUTRAL, KAM_INFOUSMEBIZ, PDS_OTHER_BAD_TLD, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2020 20:42:34 -0000 Hi Jose, On Fri Jul 3, 2020 at 5:46 AM PDT, Jose E. Marchesi via Gdb-patches wrote: > [Changes from V2: > - Urgh, V2 contained a patch still too big for mailman. In this > version I am splitting the simulator part in two commits. Thunks > for fully generated configure files are still removed.] > > Hi good peoples! > > This patch series adds support for the eBPF virtual architecture to > GDB [1]. > > The first patch contains the basic bits to GDB in order to support the > bpf-unknown-none target. Breakpointing and instruction > single-stepping works, but the debugging support in eBPF is still very > minimal. This is mainly due to the many limitations imposed by the > architecture (disjoint stack, maximum stack size, etc). We are > working to overcome these limitations, by introducing a variant called > xbpf, already supported in GCC with the -mxbpf option, whose purpose > is to ease debugging and to be used in other contexts different than > the Linux kernel, less restrictive. > > The second patch adds a basic CGEN-based instruction simulator for > eBPF. It can run many eBPF programs and works well with GDB. A > testsuite covering the supported instructions is also included. We > will be expanding it in order to emulate the several kernel contexts > in which eBPF programs can run, so eBPF developers can use GDB to > debug their programs without having to load them in a running kernel. > Currently the only kernel helper implemented in the simulator is > printk, which is used by the tests. > > We of course commit to maintain and evolve this stuff :) > > [1] Support for eBPF has been already added to both binutils and GCC. This is quite exciting for bpf developers. Are there any instructions on how to test this out? Here's what I've tried so far after I applied your patches: (gdb) file ~/dev/libbpf-rs/target/bpf/runqslower.bpf.o Reading symbols from ~/dev/libbpf-rs/target/bpf/runqslower.bpf.o... (gdb) run Starting program: /home/daniel/dev/libbpf-rs/target/bpf/runqslower.bpf.= o zsh:1: permission denied: /home/daniel/dev/libbpf-rs/target/bpf/runqslo= wer.bpf.o During startup program exited with code 126. (gdb) info file Symbols from "/home/daniel/dev/libbpf-rs/target/bpf/runqslower.bpf.o". Local exec file: `/home/daniel/dev/libbpf-rs/target/bpf/runqslower.bpf.o', file = type elf64-little. Entry point: 0x0 0x00000000 - 0x00000000 is .text 0x00000000 - 0x00000080 is tp_btf/sched_wakeup 0x00000080 - 0x00000100 is tp_btf/sched_wakeup_new 0x00000100 - 0x00000348 is tp_btf/sched_switch 0x00000348 - 0x000003a0 is .maps 0x000003a0 - 0x000003a4 is license The program I'm trying to "debug" can be found here: https://github.com/libbpf/libbpf-rs/tree/master/example [...] Thanks, Daniel