tud-zih-energy / lo2s

Linux OTF2 Sampling - A Lightweight Node-Level Performance Monitoring Tool
https://tu-dresden.de/zih/forschung/projekte/lo2s?set_language=en
GNU General Public License v3.0
44 stars 13 forks source link

Function group heuristics for kernel threads #328

Open tilsche opened 4 months ago

tilsche commented 4 months ago

For userspace threads, our naming based on the comm of threads and processes works just well. For kernel threads, it would be very convenient to apply some heuristic, e.g.: for watchdog/<cpuid>, it would be great if it ends up in the same function group. But also things like ptlrpcd_07_15, kiblnd_sd_06_00.

cvonelm commented 4 months ago

According to this Stackoverflow answer, one can check the flags field of /proc/[pid]/stat for the PF_KTHREAD bit to check if it is a kernel thread.