qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Instruction counting instrumentation for ARM + initial patc


From: Timo Töyry
Subject: [Qemu-devel] Instruction counting instrumentation for ARM + initial patch
Date: Tue, 19 May 2009 17:59:57 +0300

Hi,

The attached patch implements instruction counting instrumentation for
ARM usermode linux. Currently the patch is a working draft but we
intend to clean it up for possible inclusion. We'd appreciate any
comments. Below is a more detailed description.

Motivation:
For some applications it is important to know what complex
instructions are used by the application. Also the data of used
instructions could be used to optimize the platform CPU in embedded
systems, e.g., choosing the most appropriate CPU for a specific task.

Implementation:
The instruction counters are implemented as extra guest CPU registers,
see target-arm/cpu.h:CPUARMState. The counter incrementation is done
by modifying decoder to generate TCG code to increment the counters.
The values of the counters are printed at guest exit (syscall
exit_group & al). The implementation is for arm-linux-user, but we
suppose this would be easily ported to other guest architectures, too.

Patch status:
The attached draft patch applies to 0.10.4. Currently it supports
armv6, vfp and thumb instructions. We'll probably add support for
neon (if we get permissions from ARM).

Todo:
- configure-support to enable/disable this feature at compile time
- extract instrumentation code from decoders, to better support re-use
  in other architectures
- selectable target (console/log-file) for outputting the values of
  the counters

Usage:
The instruction counting is enabled with command-line parameter
-instrcount. When the guest application exits the counter values are
printed to stderr. Example: qemu-arm -instrcount <some-arm-linux-binary>

This work is sponsored by Nokia / Maemo development team.

Regards,
Timo

-- 
Timo Töyry
Embedded Software Group / Helsinki University of Technology


Attachment: qemu-0.10.4-instrumentation-draft.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]