For problems or questions, please e-mail lkst-develop@lists.sourceforge.net For bugs, please submit a bug via the project page: https://sourceforge.net/projects/lkst/ Prerequisites ============= 1. Linux Kernel State Tracer software: Patch for the Linux kernel v2.4.19: lkst-1.3.1.linux24.patch.gz Userspace tools RPM: lkstutils-1.3.1-1.i386.rpm These are available from the project page. 2. Kernel Hooks software: Patch for the Linux kernel v2.4.19: kernelhooks-1.7-2.4.19.patch.gz These is available from the project page. 3. Linux Kernel Crash Dump software: Patch for the Linux kernel v2.4.19: lkcd-2.4.19-1.patch.gz Userspace tools RPM: lkcdutils-4.1-1.i386.rpm These are available from the project page. 4. Linux kernel version 2.4.19 - linux-2.4.19.tar.gz can be downloaded from ftp.kernel.org/pub/linux/kernel/v2.4 Installation ============ 0) Prepare archives ------------------------------------------------------------ 1. cd $(SOMEWHERE_KERNEL) 2. Untar Linux source tar -xzvf linux-2.4.19.tar.gz 1) Build and Install Kernel patch for kernel versions 2.4.19 ------------------------------------------------------------ 1. Log in as root 2. Issue command to patch kernel for Kernel Hooks cd $(SOMEWHERE_KERNEL)/linux zcat kernelhooks-1.7-2.4.19.patch.gz | patch -p 1 3. Issue command to patch kernel for LKCD cd $(SOMEWHERE_KERNEL)/linux zcat lkcd-2.4.19-1.patch.gz | patch -p 1 4. Issue command to patch kernel for LKST cd $(SOMEWHERE_KERNEL)/linux zcat lkst-1.3.1.linux24.patch.gz | patch -p 1 5. Build kernel a. make menuconfig b. Under "Kernel hacking", select the following: i. Select "y" for "Linux Kernel Crash Dump (LKCD) Support". ii. Select "y" for "Kernel debugging". iii. Select "y" for "Magic SysRq key". iv. Select "m" for "Kernel State Tracing (LKST)". v. Select "y" for "Kernel Hook Support". vi. Configure other kernel config settings as needed. c. Save and Exit d. make dep e. make clean f. make bzImage g. make modules h. make modules_install 6. cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.19-lkst131 7. cp System.map /boot/System.map-2.4.19-lkst131 8. cp Kerntypes /boot/Kerntypes-2.4.19-lkst131 9. rm /boot/System.map 10. rm /boot/Kerntypes 11. ln -s /boot/System.map-2.4.19-lkst131 /boot/System.map 12. ln -s /boot/Kerntypes-2.4.19-lkst131 /boot/Kerntypes 13. Modify /etc/lilo.conf to boot from /boot/vmlinuz-2.4.19-lkst131 14. Run /sbin/lilo to read modified lilo.conf 15. reboot 2) Install the userspace tools using RPM ---------------------------------------- 1. Log in as root 2. Download lkstutils-1.3-1.i386.rpm 3. Issue the following command: rpm -i lkstutils-1.3-1.i386.rpm 3) Install the lkcdutils tools -------------------------------------- 1. Log in as root 2. Download lkcdutils-4.1-1.i386.rpm 3. Issue the following command: rpm -i lkcdutils-4.1-1.i386.rpm 4) Install addon tools [Optional] -------------------------------------- 1. Log in as root 2. Download lkstaddons.tar.gz 3. Untar source tar -xzvf lkstaddons.tar.gz 4. cd $(SOMEWHERE_LKSTADDONS)/addons 5. Build and install a. autoconf b. ./configure --with-ksrc=$(SOMEWHERE_KERNEL)/linux c. make d. make install IMPORTANT!!! Also You must build them after the kernel was built. 5) Configure your system ------------------------ To load lkst module, issue following command: insmod lkst Make a lkst device node. a. refer /proc/devices the number in the left of "lkst" is the major number. b. make a node using the major number in $(MAJOR). mknod /dev/lkst c $(MAJOR) 0 If you want to configure lkst module, you will need to add the following lines to /etc/modules.conf(or /etc/conf.modules): alias lkst lkst options lkst lkst_init_buffer_size=65536 Also see the following section on the module parameter. NOTE: For the configuration of LKCD, see LKCD documents which can be downloaded at http://lkcd.sourceforge.net/ 5) Kernel parameter --------------------- The following kernel parameter can be passed: lkst_maxvm= Use integer value for LKST available memory size. Users can use up to this value as amount of memory size for LKST. If omitted, 1/10 of physical memory size can be used. 6) Module parameter --------------------- The following module parameter can be passed: lkst_init_buffer_size= Use integer value for logging buffer size(in byte). You can use the value larger than 8192. Default value is 65536. If amount of buffer size is larger than LKST available memory described above, the size is set as default value. example: insmod lkstmod lkst_init_buffer_size=1048576 NOTE!!! If you specify a value, kernel memory will be used by the value. So you may avoid specifying large value.