Messages in this thread | | | From | "Brown, Len" <> | Subject | RE: [RFC] x86, perf: Add an aperfmperf driver | Date | Tue, 28 Apr 2015 22:29:53 +0000 |
| |
> I think that turbostat could do some of its work without being > root if we had a driver like this.
Note that turbostat can be run as non-root this way:
# setcap cap_sys_rawio=ep ./turbostat # chmod +r /dev/cpu/*/msr
For the debug case, there are a number of MSRs that turbostat must access, so would still need permission for that case (which is the only case I use:-)
> Thoughts? Would it make sense at all? Did I wire it up right? This is > the only PMU driver I've ever written, and it could have any number of > issues.
APERF/MPERF, as with all per-thread MSRs, must be accessed from the local processor. I didn't see where this driver distinguishes the CPU. Also, I assume the intent is to return a snapshot, rather than sampling, yes?
Note that turbostat binds itself to a remote CPU so that MSR reads are all local, then it binds to the next CPU etc. In the old days, we read everything without this binding, and the kernel overhead of the remote reads was too high, making it difficult to measure profoundly idle systems.
cheers, -Len
| |