Re: MSR driver

M. Patrick Goda (
Thu, 13 Nov 1997 20:18:27 -0700

>>>>> "Stephan" == Stephan Meyer <> writes:


I would like to express my support for this device driver! I think it
would be a nice addition to the kernel.

Here is my interest in this device- Using Stephan Meyer's msr.o module
last March, I constructed a command line tool that wraps a program and
runs it while monitoring the 2 performance monitoring registers on the
Pentium/Pentium Pro and Pentium II. Ironically- I am a presenting the
newest release of perfmon (the command line tool) and the NEW
libperfmon at a conference next week. (libperfmon is a set of calls
that allow users to embed profiling calls in their code- it's an easy
way to get at the valuable information provided by the performance

I know that some SGI processors and the DEC Alpha also have MSRs for
low level profiling, I intend to port perfmon and libperfmon to the
Alpha soon, real soon now. In the mean time, since it's inception
earlier this year, perfmon has been a considerable help to many of us
doing scientific computation on Intel Linux boxes (we built a 16 node
cluster here at Los Alamos). Thus, in an effort to make Linux even
more attractive to scientific users I would really like to see support
for the msr module in the kernel.

On another note- I wrote a sister utility to perfmon, mperfmon, which
multiplexes over some subset of the available profiling events.
mperfmon works ok, but it would be ideal if we could add the MSRs to
the information saved over a context switch- this way the counts would
be more accurate and multiple instances of perfmon/mperfmon would not
collide as they now do. Is there any reason why this couldn't become
a feature in the kernel?

My .02.

If anyone is interested, perfmon's home is at , the new release of perfmon
and the new libperfmon will be there by Sunday.

Feedback/Comments welcomed.


M. Patrick Goda W: (505)667-5386
Los Alamos National Laboratory H: (505)989-4506
Theoretical Astrophysics, T-6 MS B288
Los Alamos, NM 87545
Snappy Quote: "abcdefghijklmnopqrstuvwxyz"*
*some assembly required

Stephan> I've sent this message to David S. Miller and Linus
Stephan> Torvalds before, but obviously neither of them was
Stephan> willing to reply.

Stephan> -------

Stephan> I'd like to know which requirements the MSR driver needs
Stephan> to meet in order to get included in the 2.1.x and 2.2.x
Stephan> kernels. I have received some suggestions now and I
Stephan> myself can't really decide on the quality of each
Stephan> solution.

Stephan> a) character device

Stephan> This is the currently implemented method. It was
Stephan> criticized by Linus and I get the problem. I believe that
Stephan> this way, it would be very easy to grant specific users
Stephan> access to the MSR registers.

Stephan> b) character device (s.o.) + ioctl

Stephan> Would it be good to implement some stuff via the ioctl
Stephan> functions?

Stephan> c) /proc/sys + sysctl

Stephan> Would this do any good? You could probably write to a
Stephan> file to select the MSR register/performance counter and
Stephan> then read from it. I'd love to do it that way, but access
Stephan> would be restricted to root. Is that okay?

Stephan> Please add your thoughts on this.

Stephan> - Stephan

Stephan> ------------------------------------------------
Stephan> 2A 64 F0 73 02 91 10 FC
Stephan> 18 CC 83 1E E2 2C 7E 79

Stephan> So what would an angel say The devil wants to know