Discussion
Jikes RVM's M-to-N threading required an extension of the virtual machine
to gather Java thread specific HPM data. In JVMs that directly map
Java threads to Pthreads, it should be possible to gather aggregate
Java thread specific HPM data using the pmapi library by making
relatively simple extensions to read HPM counters when threads are
created and terminated. So, in this respect the Jikes RVM
implementation was more complex than it might have been in other JVMs.
However, M-to-N threading made the gathering of fine-grained temporal
HPM data fairly straightforward. A relatively simple extension to the
context-switching sequence to read the HPM counters on every thread
switch was sufficient to collect the desired data. Gathering this kind
of data on virtual machines that do not employ M-to-N
threading will
probably be significantly more difficult because applying a similar
design would require modifications to either the Pthread or OS thread libraries.