Thus, I wonder whether anybody has already considered designing and
implementing a reasonably portable interface that would provide:
o memory-system information (structure of memory
system, performance parameters)
o access to performance monitor hardware (where present); e.g.,
explicit measurement/counting of events and/or performance
counter based profiling (e.g., to obtain a histogram of
cache-misses)
o control over memory system state (e.g., flushing of individual
caches, TLB, etc.)
Obviously, some of these operations are security sensitive but it is
quite acceptable if these facilities are available to the superuser
only. For controlled experimentation, it will in many cases be
necessary to run the system in single-user mode anyway.
Also, notice that oftentimes much of such an interface could be
implemented at the user-level. What I envision is a minimal and
possibly architecture-dependent interface with library support to
provide the full and (mostly) architecture independent interface.
If anybody is interested in seriously pursuing this idea, here some
more info:
o the latest GNU gprof (available in the form of a snapshot)
has support for fine-grained (line-by-line) and non-real-time
based profiling
o free code for accessing the EV4 (aka 21064 Alpha CPU) performance
counter is available; if interested, drop me a note
If this is done properly, I think Linux could have a real edge over
commercial OSes for the research community and anybody else interested
in understanding system performance.
Any feedback would be appreciated.
--david