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

Disk Trace Tools

Linux Disk Trace Buffer

  • Kernel Modifications

    • Generic Instructions

      • Download Kernel 2.4.13 from kernel.org and install it (consult your distribution's documentation and/or kernel docs on installing a custom kernel).
      • Apply dtb patch 2.4.13 with 'patch -p0 < dtb-2.4.13.patch' from the appropriate directory.
      • Configure your kernel with BYU Disk Tracing enabled as a module (consult the kernel docs/howto).
      • Rebuild your kernel (consult your distribution's documentation and/or kernel docs/howto on rebuilding a kernel, including reinstalling the bootloader if necessary).

      These instructions also work for kernel 2.4.6 with patches dtb-2.4.6.patch (IDE only) and dtb-2.4.6-1.1.patch (SCSI added). The 2.4.6 patches should work for higher kernels too, with one modification.


    • For Redhat 7.1:

      1. Download Kernel 2.4.6 from kernel.org
      2. Remove the linux symbolic link from /usr/src with the command 'rm /usr/src/linux'.
      3. Move to the /usr/src directory ('cd /usr/src').
      4. Unpack kernel 2.4.6. For example, 'tar xvzf /tmp/linux-2.4.6.tar.gz'.
      5. Rename linux to linux-2.4.6-dtb ('mv linux linux-2.4.6-dtb').
      6. Make a symbolic link name 'linux' to the new kernel ('ln -s linux-2.4.6-dtb linux').
      7. Download the IDE disk tracing patch and the SCSI disk tracing patch to the /usr/src/ directory. (NOTE about the IDE patch.)
      8. Apply the IDE patch with 'patch -p2 < dtb-2.4.6.patch'.
      9. Apply the SCSI patch with 'patch -p0 < dtb-2.4.6-1.1.patch'.
      10. Make a symbolic link from /usr/src/linux/include/linux to /usr/include/linux.
      11. Make a symbolic link from /usr/src/linux/include/asm to /usr/include/asm.
      12. Run make xconfig (or config or menuconfig). The last option should be BYU Disk Tracing. Install it as a module.
      13. Make the kernel: 'make dep; make bzImage; make modules; make modules_install'.
      14. Copy the kernel image to /boot: cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.6-dtb. If you have SCSI drives, you may also need to make an initial ramdisk with mkinitrd -- see your documentation for details.
      15. Edit /etc/lilo.conf by adding the following:
        image=/boot/vmlinuz-2.4.6-dtb label="DTB Linux" read-only root=/dev/<insert your root partition here, hda1, hdc3, etc> Change the default, if desired, from default=linux to default="DTB Linux". If you have SCSI devices, you may also need to add an initrd= parameter.
      16. Run lilo: /sbin/lilo
      17. Reboot it.


    • To add SCSI tracing capability:

      • If you have already installed the IDE patch:
        1. Download the SCSI patch to the /usr/src/ directory.
        2. Apply the patch with 'patch -p0 < dtb-2.4.6-1.1.patch'.
        3. Make the kernel: 'make dep; make bzImage; make modules; make modules_install'.
        4. Copy the kernel image to /boot: cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.6-dtb.
        5. Run lilo: /sbin/lilo
        6. Reboot.
      • Otherwise, look at Redhat 7.1.


    • For Redhat 7.0:

      1. Download Kernel 2.4.0-test9 from kernel.org (other versions will not work with this patch).
      2. Install the kernel-headers-2.4.0-0.26 package from your RedHat 7.0 distribution.
      3. Remove the linux symbolic link from /usr/src with the command 'rm /usr/src/linux'.
      4. Move to the /usr/src directory ('cd /usr/src').
      5. Unpack kernel 2.4.0-test9. For example, 'tar xvzf /tmp/linux-2.4.0-test9.tar.gz'.
      6. Rename linux to linux-2.4.0-test9-dtb ('mv linux linux-2.4.0-test9-dtb').
      7. Make a symbolic link name 'linux' to the new kernel ('ln -s linux-2.4.0-test9-dtb linux').
      8. Download the disk tracing patch to the /usr/src/ directory.
      9. Apply the patch with 'patch -p0 < dtb-2.4test9.patch'.
      10. You may wish to change the default compiler as suggested by Redhat, by modifying the Makefile line which says CC = $(CROSS_COMPILE)gcc to CC = $(CROSS_COMPILE)kgcc.
      11. Rename the /usr/include/linux directory to /usr/include/linux-2.4.0-0.26.
      12. Make a symbolic link from /usr/src/linux/include/linux to /usr/include/linux.
      13. Rename the /usr/include/asm directory to /usr/include/asm-2.4.0-0.26.
      14. Make a symbolic link from /usr/src/linux/include/asm to /usr/include/asm.
      15. Make the kernel: 'make dep; make bzImage; make modules; make modules_install'. (note: if you need to make customizations with make xconfig, make sure to add a line to .config after you save your configuration which says, CONFIG_DTB=y)
      16. Copy the kernel image to /boot: cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.0-t9dtb. If you have SCSI drives, you may also need to make an initial ramdisk with mkinitrd -- see your documentation for details.
      17. Edit /etc/lilo.conf by adding the following:
        image=/boot/vmlinuz-2.4.0-t9dtb label="DTB Linux" read-only root=/dev/<insert your root partition here, hda1, hdc3, etc> Change the default, if desired, from default=linux to default="DTB Linux". If you have SCSI devices, you may also need to add an initrd= parameter.
      18. Run lilo: /sbin/lilo
      19. Reboot it.
      20. You may need to run depmod ('depmod -a'), and/or recompile dtb.c. You can recompile dtb by touching dtb.c, then re-issuing make modules and make modules_install.


    • For Redhat 6.2:

      1. Download Kernel 2.4.0-test9 from kernel.org (other versions will not work with this patch).
      2. Remove the linux symbolic link from /usr/src with the command 'rm /usr/src/linux'.
      3. Move to the /usr/src directory ('cd /usr/src').
      4. Unpack kernel 2.4.0-test9. For example, 'tar xvzf /tmp/linux-2.4.0-test9.tar.gz'.
      5. Rename linux to linux-2.4.0-test9-dtb ('mv linux linux-2.4.0-test9-dtb').
      6. Make a symbolic link name 'linux' to the new kernel ('ln -s linux-2.4.0-test9-dtb linux').
      7. Download the disk tracing patch to the /usr/src/ directory.
      8. Apply the patch with 'patch -p0 < dtb-2.4test9.patch'.
      9. Make a symbolic link from /usr/src/linux/include/linux to /usr/include/linux.
      10. Make a symbolic link from /usr/src/linux/include/asm to /usr/include/asm.
      11. Make the kernel: 'make dep; make bzImage; make modules; make modules_install'. (note: if you need to make customizations with make xconfig, make sure to add a line to .config after you save your configuration which says, CONFIG_DTB=y)
      12. Copy the kernel image to /boot: cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.0-t9dtb. If you have SCSI drives, you may also need to make an initial ramdisk with mkinitrd -- see your documentation for details.
      13. Edit /etc/lilo.conf by adding the following:
        image=/boot/vmlinuz-2.4.0-t9dtb label="DTB Linux" read-only root=/dev/<insert your root partition here, hda1, hdc3, etc> Change the default, if desired, from default=linux to default="DTB Linux". If you have SCSI devices, you may also need to add an initrd= parameter.
      14. Run lilo: /sbin/lilo
      15. Reboot it.
      16. You may need to run depmod ('depmod -a'), and/or recompile dtb.c. You can recompile dtb by touching dtb.c, then re-issuing make modules and make modules_install.


  • Loading the DTB module

    • To load the module:
      • Redhat 7.1: insmod dtb
      • Redhat 7.0 and 6.2: insmod /lib/modules/2.4.0-test9/kernel/drivers/dtb/dtb.o
      • To unload the module: rmmod dtb
      • Using the DTB module

        1. Load the module. Do this the first time after you install it.
        2. Start dtbd in the background. This program can be used to continuously read and save a trace to disk. If used, the trace should be saved to a different physical disk than the one being traced, so as not to bias the results.
        3. Start toggleTracing for the device that you're interested in. This program is used to start and stop tracing on a specific device.

        • dtbprinter can be used to print a trace after it has been collected.
        • dtb.h is required for all of the preceding programs.

© 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.