Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzI2B-0002R5-M8 for qemu-devel@nongnu.org; Tue, 06 Apr 2010 19:18:15 -0400 Received: from [140.186.70.92] (port=46903 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzI29-0002Qx-VW for qemu-devel@nongnu.org; Tue, 06 Apr 2010 19:18:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzI27-0002DU-GN for qemu-devel@nongnu.org; Tue, 06 Apr 2010 19:18:13 -0400 Received: from web43135.mail.sp1.yahoo.com ([216.252.121.65]:43484) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1NzI27-0002DC-4P for qemu-devel@nongnu.org; Tue, 06 Apr 2010 19:18:11 -0400 Message-ID: <744151.25169.qm@web43135.mail.sp1.yahoo.com> References: <639622.90232.qm@web43140.mail.sp1.yahoo.com> Date: Tue, 6 Apr 2010 16:18:08 -0700 (PDT) From: =?iso-8859-1?Q?Boris_C=E1mara?= Subject: Res: [Qemu-devel] full dynamic instruction trace for MIPS target In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1694909956-1270595888=:25169" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vince Weaver Cc: qemu-devel@nongnu.org --0-1694909956-1270595888=:25169 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi Vince, =0AThe aproach you are using on http://www.csl.cornell.edu/~vince= /projects/qemu-trace/ to get the PC dump is similar to mine but as you dont= disable the TB caches It is not a full execution trace. You only dump the = PC when they are compiled and inserted on the TB cache. When qemu needs to= execute the same code again, tb_find_slow() will find it was cached so yo= ur code wont dump the executed PCs again beacuse tb_gen_code() wont be ca= lled this time.=0A=0AOn http://www.csl.cornell.edu/~vince/projects/qemus= im/ I found the same logic because you call the helper function inside of g= en_intermediate_code_internal() which is called by tb_find_slow() too.=0A= =0ASo, as far as i understand if tb_find_slow() find the previously cached= PC on the TB vector, your dump_pc() helper functions will not be called ag= ain for this TB.=0A=0ADid you get correct values for your counters in bbvs[= bb] ?=0A=0AI didnt run your patch yet so I m not sure that I said is 100% = correct. :)=0A=0A=0A=0A=0A=0A________________________________=0ADe: Vince W= eaver =0APara: Boris C=E1mara =0ACc: qemu-devel@nongnu.org=0AEnviadas: Segunda-feira, 5 de Abril de 2010= 22:41:52=0AAssunto: Re: [Qemu-devel] full dynamic instruction trace for MI= PS target=0A=0A=0A> I think the correct way to get the full instruction tra= ce on a MIPS =0A> emulated processor is:=0A=0Athe way you describe is slow = because you are constantly re-generating the =0ATBs. The best way to do th= is is to add your instrumentation to the TBs.=0A=0AI have code that does th= at for a recent version of Qemu here:=0A http://www.csl.cornell.edu/~vince= /projects/qemusim/=0A=0Aalthough it outputs Basic-Block vectors, not a full= memory trace like you =0Awant. It has been validated to match proper inst= ruction counts using =0Ahardware performnce counters though.=0A=0AI also ha= ve code creating full instruction/memory traces for Qemu MIPS =0Athat can b= e found here:=0A http://www.csl.cornell.edu/~vince/projects/qemu-trace/=0A= =0Abut it's against Qemu from 2007 pre-dating the TCG changeover so of =0Al= imited use probably. I hvae some code somewhere that updated this to =0Awo= rk with TCG but I don't know what happened to it.=0A=0AVince=0A=0A=0A = ___________________________________________________________________________= _________=0AVeja quais s=E3o os assuntos do momento no Yahoo! +Buscados=0Ah= ttp://br.maisbuscados.yahoo.com --0-1694909956-1270595888=:25169 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Vince,
The aproach you are using on http://www.= csl.cornell.edu/~vince/projects/qemu-trace/ to get the PC dump is simil= ar to mine but as you dont disable the TB caches It is not a full execution= trace. You only dump the PC when they are compiled and inserted on the TB= cache. When qemu needs to execute the same code again, tb_find_slow() will= find it was cached so your code wont dump the executed PCs again beacuse = tb_gen_code()  wont be called this time.

On    http://www.csl.cornell.edu/~vince/projects/qemusim/ I found the sam= e logic because you call the helper function inside of gen_intermediate_code_internal() which is called by tb_find_slow() too.
So, as far as i understand if tb_find_slow() find the  previously= cached PC on the TB vector, your dump_pc() helper functions will not be ca= lled again for this TB.

Did you get correct values for your counters= in bbvs[bb] ?

I didnt run your patch yet so I m not sure that I sa= id is 100% correct. :)



De: Vince Weaver = <vince@csl.cornell.edu>
Para= : Boris C=E1mara <vesmar@rocketmail.com>
Cc: qemu-devel@nongnu.org
Enviadas: Segunda-feira, 5 de Abril d= e 2010 22:41:52
Assunto: Re: = [Qemu-devel] full dynamic instruction trace for MIPS target

<= br>> I think the correct way to get the full instruction trace on a MIPS=
> emulated processor is:

the way you describe is slow becaus= e you are constantly re-generating the
TBs.  The best way to do th= is is to add your instrumentation to the TBs.

I have code that does = that for a recent version of Qemu here:
  http://www.csl.c= ornell.edu/~vince/projects/qemusim/

although it outputs Basic-Bl= ock vectors, not a full memory trace like you
want.  It has been v= alidated to match proper instruction counts using
hardware performnce c= ounters though.

I also have code creating full instruction/memory tr= aces for Qemu MIPS
that can be found here:
  http://www.csl.cornell.edu/~vince/projects/qemu-trace/
<= br>but it's against Qemu from 2007 pre-dating the TCG changeover so of
= limited use probably.  I hvae some code somewhere that updated this to=
work with TCG but I don't know what happened to it.

Vince


=0A

=0A=0A=0A
Veja quais s= =E3o os assuntos do momento no Yahoo! + Buscados: Top 10 = - Celebridades - M= =FAsica - Esportes --0-1694909956-1270595888=:25169--