From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KqZcF-0006KI-Ri for qemu-devel@nongnu.org; Thu, 16 Oct 2008 16:38:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KqZcF-0006Jj-2k for qemu-devel@nongnu.org; Thu, 16 Oct 2008 16:38:39 -0400 Received: from [199.232.76.173] (port=49883 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KqZcE-0006JK-M3 for qemu-devel@nongnu.org; Thu, 16 Oct 2008 16:38:38 -0400 Received: from yx-out-1718.google.com ([74.125.44.158]:29887) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KqZcD-0000eZ-Vm for qemu-devel@nongnu.org; Thu, 16 Oct 2008 16:38:38 -0400 Received: by yx-out-1718.google.com with SMTP id 3so48245yxi.82 for ; Thu, 16 Oct 2008 13:38:35 -0700 (PDT) Message-ID: <761ea48b0810161338w249329c4wfbe3c3d34c8a08ba@mail.gmail.com> Date: Thu, 16 Oct 2008 22:38:35 +0200 From: "Laurent Desnogues" Subject: Re: [Qemu-devel] [PATCH] Improve symbol lookup (was: Re: [Qemu-devel] [PATCH] Fix symbol lookup for mips64* targets) In-Reply-To: <48F79CB9.4090602@mail.berlios.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48E52067.6080408@mail.berlios.de> <48F79CB9.4090602@mail.berlios.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Thu, Oct 16, 2008 at 9:57 PM, Stefan Weil wrote: > > So I did. Here is a short summary of my new patch: > > * Use function pointers for symbol lookup (currently for elf32 and > elf64, could be expanded). > This also fixes the bug with mips elf64 symbols in current Qemu trunk. > > * Use quicksort and binary search for symbol lookup. > > * Remove unneeded entries from symbol table. > This reduced a typical table size (linux mips kernel) from 1764487 to > 11656 entries. > > * In disas.c, the patch also fixes some warnings from old fashioned > function prototypes. > > In loader.c, two defines control some compile time options (could be > removed in > production code): > #define CONFIG_BINARY_SYMBOL_SEARCH > #define CONFIG_REDUCE_SYMBOL_TABLE > > I tested the new code using 32 bit and 64 bit linux mips kernels and > Qemu logging (-d in_asm). > The speed improvement is extremely large - both because of the much > smaller table and > the binary search. Nice! Did you profile the time spent looking up symbols when running some big executable with a big symbol table? Laurent