PAPI on CentOS 5.5 setup memo @2011/01/31:


PAPI: papi-4.1.2.1.tar.gz

[PAPI Installation note]

I tryed to install PAPI in a Cent OS 5.5 PC box.

OS: Cent OS 5.5

The Linux kernel supported in Cent OS 5.5 is rather old kernel 2.6.18. Since PAPI(Performance API) requires hardware performance monitoring functionality, PerfCtr or Perf Events for Linux on Intel CPUs, Thus I installed the Linux kernel version 2.6.37 which officially supports Perf Events system, and we need not patch the perfctr patch, contained in PAPI source dirs, to the kernel source.

Kernel: linux-2.6.37.tar.bz2

In order to upgrade Linux kernel for the Cent OS 5.5, there ware a couple of pitfalls to work with.

[Kernel Installation note]


Kernel Installation note and tips:

  1. Update your CentOS at latest status by using yum update command. We also need CentOS supported kernel, kernel-devel, kerenel-heders, complier systems, and libraly systems, etc.
  2. Check whether the updated system/kernel works or not by rebooting the system.

    At this point we have the fllowing packages (checked by "rpm -qa | grep kernel").

    We need "/usr/src/kernels/2.6.18-194.32.1.el5-x86_64/.config" to compile and set up the new kernel "linux-2.6.37.tar.bz2".

  3. Compile kernel "linux-2.6.37.tar.bz2".
  4. Install new kernel, kernel boot image disk, and kernel headers.

    Note: The following descriptions may have a risk destroying your system. Please do it your own risk.

  5. Modify boot up script (/etc/rc.sysinit) for rtc (hardware clock) incompatibility.

    The new kerenel rtc (hardware clock) module uses rtc_cmos module and produces /dev/rtc0 device file. The CentOS and its hwclock command assume the device should be /dev/rtc. (it seems /dev/rtc0 is automatically generated) When reboot the system with new kernel, the system cannot recover the system time from the hardware clock and shows incorrect time (time zone) without /dev/rtc file. The boot up script /etc/rc.sysinit should be properly modified to avoid this issue before reboot the system as follows. (Be sure to back up original files)

    The original lines of /etc/rc.sysinit:
    (Line#)
        268  echo -en $"\t\tPress 'I' to enter interactive startup."
        269  echo
        270 fi
        271 
        272 # Set the system clock.
        273 update_boot_stage RCclock
        274 ARC=0
      
    is modified to:
    (Line#)
        268  echo -en $"\t\tPress 'I' to enter interactive startup."
        269  echo
        270 fi
        271 
        272 #####################################################
        273 # Added for kernel 2.6.37
        274 if [ ! -f /proc/driver/rtc ]; then
        275     action $"Loading rtc_cmos driver: " /sbin/modprobe rtc_cmos
        276 fi
        277 
        278 ### ELREPO: Make the newer device nodes to accomodate hwclock
        279 RTC_MAJOR_NO=`/bin/awk '/rtc/ { print $1 }' /proc/devices`
        280 if [ -n "$RTC_MAJOR_NO" ]; then
        281     action $"Creating /dev/rtc0: " /bin/mknod /dev/rtc0 c $RTC_MAJOR_NO 0
        282     action $"Creating /dev/rtc: " /bin/ln -sf /dev/rtc0 /dev/rtc
        283 fi
        284 # end add
        285 #####################################################
        286 
        287 # Set the system clock.
        288 update_boot_stage RCclock
        289 ARC=0
      

    If /dev/rtc0 is automatically generated by modprobe, the line 280 can be commented out.

  6. Modify udev set up definition file (/dev/udev/rules.d).

    The new kernel has an inconsistency to the original CentOS udev rules (at leaset in my case), and may produce the "wait_for_sysfs: waiting for '/sys/devices/pci0000:00/0000:00:10.0/host0/ioerr_cnt' failed" errors when rebooting the system. I modified the udev set up rules.

    The original lines of /etc/udev/rules.d/05-udev-early.rules:

    (Line#)
          1 # sysfs is populated after the event is sent
          2 ACTION=="add", DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
          3 ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
          4 ACTION=="add", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt"                    
      
    is modified to:
    (Line#)
          1 # sysfs is populated after the event is sent
          2 ACTION=="add", DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
          3 ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
          4 #ACTION=="add", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt"
          5 ACTION=="add", SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt"
      

Refs. on kernel compilation and installation. [1], [2], [3], [4].

Ref. on rtc. [5].

Ref. on wait_for_sysfs errors. [6].


PAPI Installation note:

After upgrading the CentOS kernel. PAPI can be installed using Perf Event functionality of the new kernel.

  1. Obtain PAPI source files from [http://icl.cs.utk.edu/papi/].
  2. Simply follow the install instructions described in the README/INSTALL.txt files in the source tar.gz file.

Refs. on PAPI. [http://icl.cs.utk.edu/papi/], [papi@mikiwiki].


[TOP]