Trace Documents
formats & techniques
Trace Tools
programs & code
Traces
get traces
Mailing List
contact info
PEL Homepage
laboratory info

Seize: Linux Device Driver

The Seize device driver is written as a dynamic kernel module, easily loaded and unloaded from the kernel. This driver was developed with kernel 2.2.5, but should work correctly with the entire 2.2.x series and beyond. A CIO-DIO24 digital I/O board made by Computer Boards, Inc. was used as the halting device. The device and device driver are configured to access ports at address 0x300-0x307 and use interrupt 7.

Once the module is compiled ('gcc -c -O seize.c'), it can be loaded into a running kernel with the command 'insmod seize.o'. It can be removed from the kernel with the command 'rmmod seize'.

In order for halting to be enabled, the seize device must be opened. The following application illustrates how this can be done.

The processor's cache can be turned on or off programmatically by sending the device the appropriate ioctl, as illustrated by the following applications:

In order for the applications to work, a node named "seize" must exist in /dev with the correct major number. The major number can be found by examining the /proc/devices file after inserting seize.o into the kernel with insmod. To create the node, 'mknod /dev/seize c ${MAJOR_NUMBER} 0' where $MAJOR_NUMBER is the number listed by seize in /proc/devices. If the major number changes, in subsequent usage of the module, you will need to 'rm /dev/seize' and then make the node again with the correct major number.

Once the module is loaded and opened, the machine can be halted by sending the appropriate interrupt to the board. To bring the machine out of seizure, pin 2 of port A is asserted high. You can test it manually by asserting pin 2 of port A (pin 36 on our board) high to low, then assert the IR (pin 1 on our board) high to low. To bring it out of seizure, assert pin 2 of port A high again.

The I/O board is connected to a Tektronix Logic Analyzer, model TLA 720 as shown in the following diagram:

A state machine for the logic analyzer can be developed which will collect traces from the CPU until its buffer fills, then halt the machine to upload the trace data to secondary storage, then unhalt the machine again and begin tracing again. The state machine we use is shown below:

state machine not yet available


© 2000, Performance Evaluation Laboratory, Brigham Young University. All rights reserved. Reproduction of all or part of this work is permitted for educational or research use provided that this copyright notice is included in any copy. Send comments to webmaster@pel.cs.byu.edu.

This material is based upon work supported by the National Science Foundation under Grant No. 9807619. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.