Performance Inspector Tools Installation with Kernel Rebuild

Multiple Platform Version(kernel patch)
You must be able to build AND boot a stock kernel BEFORE using this package! Please see http://mirrors.kernel.org/LDP/HOWTO/Kernel-HOWTO/index.html for detailed information. Also, you can see the build hints page.

Note: This package supports multiple platforms. This package contains the Performance Inspector tools (piperf) and two patch files, kernel and driver. The kernel patch is a hardware specific patch that install "hooks" in the dispatch, interrupt, fork,exec,timer and vma routines. The driver patch contains the Performance Inspector device driver code that takes advantage of the kernel hooks.



Alternatively, the kernel rebuild instructions may be used to supplement the dynamic package support. After rebuilding the kernel with the required support, revisit the dynamic package documentation linux_dynamic.html.


Current support delivered in this package

i386 ia64 x86_64 ppc64 390x s390
SuSE U.L. 1.0 2.4.19
2.4.20
2.4.21
2.4.19
2.4.21
2.4.21 2.4.19 2.4.19 2.4.19
SuSE 9.0 2.4.21 NP 2.6.3-7 UD NP NP
RH E 2.0 2.4.2020-9 NP NP NP NP NP
RH E 3.0 2.4.21-9 NP 2.4.21-9 NP NP NP
RH E 3.0 Update 2 2.4.21-15-EL NP 2.4.21-15-EL 2.4.21-15-EL NP NP
RH ws 9.0 UD NP UD UD NP NP
kernel.org 2.4.22 NP NP NP NP NP


UD - Under Development, NP - Not Planned.


Index:
Download
Untar the tools
Patching the kernel
Building the kernel
Installing the kernel
Using Java
Installing the tools
Pre-built kernels


Download the package perfinsp:


Untar the package

untar the package pi.package.2004-11-18.tar.gz using the following command:

tar -xzf pi.package.2004-11-18.tar.gz

This will untar piinstall and pipatch_tools.tar.gz

Then execute ./piinstall this will setup a directory and untar all of the package. It is assumed that the kernel source is located in a directory called /usr/src/linux. If the kernel source is not installed here, then create a soft link with this name to the kernel source. Type info ln in a window to see how to create a soft link.
 


Patching the kernel

You must be able to build AND boot a stock kernel BEFORE using this package! Make a backup of your kernel source!!!!
http://mirrors.kernel.org/LDP/HOWTO/Kernel-HOWTO/index.html

Always make a backup of your original kernel tree! cp -r /usr/src/linux /usr/src/linux.org

The patch file is located in a sub directory called patches in the directory where the tools were installed. Assuming that the tools were installed in /piperf then the kernel patch file would be located in /piperf/patches. Go to the kernel source directory by entering the command: cd /usr/src/linux Next apply the Linux Performance Inspector kernel patch by entering the command that matches your kernel:

patch --strip 1 --verbose </piperf/patches/i386/pi.SuSE.2419.patch >../patch.out

patch --strip 1 --verbose </piperf/patches/ia64/pi.SuSE.2419.patch >../patch.out

patch --strip 1 --verbose </piperf/patches/ppc64/pi.SuSE.2419.patch >../patch.out

patch --strip 1 --verbose </piperf/patches/x86_64/pi.SuSE.2421-69.patch >../patch.out


Note: The above patch commands are examples, locate the patch that matches your environment "/piperf/patches/$HOSTTYPE". The results of the patch is placed in file called /usr/src/patch.out. Check this file for any patch failures.  This can be done by using the grep command as follows

   grep -i fail ../patch.out


Patching the driver

The driver patch contains the common Performance Inspector device driver code, it produces the /usr/src/linux/drivers/pi_inspector directory. From "/usr/src/linux" enter the following command.
patch --strip 1 --verbose </piperf/patches/pi.driver.2004-11-18.patch > ../driver.log

The results of the patch is placed in file called /usr/src/driver.log. Check this file for any patch failures.  This can be done by using the grep command as follows:

   grep -i fail ../driver.log
 
Note: for 2.6 kernels only;

cd drivers/pi_inspector
cp Makefile.2.6 Makefile


Building the kernel
If no lines are returned, then the patch was applied successfully.

After the patch successfully installed, the kernel source needs to be configured. Enter one of the following commands:

make xconfig
          or
make menuconfig


make xconfig is used if you are in a window on the linux desktop, where as make menuconfig is used if you running  in a full screen text window.

When the configuration menu appears, there will be an option called Performance Inspector. Select this option and select the 'y' option for  Enable Performance Probes.

Return to the main menu. Set up any additional configuration options needed for the system and then Save and Exit the Linux Kernel Configuration screen,

Note: On SuSE systems that require RAS hooks, they must be built into the kernel.(Kernel Hacking-> Kernel Hook Support->RAS Instrumentation Hooks). DO NOT SELECT "Kernel Hook Support" AS A MODULE)


To build the new kernel, enter the following:

On on i386 and x86_64:
make dep bzImage modules modules_install

On ia64
make dep compressed modules modules_install

On ppc
make dep vmlinux modules modules_install

On ppc64
make dep CROSS_COMPILE=powerpc64-linux- SUBARCH=ppc64 ARCH=ppc64 EXTRAVERSION=-ul1$my_EXTRAVERSION zImage

On s390 and s390x
make dep image modules modules_install


Installing the kernel

When the kernel has been successfully built, copy it to the /boot directory as follows:

 
On i386 and x86_64:
cp arch/i386/boot/bzImage /boot/piperf.bzImage
 
On x86_64:
cp arch/x86_64/boot/bzImage /boot/piperf.bzImage

On ia64
cp vmlinux.gz /boot/piperf.vmlinuz

On ppc
cp arch/ppc64/boot/vmlinux /boot/piperf.vmlinux

On ppc64
cp arch/ppc64/boot/zImage /boot/piperf.zImage

On s390 and s390x
cp arch/s390/boot/image /boot/image
cp arch/s390/boot/*.boot /boot
cp System.map /boot

If you do not build in /usr/src/linux you should make a "usr/src/linux soft link that points to your build. We use this path to look for kernel symbols.


At this point you will need to make a initrd.img if you are using modules in your initial boot process. This step varies from RedHat to SuSE, see "man mkinitrd" for system specific instructions. It's always a good idea to name it using your kernel version.

 Next update the boot manager configuration file for the kernel you just copied to the /boot directory. It is always a good idea to name your kernel something other than the standard "vmlinux" name and then make a new entry in the boot manager. If your kernel fails to boot you can boot from the original kernel.



Reboot the system with the new patched kernel. Then go to the /piperf/bin directory as follows:


Also, you might wish to examine HINTS from John Kacur.

Using Java

To build the Java tools you must first install the IBM Developer Kit for Linux®, Java™ 2 Technology Edition http://www-106.ibm.com/developerworks/java/jdk/linux140 .

IBM Developer Kit for Linux, Java 2 Technology Edition for 32-bit pSeries & iSeries


After it is installed make sure all of the Java paths are set:

example:
export PATH=/opt/IBMJava2-14/bin:$PATH


Then export "JDKDIR"; our install uses this to indicate if you are using Java.
export JDKDIR=/opt/IBMJava2-14

If you are using a 64 bit java; export "JAVA64"; our install uses this to indicate iif you are using a 64 bit Java.
export JAVA64=64


If JDKDIR is not set our build process WILL NOT build the Java support library and class files.
Note: libjprof32.so is produced by the build process, it can be run with the IBMJava2-14 and IBMJava2-13 runtimes, but only built with IBMJava2-14.

Installing the tools

   cd /piperf/bin

  ./tinstall

Note: On IA32 RedHat system make sure the environment variable HOSTTYPE is set to i386. It is recommended to reset it even if it is set correctly.
export HOSTTYPE=i386

This will compile the performance tools driver and install it. When this step is complete, the performance tools are ready to be used. Execute ". setrunenv" to set up the performance Inspector paths. On subsequent boots of the system and in every terminal window where the tools will be used, you need to perform the following commands:

   cd /piperf/bin
   . setrunenv

This will load the performance tools driver if it is not already loaded and setup the correct operating environment.

The driver can be manually loaded and unload by using the following commands:

  drvinst          /* Loads the driver   */
  dremove       /* Removes the driver */


Pre-Built kernels
Kernels built by University of Illinois

RedHat EL 3.0 Update 1 (i386)

Note: These kernels are provided AS-IS. Do NOT try to contact the University of Illinois for support!
Tools Home   ]