Message ID | cover.1665287884.git.research_trasio@irq.a4lg.com |
---|---|
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C4E123858413 for <patchwork@sourceware.org>; Sun, 9 Oct 2022 03:59:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4E123858413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665287969; bh=YJltJu4dZSZkKp5pLrZEUBrCA0M1He+uqn4883O3EFU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=hnSVJ9Ffe2R49vzl3gCviddAv6bhpuiAFQJM+7bBCIoTzsFl7ynhJMzmEzBaM+EU0 hsHQ2hvqvfO/sjdlZRUT7MmCSfYKwOHHcludq+65q3cW8OyIZzmbsNoiaRmM8Hvo/V mVQc2B/M1aN7X3s+kGMPKfKjiRza31gRcvUhR/PQ= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 0E6423858CDB for <gdb-patches@sourceware.org>; Sun, 9 Oct 2022 03:59:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0E6423858CDB Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 6552B300089; Sun, 9 Oct 2022 03:59:05 +0000 (UTC) To: Tsukasa OI <research_trasio@irq.a4lg.com>, Andrew Burgess <aburgess@redhat.com>, Palmer Dabbelt <palmer@dabbelt.com> Subject: [RFC PATCH 0/1] gdb/riscv: Cache per-BFD disassembler Date: Sun, 9 Oct 2022 03:59:02 +0000 Message-Id: <cover.1665287884.git.research_trasio@irq.a4lg.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Tsukasa OI via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Tsukasa OI <research_trasio@irq.a4lg.com> Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
gdb/riscv: Cache per-BFD disassembler
|
|
Message
Tsukasa OI
Oct. 9, 2022, 3:59 a.m. UTC
Hello, On RISC-V, calling the disassembler function (libopcodes) is not a small cost. This is because riscv_get_disassembler function sets the default architecture from given BFD's .riscv.attributes section. However, by default, GDB calls this function for every instruction. This commit replaces RISC-V's disassembler function and stop calling riscv_get_disassembler function if current BFD has not changed. It expects around 30-80% improvements on disassembling relatively large chunk of RISC-V code but most of them will be obscured by a RISC-V disassembler optimization the author is currently working on. Still, 3-5% of performance improvements will remain (due to reduced BFD section reads). [REQUEST FOR COMMENTS] I'm confident that most of BFD contents won't change so dynamically on GDB and caching itself is not a bad idea. Still, I'm not sure whether this usage of "static" variables is okay. I would like to hear your thoughts. Thanks, Tsukasa Tsukasa OI (1): gdb/riscv: Cache per-BFD disassembler gdb/riscv-tdep.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) base-commit: c10a862f17847bc9c50d680c87b87dc51ae4b95e