lkml.org 
[lkml]   [2015]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [RFC] x86, perf: Add an aperfmperf driver
Date
> 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



\
 
 \ /
  Last update: 2015-04-29 00:41    [W:0.107 / U:1.960 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site