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
633 stars 60 forks source link

sudo insmod kutrace_mod.ko tracemb=20,general protection fault: 0000 [#1] SMP NOPTI #9

Open SunnDay112 opened 7 months ago

SunnDay112 commented 7 months ago

os:unbuntu 16.04 kernel:4.19.19 question: according to <>,Building the modified kernel do sudo insmod kutrace_mod.ko tracemb=20,install mod failed,memory dump. how to fix this question?thankyou!

dmesg: kutrace_trace hello ===================== [ 188.868457] vmalloc kutrace_pid_filter ffffb9a5018f5000 [ 188.868865] vmalloc kutrace_tracebase(20 MB) ffffb9a505739000 OK [ 188.868866] mask 00000000ffffffff [ 188.868866] mask 0000000000000000 [ 188.868866] mask 0000000000000000 [ 188.868867] == 00000000d1c517e5 [ 188.868867] IsIntel_64 [ 188.868867] debug 1 [ 188.868868] ku_setup_inst_retired 1 [ 188.868868] rdMSR 1 [ 188.868899] general protection fault: 0000 [#1] SMP NOPTI [ 188.868904] CPU: 2 PID: 4093 Comm: insmod Tainted: G OE 4.19.19 #11 [ 188.868906] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020 [ 188.868910] RIP: 0010:ku_setup_inst_retired+0x29/0xf0 [kutrace_mod]

kutrace_module_error.txt

xiongsiqiang commented 6 months ago

If your environment is a virtual environment, check the virtual performance cpu counter, when kutrace.mod is loaded, the rdmsr will be used to read the MSR register, if the virtual performance CPU counter is not checked, the MSR register is not enabled in the virtual environment, and the rdmsr instruction reading the MSR register that is not turned on will trigger memory protection. PS: Instructions in the Intel Developer's Manual (EAX[3] enumerates support for XSAVES, XRSTORS, and the IA32_XSS MSR. If EAX[3] = 0, execution of XSAVES or XRSTORS causes a #UD; an attempt to access the IA32_XSS MSR using RDMSR or WRMSR causes a general-protection exception (#GP). Every processor that supports a supervisor state component sets EAX[3]).