qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yufei Chen <cyfdecyf@gmail.com>
To: Eduardo Cruz <eduardohmdacruz@gmail.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	Mulyadi Santosa <mulyadi.santosa@gmail.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] memory trace with qemu
Date: Mon, 26 Jul 2010 10:05:44 +0800	[thread overview]
Message-ID: <AANLkTikBBHauDXtEK793aNONf7P_DEA-AmLCmD7XQJSW@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimE+p9s=mge2+dSUJcVajFV3xkd0SKt9v+X4yiu@mail.gmail.com>

On Mon, Jul 26, 2010 at 6:21 AM, Eduardo Cruz <eduardohmdacruz@gmail.com> wrote:
> Thanks for your awnsers. Stean, after I find the right place to capture the
> reads and writes I'll definitely try your trace tool.
> Until now, this is what i found:
>
> I am using the x86-64 target, and I know that, for instance, lots of reads
> pass here:
> target-i386/translate.c   gen_op_ld_T1_A0()
> This function calls gen_op_ld_v, that calls a tcg function according to the
> operand size.
> Lets assume tcg_gen_qemu_ld8u() is called, which is defined at tcg/tcg-op.h
> Here I find myself lost again, because this function (in i386)
> calls tcg_gen_op3i_i32, which APPARENTLY does nothing...
> Where the code that access the main memory is being generated?

Please take a look at tcg_out_qemu_ld and tcg_out_qemu_st, also take a
look at tcg_out_op.

> 2010/7/24 Stefan Hajnoczi <stefanha@gmail.com>
>>
>> On Sat, Jul 24, 2010 at 3:17 AM, Yufei Chen <cyfdecyf@gmail.com> wrote:
>> > On Fri, Jul 23, 2010 at 2:15 PM, Stefan Hajnoczi <stefanha@gmail.com>
>> > wrote:
>> >> On Fri, Jul 23, 2010 at 4:12 AM, Mulyadi Santosa
>> >> <mulyadi.santosa@gmail.com> wrote:
>> >>> Hi...
>> >>>
>> >>> On Fri, Jul 23, 2010 at 05:30, Eduardo Cruz
>> >>> <eduardohmdacruz@gmail.com> wrote:
>> >>>> Hello, I need qemu to keep track of all the memory access made by the
>> >>>> guest,
>> >>>> including read, write and the instruction fetches.
>> >
>> > I don't think Qemu can provide cycle number information. But other
>> > information are all available.
>> >
>> >>>
>> >>> AFAIK there are lots of experiments on this and has produces working
>> >>> patches...at least from the posting of the creator. There is even a
>> >>> patch floating to start creating trace framework a while ago.
>> >>
>> >> Thanks Mulyadi, I think you are referring to the tracing work that
>> >> Prerna Saxena and I are doing.  Here is the documentation:
>> >>
>> >> http://repo.or.cz/w/qemu/stefanha.git/blob/tracing:/docs/tracing.txt
>> >>
>> >> The patches apply to qemu.git.  You can define trace events in the
>> >> trace-events file and then call them from places in the code.  There
>> >> is a script to pretty-print the binary trace file that QEMU produces.
>> >>
>> >> Eduardo, if you think this might be what you're looking for, please
>> >> give it a try.  I am on #qemu and #kvm IRC if you need any help.  Any
>> >> feedback will be valuable to us as we prepare these patches for
>> >> submission to qemu.git.
>> >>
>> >> I believe the tracing framework answers the "Any ideas of how I can
>> >> record these information with qemu?" part of your question :).  I
>> >> don't have experience in the TCG, so I can't give advice on how to
>> >> best get at the memory accesses, but I hope this helps you one step
>> >> further.
>> >>
>> >
>> > Can this framework trace memory access event? I guess this would be
>> > more difficult to do in KVM than in TCG.
>>
>> No, it can't trace memory accesses.  It provides you with the ability
>> to put trace events into QEMU, but there is current no pre-defined
>> trace event for memory access.
>>
>> If you find the right spot to in TCG it should be easy to add a trace
>> event there.  I agree, with KVM is would be more difficult and perhaps
>> defeat the point of KVM :).
>>
>> Stefan
>>
>> >> Stefan
>> >>
>> >>> perhaps you could dig a little deeper in qemu archieve....?
>> >>>
>> >>> --
>> >>> regards,
>> >>>
>> >>> Mulyadi Santosa
>> >>> Freelance Linux trainer and consultant
>> >>>
>> >>> blog: the-hydra.blogspot.com
>> >>> training: mulyaditraining.blogspot.com
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Best regards,
>> > Chen Yufei
>> >
>
>
>
> --
> Eduardo Henrique Molina da Cruz
> MSc student
> Parallel and Distributed Processing Group
> Federal University of Rio Grande do Sul (UFRGS)
>
>



-- 
Best regards,
Chen Yufei

  reply	other threads:[~2010-07-26  2:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 22:30 [Qemu-devel] memory trace with qemu Eduardo Cruz
2010-07-23  3:12 ` Mulyadi Santosa
2010-07-23  6:15   ` Stefan Hajnoczi
2010-07-23  7:25     ` Mulyadi Santosa
2010-07-23  8:39       ` Stefan Hajnoczi
2010-07-23 19:24         ` Mulyadi Santosa
2010-07-23  7:34     ` Jun Koi
2010-07-23  8:43       ` Stefan Hajnoczi
2010-07-24  2:17     ` Yufei Chen
2010-07-24  9:05       ` Stefan Hajnoczi
2010-07-25 22:21         ` Eduardo Cruz
2010-07-26  2:05           ` Yufei Chen [this message]
2010-07-26 10:20           ` Lluís
2010-07-26 10:57             ` Eliot Moss
2010-07-26 11:16               ` malc
2010-07-26 12:41                 ` Lluís
2010-07-27  0:24                 ` Jun Koi
2010-07-27  6:46                   ` malc
2010-08-11 17:26                     ` Eduardo Cruz
2010-07-26 14:27             ` Yufei Chen
2010-07-26 17:32               ` Eduardo Cruz
2010-07-26 21:44                 ` Lluís
2010-07-26 22:16                   ` Eduardo Cruz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikBBHauDXtEK793aNONf7P_DEA-AmLCmD7XQJSW@mail.gmail.com \
    --to=cyfdecyf@gmail.com \
    --cc=eduardohmdacruz@gmail.com \
    --cc=mulyadi.santosa@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).