From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBZNg-0005HI-7k for qemu-devel@nongnu.org; Tue, 11 Sep 2012 18:56:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBZNc-0003ze-LO for qemu-devel@nongnu.org; Tue, 11 Sep 2012 18:56:32 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:53701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBZNc-0003zV-Et for qemu-devel@nongnu.org; Tue, 11 Sep 2012 18:56:28 -0400 Received: by pbbrp12 with SMTP id rp12so1544743pbb.4 for ; Tue, 11 Sep 2012 15:56:27 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <504F62F5.2090302@twiddle.net> References: <504F62F5.2090302@twiddle.net> Date: Tue, 11 Sep 2012 15:56:27 -0700 Message-ID: From: Xin Tong Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] TCG questions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel On Tue, Sep 11, 2012 at 9:12 AM, Richard Henderson wrote: > On 09/10/2012 08:17 PM, Xin Tong wrote: >> I have 2 questions about TCGv. >> >> 1. if DEBUG is enabled on TCGv, TCGv is wrapped in a C struct. and >> would it not be very expensive to pass TCGv by copy for all the >> tcg_gen_xxx functions.i.e. tcg_gen_mov_tl(cpu_cc_src, cpu_T[1]); > > No. The compiler is (generally) able to look through a struct with > a single member. > >> 2. I have created some files that need to include tcg-op.h and cpu.h ( >> i use TCGv in the files). since cpu.h are architecture specific. what >> do i put as the include path and how i should organize the files so >> that the correct architecture specific cpu.h gets picked up. i tried >> many things. but it seems none of them works very well. > > You've not provided enough details to give a meaningful answer. I have created a set of instrument API on QEMU. one can write client programs that compile into shared library. the shared library is then loaded into qemu and extract statistics out of QEMU. Basically when QEMU translates the guest ISA to emulation code. it pushes some of the value (i.e. virt address, phys address of a memory access) of interested into a structure in the CPUState. Some of the files in the instrumentation module depends on TCGv. i just want to find a way to include the tcg-op.h. it is not easy as it is architecture dependent. Xin > > > r~ >