[patch] irq and softirq handler measurement

From: Samo Pogacnik
Date: Sun Mar 06 2005 - 19:19:10 EST



Hello,

I'd like to propose a modification of the linux kernel, which enables IRQ and
SOFTIRQ handler measurement. The patch currently covers only i386
architecture, but could be extented to other architectures as well.

I tried to measure time spent in mentioned hendler functions, by summarizing
times spent in every part of their execution. This means that a new nested
interrupt ends one part of time measurement for the first (previously
running) IRQ or SOFTIRQ and starts a new part of time measurement for the
second (newly started) IRQ.
It may not be the most optimal solution (suggestions are most welcome), but
it's been helpfull to me. Measurements may be usefull, for developing
new drivers or if you are optimising your system.

The linux (2.6.0-test11) patch has not been pasted at the end of the
following usage description, because it is quite long, so here is the URL:
http://friends.s5.net/pogacnik/patch-2.6.0-test11-usage-0.1.

=======================================================
Usage description:

1. Measure IRQ handlers

This option enables measurement of time spent in each IRQ handler.
Measured data is being displayed through the /proc/interrupts file. The CPU
usage mean value for each IRQ handler and the maximum continuous time spent
in each IRQ handler are being calculated for the time elapsed between two
subsequent reads of the /proc/interrupts file.

2. Measure SOFTIRQ handlers
This option enables measurement of time spent in each SOFTIRQ handler.
Measurement includes every tasklet, that is being registered for this measure
through the tasklet_register() function. The tasklet_init() calls register
tasklets automaticaly.
Measured data is being displayed through the /proc/softirqs file. The CPU
usage mean value for each SOFTIRQ handler and the maximum continuous
time spent in each SOFTIRQ handler are being calculated for the time elapsed
between two subsequent reads of the /proc/softirqs file. Additionally the
number of invocations for each SOFTIRQ handler (as well as for each tasklet)
is being displayed through the /proc/softirqs file.

3. The patch
This linux patch allows you to configure the kernel for compilation
without any of the above options.
First read of interrupts (or softirqs) file can not calculate CPU usage
correctly, because there is no previous time reference.
=======================================================

kind regards to all Linux developers, Samo Pogacnik

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/