qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: seabios@seabios.org, qemu-devel <qemu-devel@nongnu.org>,
	Gleb Natapov <gleb@redhat.com>, Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] Hack integrating SeaBios / LinuxBoot option rom with QEMU trace backends
Date: Mon, 10 Oct 2011 13:53:33 -0500	[thread overview]
Message-ID: <4E933F2D.7090703@codemonkey.ws> (raw)
In-Reply-To: <20111010170803.GV9408@redhat.com>

On 10/10/2011 12:08 PM, Daniel P. Berrange wrote:
> I've been investigating where time disappears to when booting Linux guests.
>
> Initially I enabled DEBUG_BIOS in QEMU's hw/pc.c, and then hacked it so
> that it could print a timestamp before each new line of debug output. The
> problem with that is that it slowed down startup, so the timings I was
> examining all changed.
>
> What I really wanted was to use QEMU's trace infrastructure with a simple
> SystemTAP script. This is easy enough in the QEMU layer, but I also need
> to see where time goes to inside the various BIOS functions, and the
> options ROMs such as LinuxBoot. So I came up with a small hack to insert
> "probes" into SeaBios and LinuxBoot, which trigger a special IO port
> (0x404), which then cause QEMU to emit a trace event.
>
> The implementation is really very crude and does not allow any arguments
> to be passed each probes, but since all I care about is timing information,
> it is good enough for my needs.
>
> I'm not really expecting these patches to be merged into QEMU/SeaBios
> since they're just a crude hack&  I don't have time to write something
> better. I figure they might be useful for someone else though...
>
> With the attached patches applied to QEMU and SeaBios, the attached
> systemtap script can be used to debug timings in QEMU startup.
>
> For example, one execution of QEMU produced the following log:
>
>    $ stap qemu-timing.stp
>    0.000 Start
>    0.036 Run
>    0.038 BIOS post
>    0.180 BIOS int 19
>    0.181 BIOS boot OS
>    0.181 LinuxBoot copy kernel
>    1.371 LinuxBoot copy initrd

Yeah, there was a thread a bit ago about the performance of the interface to 
read the kernel/initrd.  I think at it was using single byte access instructions 
and there were patches to use string accessors instead?  I can't remember where 
that threaded ended up.

CC'ing Gleb and Alex who may recall more.

Regards,

Anthony Liguori


>    1.616 LinuxBoot boot OS
>    2.489 Shutdown request
>    2.490 Stop
>
> showing that LinuxBoot is responsible for by far the most execution
> time (~1500ms), in my test which runs for 2500ms in total.
>
> Regards,
> Daniel

  reply	other threads:[~2011-10-10 18:53 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10 17:08 [Qemu-devel] Hack integrating SeaBios / LinuxBoot option rom with QEMU trace backends Daniel P. Berrange
2011-10-10 18:53 ` Anthony Liguori [this message]
2011-10-10 19:01   ` Alexander Graf
2011-10-11  8:23     ` [Qemu-devel] Slow kernel/initrd loading via fw_cfg; Was " Daniel P. Berrange
2011-10-11  8:43       ` Richard W.M. Jones
2011-10-11  9:15       ` Avi Kivity
2011-10-11  9:19         ` Alexander Graf
2011-10-11  9:26           ` Avi Kivity
2011-10-11  9:38             ` Alexander Graf
2011-10-11  9:49               ` Avi Kivity
2011-10-11  9:56                 ` Gleb Natapov
2011-10-11  9:59                   ` Avi Kivity
2011-10-11 10:28                     ` Gleb Natapov
2011-10-11 13:12               ` Anthony Liguori
2011-10-11 13:14                 ` Alexander Graf
2011-10-11 13:17                   ` Gleb Natapov
2011-10-11 13:19                   ` Anthony Liguori
2011-10-11 13:23                     ` Avi Kivity
2011-10-11 13:24                       ` Gleb Natapov
2011-10-11 13:29                       ` Anthony Liguori
2011-10-11 13:45                         ` Avi Kivity
2011-10-11 13:58                           ` Anthony Liguori
2011-10-11 14:01                     ` Daniel P. Berrange
2011-10-11 14:33                       ` Anthony Liguori
2011-10-11 14:34                         ` Alexander Graf
2011-10-11 14:36                         ` Daniel P. Berrange
2011-10-11  9:50             ` Gleb Natapov
2011-10-11  9:55               ` Avi Kivity
2011-10-11 13:17                 ` Anthony Liguori
2011-10-11 13:22                   ` Gleb Natapov
2011-10-15 14:19                   ` Kevin O'Connor
2011-10-11  9:27         ` Daniel P. Berrange
2011-10-11  9:39           ` Avi Kivity
2011-10-11  9:49             ` Daniel P. Berrange
2011-10-11  9:50               ` Avi Kivity
2011-10-11 10:09                 ` Daniel P. Berrange
2011-10-15 10:00       ` Blue Swirl
2011-10-15 16:16         ` Richard W.M. Jones
2011-10-16 17:20           ` Lluís Vilanova
2011-10-11  9:08     ` [Qemu-devel] " Avi Kivity
2011-10-11  9:18       ` Daniel P. Berrange
2011-10-11  9:35         ` Avi Kivity
2011-10-10 23:57 ` Kevin O'Connor

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=4E933F2D.7090703@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=agraf@suse.de \
    --cc=berrange@redhat.com \
    --cc=gleb@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.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).