2 ms·
The author is probably concerned about the overhead of using N system calls to read N MSRs. It would be cool if eBPF could read MSRs; then this kind of monitor
by wmf 10y ago
The author is probably concerned about the overhead of using N system calls to read N MSRs.
It would be cool if eBPF could read MSRs; then this kind of monitoring could be done though perf tracing.
- mmrezaie 10y agoWell using perf or reading MSR doesn't need you writing your kernel module. I think the overhead of using perf or direct access to MSR are kinda similar.
- brendangregg 10y agoRDMSR is an instruction, not a syscall. It's not clear to me either why this needs a kernel module. It's similar to i7z, which from memory does not use it's own kernel module. eBPF can read the relevant PMCs as of Linux 4.9. eg, the llcstat tool in bcc does this. (It was something I pushed for, and Alexei delivered)
- wmf 10y agoYou already know this, but for completeness you can't RDMSR from userspace, so to read MSRs you can use the msr kernel module which requires 2 system calls per MSR (which is what i7z does) or you can write your own kernel module which requires fewer system calls. Clearly a lot of people in this thread disagree with the author's decision. Can eBPF read non-PMC registers like IA32_PERF_STATUS? I'm not getting much by googling. Thanks for all your work on this topic; it's really educational.
- netmonk 10y agoThank you Brendan to comment this post, i guess Cyril(the main author) will be happy. We successfully compile it on 2.6.32 kernel on production servers for exemple. We needed to compile gcc >5 to fully make it runs, as far as the RHEL6.5 default gcc is 4.4. So talking about what 4.9 kernel can bring is interesting, but not everybody runs this version of kernel.