public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* running systemtap on qemu
@ 2005-09-28 16:40 William Cohen
  2005-09-28 17:59 ` James Dickens
  0 siblings, 1 reply; 2+ messages in thread
From: William Cohen @ 2005-09-28 16:40 UTC (permalink / raw)
  To: SystemTAP

[-- Attachment #1: Type: text/plain, Size: 217 bytes --]

I am probably not the only one that doesn't always have a spare machine 
handy to try something out on. Tuesday I set up an FC4 image on QEMU on 
my FC3 laptop. I have attached a writeup describing what I did.

-Will

[-- Attachment #2: qemu-systemtap.txt --]
[-- Type: text/x-diff, Size: 4323 bytes --]

SystemTap on The QEMU x86 emulator

Sometime you don't have a machine handy you can use for experiments
that may crash the machines or require a specific distribution of
Linux. You can use the QEMU x86 emulator
(http://fabrice.bellard.free.fr/qemu/) as a sandbox to try simple
SystemTap experiments without worrying about crashing the
machine. However, do not expect this to be fast.  This write-up
describes how I installed QEMU on my laptop, made a Fedora Core 4 image, and installed the additional SystemTap software.

Building and Installing QEMU

First step is to obtain and build the QEMU emulator. The source code
can be obtained from
http://fabrice.bellard.free.fr/qemu/download.html. Download
qemu-0.7.2.tar.gz and and unpack the source code. Go into the
directory qemu-0.7.2 directory:

./configure
make
make install

At this point QEMU is available on the machine.


Creating FC4 Image

The next step is to set up a FC4 image. For this you will need a file
to act as the virtual disk drive and the ISO image for the FC4 DVD.  A
8Gigabyte virtual disk drive file can be created for QEMU with:

qemu-img create qemu-fc4.img 8G

The FC4 DVD ISO,FC4-i386-DVD.iso, can be obtained from:

http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/iso/FC4-i386-DVD.iso

Now you can install FC4 on the virtual disk drive with QEMU. QEMU can
grab the mouse and keyboard, you can toggle back to the regular system
with <cntl>-<alt>. Start the installation with:

qemu -boot d -cdrom FC4-i386-DVD.iso qemu-fc4.img

This will boot off the DVD iso. Now you can do the normal installation
using the normal defaults for things. When selecting packages at a
minimum SystemTap will need the kernel-devel and the gcc compiler
packages. The "Workstation" installation should be sufficient; to keep
the amount of space required down and reduce the installation time
avoid an "everything" install. Refer to the following URL for more information
about installation:

http://fedora.redhat.com/docs/fedora-install-guide-en/fc4/

The installation of the packages will take a while.  Allow the RPM
install to complete. When asked select the reboot and go through the
normal first boot. After this you have an FC4 image you can play with
on QEMU. You will need to shut down the system in the normal manner,
e.g. selecting shutdown on log out.  To restart the FC4 image you use
the following command:

qemu   qemu-fc4.img

You will want to update the packages in the FC4. The machine
will need a network connection to connect to the YUM repository. Log
in as root on the FC4 system running on QEMU. Open a terminal and run
the upgrade:

yum update

This will take a while to download the header information for the
packages. Then it will ask whether you want to download the
packages. Answer "y" to start the download. When YUM starts the actual
update it will get the key to verify the packages are
uncorrupted. Again answer "y" to download the key.  Let the system
install the updated packages. Once the update is complete some space
can be recoverd by removing the rpms in
/var/cache/yum/updates-released/packages.

Reboot the system to use the current kernel. Log in as root to
finished the installation.  Install the needed kernel-debuginfo with:

yum install kernel-debuginfo

To install the systemtap RPM use:

sudo yum --enablerepo=updates-testing install systemtap

At this point you should be able to run the simple.stp probe from the tests:

probe begin
{
        log("systemtap starting probe")
}

probe end
{
        log("systemtap ending probe")
}


With the following command:

stap simple.stp

You should see the "systemtap starting probe" when it starts running
and the "systemtap ending probe" when you hit control-c.

You can download the current sources and tests for systemtap with:

cvs -d :pserver:anoncvs@sources.redhat.com:/cvs/systemtap login
{enter "anoncvs" as the password}
cvs -d :pserver:anoncvs@sources.redhat.com:/cvs/systemtap co src tests

Assuming that the dejagnu RPM is installed you can go into the
tests/testsuite directory and run the tests with:

runtest --tool=systemtap

It is not speedy. On a 2GHz AMD64 laptop it took about 10 minutes to
run the current set of tests. However, it does beat crashing my laptop
when reading email or hauling around a separate machine to try things
out on.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: running systemtap on qemu
  2005-09-28 16:40 running systemtap on qemu William Cohen
@ 2005-09-28 17:59 ` James Dickens
  0 siblings, 0 replies; 2+ messages in thread
From: James Dickens @ 2005-09-28 17:59 UTC (permalink / raw)
  To: William Cohen; +Cc: SystemTAP

On 9/28/05, William Cohen <wcohen@redha.com> wrote:
> I am probably not the only one that doesn't always have a spare machine
> handy to try something out on. Tuesday I set up an FC4 image on QEMU on
> my FC3 laptop. I have attached a writeup describing what I did.
>
> -Will
>

great idea, i use a trial version of vmware and get faster results but
same intent

[snip]
> The next step is to set up a FC4 image. For this you will need a file
> to act as the virtual disk drive and the ISO image for the FC4 DVD.  A
> 8Gigabyte virtual disk drive file can be created for QEMU with:
>
> qemu-img create qemu-fc4.img 8G

i have found that you can get by with  a 4G disk if you follow my
recomendations outlined below.

>
> The FC4 DVD ISO,FC4-i386-DVD.iso, can be obtained from:
>
> http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/iso/FC4-i386-DVD.iso
>
> Now you can install FC4 on the virtual disk drive with QEMU. QEMU can
> grab the mouse and keyboard, you can toggle back to the regular system
> with <cntl>-<alt>. Start the installation with:
>
> qemu -boot d -cdrom FC4-i386-DVD.iso qemu-fc4.img
>
> This will boot off the DVD iso. Now you can do the normal installation
> using the normal defaults for things. When selecting packages at a
> minimum SystemTap will need the kernel-devel and the gcc compiler
> packages. The "Workstation" installation should be sufficient; to keep
> the amount of space required down and reduce the installation time
> avoid an "everything" install. Refer to the following URL for more information
> about installation:
>
i use a custom install,  no X, nothing extra just develepopment tools.

> http://fedora.redhat.com/docs/fedora-install-guide-en/fc4/
>
> The installation of the packages will take a while.  Allow the RPM
> install to complete. When asked select the reboot and go through the
> normal first boot. After this you have an FC4 image you can play with
> on QEMU. You will need to shut down the system in the normal manner,
> e.g. selecting shutdown on log out.  To restart the FC4 image you use
> the following command:
>
> qemu   qemu-fc4.img
>

> You will want to update the packages in the FC4. The machine
> will need a network connection to connect to the YUM repository. Log
> in as root on the FC4 system running on QEMU. Open a terminal and run
> the upgrade:
>
> yum update

this is over kill, you can get by with just following these instructions

http://sources.redhat.com/ml/systemtap/2005-q3/msg00470.html

a bit more steps, but it ends up being much faster.

James Dickens
uadmin.blogspot.com


[snip]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-28 17:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-28 16:40 running systemtap on qemu William Cohen
2005-09-28 17:59 ` James Dickens

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 read-only IMAP folder(s) and NNTP newsgroup(s).