Ubuntu11.10(oneiric) compile the kernel with utrace patches first prepare the Linux kernel compilation environment: sudo apt-GetInstall Fakeroot build-essential crash kexec-tools makedumpfile Kernel-wedge kernel-Packagesudo Apt-Getbuild-dep Linuxsudo Apt-GetInstall Git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-Dev checks out the official kernel code with the Utrace patch and generates the corresponding Ubuntu current version kernel (3.0) Patch: Git clone https://github.com/utrace/linux.git utrace-linux-gitCD utrace-linux-git/git checkout-B utrace-3.0origin/utrace-3.0git diff v3.0>/tmp/Utrace.patch get Ubuntu custom kernel code and hit the Utrace patch sudo apt-GetInstall linux-Sourcetar XJF/usr/src/linux-source-3.0.0. TAR.BZ2CD Linux-source-3.0.0/Patch-p1 </tmp/utrace.patch Output is: Patching file documentation/docbook/makefilepatching File Documentation/docbook/utrace.tmplpatching file Arch/x86/kernel/ptrace.cpatching file FS/proc/array.cpatching file include/linux/ptrace.hpatching file include/linux/Sched.hhunk #1Succeeded at187(offset3lines). Hunk #2Succeeded at206(offset3lines). Hunk #3Succeeded at1415With Fuzz2(offset7lines). patching file include/linux/signal.hpatching file include/linux/tracehook.hpatching file include/linux/utrace.hpatching file init/Kconfighunk #1Succeeded at388(offset -lines). patching file Kernel/makefilepatching file Kernel/Fork.chunk #1FAILED at168. Hunk #2Succeeded at1098(offset3lines).1 outOf2Hunks FAILED--saving rejects to file kernel/fork.c.rejpatching file Kernel/ptrace.cpatching file Kernel/sched.cpatching file Kernel/Signal.chunk #4Succeeded at1993(Offset-2lines). Hunk #5Succeeded at .(Offset-2lines). Hunk #6Succeeded at2124(Offset-2lines). Hunk #7Succeeded at2132(Offset-2lines). patching file Kernel/utrace.c Note Kernel/FORK.C's patch failed, look at kernel/.Fork.c.rej:---kernel/fork.c+ + kernel/fork.c @@-168,6+168,7@@ Free_thread_info (tsk-stack); Rt_mutex_debug_task_free (TSK); Ftrace_graph_exit_task (TSK); +Tracehook_free_task (TSK); Free_task_struct (TSK); } export_symbol (Free_task); Modify Kernel/fork.c, the Ftrace_graph_exit_task (tsk) of the Free_task function, and then manually add this line of Tracehook_free_task calls. To compile the new kernel, using the configuration parameters of the current system kernel as a benchmark, turn on the Config_utrace functionality provided by the Utrace Patch: CP/boot/config-' uname-R '. Configmake oldconfig, answer y:infrastructure when prompted as follows forTracing and debugging User processes (Utrace) [n/y/?] (NEW) make-kpkg cleanexport concurrency_level=9, which specifies the number of concurrent tasks when compiling the kernel, set to the number of cores +1 can fakeroot make-kpkg--INITRD--append-to-version=-utrace binary-after the arch compilation is complete, the Linux-source-3.0.0/The parent directory will generate Linux-headers/image/debug-symbol's Deb installation package, directly with sudo dpkg-i *. Deb installation. After reboot, select the new kernel to enter the user-state program tracking using SYSTEMTAP. Reference: https://Help.ubuntu.com/community/kernel/compile#alternate_build_method:_the_old-fashioned_debian_way
On Ubuntu 11.10 (oneiric), compile the kernel with Utrace patch