From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Marius Monton <Marius.Monton@uab.cat>
Subject: Re: [Qemu-devel] time inside qemu
Date: Tue, 17 Apr 2007 15:22:16 +0100 [thread overview]
Message-ID: <200704171522.17849.paul@codesourcery.com> (raw)
In-Reply-To: <4624D442.7000406@uab.cat>
> code (a) : for (int i = 0; i< 1000000; i++) c[i] = a[i] * b[i];
>
> code (b) : for (int i = 0; i< 1000; i++) for(int j = 0; j < b[i]; j++)
> c[i] += a[i];
>
> code (c) : for (int i = 0; i< 1000; i++) c[i] = HW_MUL(a[i], b[i]);
>
> I'm sure that code (b) will execute much longer that code (a) inside
> qemu (sure that different that in real platform), and I'd like to
> compute executing time for code (c) in some way.
> So, how can I trap time information/calculation inside qemu?
You can't.
As I've said before, any performance measurements you make inside qemu are
completely meaningless.
You may be able to say that executing 1000 iterations takes longer than 10
iterations of the same loop, but you didn't need a simulator to tell you
that. Also, there's a good chance qemu will take almost exactly the same time
to execute them because the execution time will be dominated by the
translation time for the first iteration.
You can not compare the cost of (say) add v.s. multiply, or of two different
multiply instructions. The timings for the individual instructions (or any
particular sequence of instructions) bear no relation whatsoever to the
timings for the same sequence on real hardware.
I'm repeating myself now, so I intend this to my my last response to this
thread.
Paul
next prev parent reply other threads:[~2007-04-17 14:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-29 16:22 [Qemu-devel] time inside qemu Màrius Montón
2006-12-29 17:43 ` Paul Brook
2006-12-29 17:53 ` Màrius Montón
2006-12-29 18:10 ` Paul Brook
2007-04-16 14:41 ` Marius Monton
2007-04-16 15:12 ` Paul Brook
2007-04-17 14:05 ` Marius Monton
2007-04-17 14:22 ` Paul Brook [this message]
2007-04-16 21:59 ` Eduardo Felipe
2006-12-31 14:52 ` Markus Schiltknecht
-- strict thread matches above, loose matches on Subject: below --
2006-12-29 11:13 Màrius Montón
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=200704171522.17849.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=Marius.Monton@uab.cat \
--cc=qemu-devel@nongnu.org \
/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).