VCreate Logic has provided a vast number of clients with services which are appreciated and used. Every client we possess is a relationship for us.
more...
Downloads
        
        
Qpu Interrupt Handler


 
 
QPUInterrupt
Back to OSS Home
QpuInterruptHandler is a class that helps Qt programs to receive an intimation when an interrupt occurs. QpuInterruptHandler does this by working in tandem with a kernel module (qpu_irq_reporter) and Qt's QSocketNotifier class.

The QpuInterruptHandler project consists of the following

The qpu_irq_reporter device driver. This module provides a character device driver that is at the heart of this project. It assumes the following responsibilities

It records information about interrupts as and when they occor in the system.
It provides a character device interface using which user space programs can register the IRQs they are interested in. qpu_irq_reporter reports interrupt occurance events for only those IRQs that are registered by the user program.
It implements the poll method of the character device driver so that user space programs can synchronously poll for interrupt occurances

QpuInterruptHandler class which

Provides methods for registering and unregistering IRQ's
Uses QSocketNotifier to poll for interrupt occurance events reported by the qpu_irq_reporter device driver. Since QSocketNotifier works with Qt's event loop; we can be sure that QpuInterruptHandler does not __interrupt__ Qt programs; but only reports interrupt occurances in a synchronous manner

QpuInterruptToSignal class which

Is a subclass of QpuInterruptHandler
Emits a signal each time an interrupt occurance is detected

Using the classes and device driver described above; an example program was written which allows IRQ occurance inspection. Take a look at the screenshot below.


User can select (list box on the left) the IRQ's he is interested in; and the graph on the right graphs the rate of occurance of the IRQ's. I know the UI is not very informative; but the example program is only used for demonstration.

Download and Install

Before reading ahead download a copy of QpuInterruptHandler project: qpuirq.tar.gz. After downloading the tar.gz file; untar it and you will get two directories
kmodule: Kernel Module for the qpu_irq_reporter device driver
sources: Implementation of QpuInterruptHandler and QpuInterruptToSignal classes (along with the example program)

Compiling The Kernel Module (qpu_irq_reporter)
The kernel module is in the kmodule subdirectory of this directory. To compile the kernel module in this directory execute the following command
[root@localhost ]$ cd ./kmodule[root@localhost ]$ make -C <kernel-source-directory-path> SUBDIRS=`pwd` modules
Just replace <kernel-source-directory-path> with the absolute path to the directory where you have the kernel sources installed on your system.

On my system I have kernel sources installed here /usr/src/kernels/2.6.11-1.1369_FC4smp-i686/, so the command I use is

[root@localhost ]$ make -C /usr/src/kernels/2.6.11-1.1369_FC4smp-i686/ SUBDIRS=`pwd` module
Loading the Kernel Module
Once the module is compiled then execute the following command
[root@localhost ]$ insmod qpu_irq_reporter.ko
Creating Device Node for accessing the module
Use the following command to find out the major number of the device you have just loaded
[root@localhost ]$ cat /proc/devices | grep "qpu_irq_reporter"
Create a device node for that device and enable permission for read/write access for that device
[root@localhost ]$ mknod /dev/qpu_irq_reporter c <major_number> 0[root@localhost ]$ chmod a+rw /dev/qpu_irq_reporter
Building and Running the Qt Program

The Qt program is in the ./sources subdirectory. To compile and run the program use the following commands

[user@localhost ]$ cd ./sources
[user@localhost ]$ qmake
[user@localhost ]$ make
[user@localhost ]$ ./sources
OSS Home | VTK Designer | GCF | QpuListView | QpuGenericSignalSpy
Copyright 2007© VCreate Logic Private Limited. All Rights Reserved.