dicksites / KUtrace

Low-overhead tracing of all Linux kernel-user transitions, for serious performance analysis. Includes kernel patches, loadable module, and post-processing software. Output is HTML/SVG per-CPU-core timeline that you can pan/zoom down to the nanosecond.
Other
625 stars 56 forks source link

Clarification for " Initial patched build" section in the KUTrace Install Manual #11

Open FabianSchuetze opened 1 month ago

FabianSchuetze commented 1 month ago

Thanks for your work . The book is a gem and I'm looking forward to trying to use KUTrace myself.

I don't follow fully the following install description:


(2) Initial patched build
Apply the patch file via
$ cd linux-6.6.36
$ patch -p1 kutrace_patch_file_6.6.36.txt

Can you please elaborate?

I have done patch -p1 --dry-run -i /home/fabian/Documents/work/github/KUtrace/linux/linux-6.6.36/kutrace_patch_file_6.6.36.txt while being in the root of the linux release downloaded in step 1 of the install instructions (home/fabian/Documents/work/github/linux-6.6.36). The dry run says:

➜  linux-6.6.36 patch -p1 --dry-run -i /home/fabian/Documents/work/github/KUtrace/linux/linux-6.6.36/kutrace_patch_file_6.6.36.txt 
checking file arch/x86/entry/common.c
checking file arch/x86/Kconfig
checking file arch/x86/kernel/acpi/cstate.c
checking file arch/x86/kernel/apic/apic.c
checking file arch/x86/kernel/apic/ipi.c
checking file arch/x86/kernel/irq.c
checking file arch/x86/kernel/irq_work.c
checking file arch/x86/kernel/process.c
checking file arch/x86/kernel/smp.c
checking file arch/x86/mm/fault.c
checking file .config
Reversed (or previously applied) patch detected!  Assume -R? [n] y
Hunk #3 FAILED at 104.
Hunk #4 succeeded at 121 with fuzz 2 (offset -1 lines).
Hunk #5 succeeded at 131 (offset -1 lines).
Hunk #6 succeeded at 145 (offset -1 lines).
Hunk #7 FAILED at 166.
Hunk #8 succeeded at 176 (offset -4 lines).
Hunk #9 succeeded at 200 (offset -4 lines).
Hunk #10 succeeded at 210 (offset -4 lines).
Hunk #11 succeeded at 232 (offset -4 lines).
Hunk #12 succeeded at 298 (offset -4 lines).
Hunk #13 succeeded at 332 (offset -5 lines).
Hunk #14 succeeded at 342 (offset -5 lines).
Hunk #15 succeeded at 379 (offset -5 lines).
Hunk #16 succeeded at 399 (offset -5 lines).
Hunk #17 succeeded at 430 (offset -5 lines).
Hunk #18 succeeded at 443 (offset -5 lines).
Hunk #19 FAILED at 478.
Hunk #20 FAILED at 492.
Hunk #21 FAILED at 515.
Hunk #22 succeeded at 540 (offset -6 lines).
Hunk #23 succeeded at 574 (offset -6 lines).
Hunk #24 succeeded at 583 (offset -6 lines).
Hunk #25 succeeded at 619 (offset -5 lines).
Hunk #26 succeeded at 628 (offset -5 lines).
Hunk #27 succeeded at 645 (offset -5 lines).
Hunk #28 succeeded at 661 (offset -5 lines).
Hunk #29 succeeded at 681 (offset -5 lines).
Hunk #30 succeeded at 713 (offset -5 lines).
Hunk #31 succeeded at 744 (offset -5 lines).
Hunk #32 FAILED at 829.
Hunk #33 succeeded at 844 (offset -5 lines).
Hunk #34 succeeded at 864 (offset -5 lines).
Hunk #35 FAILED at 893.
Hunk #36 FAILED at 905.
Hunk #37 succeeded at 922 (offset -6 lines).
Hunk #38 succeeded at 969 (offset -6 lines).
Hunk #39 succeeded at 992 (offset -6 lines).
Hunk #40 FAILED at 1038.
Hunk #41 succeeded at 1085 (offset -6 lines).
Hunk #42 succeeded at 1104 (offset -6 lines).
Hunk #43 FAILED at 1119.
Hunk #44 succeeded at 1133 (offset -6 lines).
Hunk #45 succeeded at 1156 with fuzz 2 (offset 1 line).
Hunk #46 succeeded at 1169 (offset 1 line).
Hunk #47 succeeded at 1222 with fuzz 1 (offset 1 line).
Hunk #48 FAILED at 1236.
Hunk #49 succeeded at 1390 with fuzz 1 (offset 54 lines).
Hunk #50 succeeded at 1412 (offset 56 lines).
Hunk #51 succeeded at 1521 (offset 68 lines).
Hunk #52 FAILED at 1468.
Hunk #53 succeeded at 1557 (offset 67 lines).
Hunk #54 succeeded at 1568 (offset 67 lines).
Hunk #55 FAILED at 1530.
Hunk #56 succeeded at 1627 (offset 68 lines).
Hunk #57 succeeded at 1640 (offset 68 lines).
Hunk #58 succeeded at 1655 (offset 68 lines).
Hunk #59 succeeded at 1670 (offset 68 lines).
Hunk #60 succeeded at 1719 (offset 68 lines).
Hunk #61 FAILED at 1669.
Hunk #62 FAILED at 1725.
Hunk #63 succeeded at 1816 (offset 68 lines).
Hunk #64 FAILED at 1798.
Hunk #65 succeeded at 1995 (offset 174 lines).
Hunk #66 FAILED at 1835.
Hunk #67 succeeded at 2021 (offset 173 lines).
Hunk #68 FAILED at 1861.
Hunk #69 succeeded at 2101 (offset 173 lines).
Hunk #70 succeeded at 2138 (offset 173 lines).
Hunk #71 FAILED at 1992.
Hunk #72 succeeded at 2278 (offset 172 lines).
Hunk #73 succeeded at 2286 (offset 172 lines).
Hunk #74 FAILED at 2152.
Hunk #75 succeeded at 2377 (offset 172 lines).
Hunk #76 succeeded at 2385 (offset 172 lines).
Hunk #77 succeeded at 2450 (offset 173 lines).
Hunk #78 succeeded at 2563 (offset 174 lines).
Hunk #79 succeeded at 2606 (offset 174 lines).
Hunk #80 succeeded at 2643 (offset 174 lines).
Hunk #81 FAILED at 2504.
Hunk #82 succeeded at 2705 (offset 179 lines).
Hunk #83 succeeded at 2744 (offset 179 lines).
Hunk #84 succeeded at 2942 (offset 193 lines).
Hunk #85 FAILED at 2772.
Hunk #86 succeeded at 2975 (offset 193 lines).
Hunk #87 succeeded at 2994 with fuzz 1 (offset 194 lines).
Hunk #88 succeeded at 3059 (offset 194 lines).
Hunk #89 succeeded at 3104 with fuzz 2 (offset 206 lines).
Hunk #90 succeeded at 3118 (offset 206 lines).
Hunk #91 succeeded at 3248 (offset 207 lines).
Hunk #92 FAILED at 3071.
Hunk #93 succeeded at 3307 (offset 208 lines).
Hunk #94 succeeded at 3350 (offset 208 lines).
Hunk #95 succeeded at 3419 with fuzz 1 (offset 208 lines).
Hunk #96 succeeded at 3511 (offset 209 lines).
Hunk #97 succeeded at 3546 (offset 209 lines).
Hunk #98 FAILED at 3434.
Hunk #99 FAILED at 3469.
Hunk #100 succeeded at 3715 (offset 214 lines).
Hunk #101 succeeded at 3753 (offset 214 lines).
Hunk #102 succeeded at 3785 (offset 214 lines).
Hunk #103 FAILED at 3588.
Hunk #104 FAILED at 3746.
Hunk #105 FAILED at 3820.
Hunk #106 succeeded at 4759 (offset 902 lines).
Hunk #107 succeeded at 4777 (offset 902 lines).
Hunk #108 FAILED at 3893.
Hunk #109 FAILED at 3922.
Hunk #110 FAILED at 3957.
Hunk #111 succeeded at 4929 (offset 904 lines).
Hunk #112 FAILED at 4040.
Hunk #113 FAILED at 4154.
Hunk #114 FAILED at 4172.
Hunk #115 FAILED at 4200.
Hunk #116 FAILED at 4669.
Hunk #117 FAILED at 4687.
Hunk #118 succeeded at 5643 (offset 909 lines).
Hunk #119 succeeded at 5785 (offset 922 lines).
Hunk #120 FAILED at 4877.
Hunk #121 succeeded at 5893 (offset 922 lines).
Hunk #122 succeeded at 6043 with fuzz 1 (offset 922 lines).
Hunk #123 succeeded at 6058 (offset 922 lines).
Hunk #124 succeeded at 6072 (offset 922 lines).
Hunk #125 succeeded at 6126 (offset 922 lines).
Hunk #126 succeeded at 6140 with fuzz 1 (offset 922 lines).
Hunk #127 succeeded at 6182 (offset 926 lines).
Hunk #128 succeeded at 6192 (offset 926 lines).
Hunk #129 FAILED at 5286.
Hunk #130 FAILED at 5316.
Hunk #131 FAILED at 5327.
Hunk #132 FAILED at 5342.
Hunk #133 FAILED at 5368.
Hunk #134 FAILED at 5427.
Hunk #135 succeeded at 6377 (offset 928 lines).
Hunk #136 succeeded at 6472 (offset 929 lines).
Hunk #137 succeeded at 6485 (offset 929 lines).
Hunk #138 succeeded at 6509 (offset 929 lines).
Hunk #139 succeeded at 6541 (offset 931 lines).
Hunk #140 succeeded at 6565 (offset 931 lines).
Hunk #141 succeeded at 6607 (offset 931 lines).
Hunk #142 FAILED at 5697.
Hunk #143 FAILED at 5734.
Hunk #144 succeeded at 6703 (offset 931 lines).
Hunk #145 succeeded at 6794 (offset 931 lines).
Hunk #146 succeeded at 6802 (offset 931 lines).
Hunk #147 FAILED at 5915.
Hunk #148 FAILED at 5978.
Hunk #149 succeeded at 6966 (offset 927 lines).
Hunk #150 FAILED at 6074.
Hunk #151 succeeded at 7014 (offset 926 lines).
Hunk #152 succeeded at 7026 (offset 926 lines).
Hunk #153 succeeded at 7083 (offset 926 lines).
Hunk #154 FAILED at 6192.
Hunk #155 succeeded at 7172 (offset 926 lines).
Hunk #156 succeeded at 7182 (offset 926 lines).
Hunk #157 succeeded at 7201 (offset 926 lines).
Hunk #158 succeeded at 7226 (offset 926 lines).
Hunk #159 succeeded at 7245 (offset 926 lines).
Hunk #160 FAILED at 6344.
Hunk #161 succeeded at 7295 (offset 927 lines).
Hunk #162 FAILED at 6395.
Hunk #163 succeeded at 7341 (offset 927 lines).
Hunk #164 succeeded at 7364 (offset 928 lines).
Hunk #165 succeeded at 7391 (offset 928 lines).
Hunk #166 succeeded at 7414 (offset 928 lines).
Hunk #167 succeeded at 7442 (offset 928 lines).
Hunk #168 FAILED at 6542.
Hunk #169 succeeded at 7483 (offset 928 lines).
Hunk #170 FAILED at 6577.
Hunk #171 FAILED at 6601.
Hunk #172 FAILED at 6639.
Hunk #173 FAILED at 6663.
Hunk #174 succeeded at 7620 (offset 929 lines).
Hunk #175 succeeded at 7636 (offset 929 lines).
57 out of 175 hunks FAILED
checking file drivers/acpi/acpi_pad.c
checking file drivers/acpi/processor_idle.c
checking file drivers/idle/intel_idle.c
checking file fs/exec.c
checking file include/linux/kutrace.h
checking file kernel/kutrace/kutrace.c
checking file kernel/kutrace/Makefile
checking file kernel/Makefile
checking file kernel/sched/core.c
checking file kernel/softirq.c
checking file net/ipv4/tcp_input.c
checking file net/ipv4/tcp_output.c
checking file net/ipv4/udp.c

I answer [y] to the question: Reversed (or previously applied) patch detected! Assume -R? [n] y.

Is this the correct way to install the patch (being in the root of the kernel release and using -i PATH_TO_KUTRACE_PATCH? If yes, should I be concerned either the message that Reversed (or previously applied) patch detected! or HUNK #XXX FAILED at ...