Skip to content

simonis/hsperf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hsperf

Prints HotSpot perf counters, even when the target JVM is started with -XX:+PerfDisableSharedMem flag. Unlike other similar utilities, it does not rely on access to /tmp/hsperfdata_user files.

Usage

hsperf <pid> [-i <ms>] [<counter>...]

If only <pid> is specified, the program prints all counters with their names.
If a space separated list of counter names is given, the program prints values of the specified counters, one value per line. If -i <ms> is given, the counters will be queried and printed all <ms> milliseconds.

How it works

  1. Reads /proc/[pid]/maps to find the location and the base address of libjvm.so.
  2. Parses libjvm.so to get the address of PerfData structure.
  3. Calls process_vm_readv to read PerfData of the target JVM.

If libjvm.so does not contain debug symbols, the program gets the address of VMStructs instead (which is always available) and then looks for PerfData addresses using VMStructs.

Supported OS

Linux 3.2+ 64-bit

About

Read HotSpot perf counters directly from the JVM memory

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.7%
  • Makefile 1.3%