I was wondering how vtune deal with kthreads? If I generate a vtune profiling report(like group-by module) on program using kthreads, will the part of kthread be categorized as the original application, as part of the kernel, or other modules?
(a little bit more of background: I am currently using vtune to profile a SGX program, and the profiling result shows that isgx module only occupy 1% of the runtime. I noticed that sgx driver use kthread to deal with paging, so I was wondering if this will cause some of the runtime which actually belongs to sgx driver categorized as kernel?)
Thanks so much!
For successful profiling kernel modules several prerequisites shall be done:
1. Enable kernel modules resolution
2. Download and install available debug kernel versions
3. Build the Linux kernel with debug information
Please read details about these steps in the article from the VTune Profiler User Guide: https://software.intel.com/content/www/us/en/develop/documentation/vtune-help/top/set-up-analysis-ta...
After the steps are done you will be able to profile Linux kernel and other system modules using VTune Profiler.
Hope this helps,
CPU samples related to kthreads should be associated with vmlinux module. If you do hotspots collection with stacks based on HW sampling you can use e.g. Caller/Callee view to see total time for sgx functions and the functions they call in the kernel.
Thanks & Regards, Dmitry