From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17130 invoked by alias); 23 Oct 2013 08:29:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 17116 invoked by uid 89); 23 Oct 2013 08:29:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Oct 2013 08:29:09 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VYtoP-0006VC-QU from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 23 Oct 2013 01:29:05 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 23 Oct 2013 01:29:05 -0700 Received: from qiyao.dyndns.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Wed, 23 Oct 2013 01:29:05 -0700 From: Yao Qi To: Subject: [PATCH 0/5] Cache code access for disassemble Date: Wed, 23 Oct 2013 08:29:00 -0000 Message-ID: <1382516855-32218-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00709.txt.bz2 Hi, In general, this patch series improve the speed of disassemble in remote debugging, by means of caching code access. When I think about code cache, I realize not only code cache but also target_dcache can be per-address-space. OTOH, when the patch '[RFA] Use data cache for stack accesses' was reviewed, the intention of getting target_dcache per-address-space was mentioned, but it was not done because we don't have an address_space structure at that moment (2009-07). 'struct address_space' was added by multi-executable patch in 2009-09. Patch #1 adds REGISTRY for 'struct address_space' and patch #2 get variable 'target_dcache' per-address-space, and add a 'struct target_dcache' to hold all caches, which paves a way for code-cache. Patch #3 adds most of the stuff to cache code access, similar to the code cache stack access. Patch #4 is to use target_read_code to read code when doing disassembly. Patch #5 is the doc and news entry (mostly copied from 'set stack-cache'.). The performance is measured by disassembling three large functions in GDB (such as evaluate_subexp_standard) twice, and here is the result I got: The number of 'm' packets: Original Patched 83054 1257 74240 844 74240 844 Original Patched disassemble cpu_time 3.48 0.56 disassemble cpu_time 2.95 0.36 disassemble cpu_time 1.78 0.47 disassemble wall_time 6.07428908348 0.628926992416 disassemble wall_time 5.23267793655 0.413200855255 disassemble wall_time 3.2379360199 0.554491043091 disassemble vmsize 61152 61204 disassemble vmsize 61544 61596 disassemble vmsize 61544 61596 Regression tested on x86_64-linux. I also tried using target_read_code for skip_prologue, but the change is quite specific to each target (using target_read_code in *-tdep.c files for reading code). I plan to do it in next step. *** BLURB HERE *** Yao Qi (5): Add REGISTRY for struct address_space. Associate target_dcache to address_space. set/show code-cache Use target_read_code in disassemble. set/show code-cache NEWS and doc gdb/NEWS | 6 ++ gdb/disasm.c | 2 +- gdb/doc/gdb.texinfo | 10 ++++ gdb/progspace.c | 14 ++--- gdb/progspace.h | 22 +++++++- gdb/target.c | 148 +++++++++++++++++++++++++++++++++++++++++++++------ gdb/target.h | 5 ++ 7 files changed, 180 insertions(+), 27 deletions(-) -- 1.7.7.6