8067378: Add segmented code heaps info into jfr events: vm/code_cache/stats and vm/code_cache/config

Added code heap specific information to code cache JFR events.

Reviewed-by: twisti, mgronlun
This commit is contained in:
Tobias Hartmann 2015-11-09 11:35:44 +01:00
parent 8d1f664989
commit 5d86db4b66
6 changed files with 104 additions and 37 deletions

View file

@ -85,13 +85,9 @@ class CodeCache : AllStatic {
static address _low_bound; // Lower bound of CodeHeap addresses
static address _high_bound; // Upper bound of CodeHeap addresses
static int _number_of_blobs; // Total number of CodeBlobs in the cache
static int _number_of_adapters; // Total number of Adapters in the cache
static int _number_of_nmethods; // Total number of nmethods in the cache
static int _number_of_nmethods_with_dependencies; // Total number of nmethods with dependencies
static bool _needs_cache_clean; // True if inline caches of the nmethods needs to be flushed
static nmethod* _scavenge_root_nmethods; // linked via nm->scavenge_root_link()
static int _codemem_full_count; // Number of times a CodeHeap in the cache was full
static void mark_scavenge_root_nmethods() PRODUCT_RETURN;
static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN;
@ -104,7 +100,6 @@ class CodeCache : AllStatic {
static CodeHeap* get_code_heap(int code_blob_type); // Returns the CodeHeap for the given CodeBlobType
// Returns the name of the VM option to set the size of the corresponding CodeHeap
static const char* get_code_heap_flag_name(int code_blob_type);
static bool heap_available(int code_blob_type); // Returns true if an own CodeHeap for the given CodeBlobType is available
static size_t heap_alignment(); // Returns the alignment of the CodeHeaps in bytes
static ReservedCodeSpace reserve_heap_memory(size_t size); // Reserves one continuous chunk of memory for the CodeHeaps
@ -139,9 +134,12 @@ class CodeCache : AllStatic {
static CodeBlob* find_blob_unsafe(void* start); // Same as find_blob but does not fail if looking up a zombie method
static nmethod* find_nmethod(void* start); // Returns the nmethod containing the given address
static int nof_blobs() { return _number_of_blobs; } // Returns the total number of CodeBlobs in the cache
static int nof_adapters() { return _number_of_adapters; } // Returns the total number of Adapters in the cache
static int nof_nmethods() { return _number_of_nmethods; } // Returns the total number of nmethods in the cache
static int blob_count(); // Returns the total number of CodeBlobs in the cache
static int blob_count(int code_blob_type);
static int adapter_count(); // Returns the total number of Adapters in the cache
static int adapter_count(int code_blob_type);
static int nmethod_count(); // Returns the total number of nmethods in the cache
static int nmethod_count(int code_blob_type);
// GC support
static void gc_epilogue();
@ -177,7 +175,9 @@ class CodeCache : AllStatic {
// The full limits of the codeCache
static address low_bound() { return _low_bound; }
static address low_bound(int code_blob_type);
static address high_bound() { return _high_bound; }
static address high_bound(int code_blob_type);
// Profiling
static size_t capacity();
@ -191,6 +191,9 @@ class CodeCache : AllStatic {
static void set_needs_cache_clean(bool v) { _needs_cache_clean = v; }
static void clear_inline_caches(); // clear all inline caches
// Returns true if an own CodeHeap for the given CodeBlobType is available
static bool heap_available(int code_blob_type);
// Returns the CodeBlobType for the given nmethod
static int get_code_blob_type(nmethod* nm) {
return get_code_heap(nm)->code_blob_type();
@ -239,7 +242,10 @@ class CodeCache : AllStatic {
// tells how many nmethods have dependencies
static int number_of_nmethods_with_dependencies();
static int get_codemem_full_count() { return _codemem_full_count; }
static int get_codemem_full_count(int code_blob_type) {
CodeHeap* heap = get_code_heap(code_blob_type);
return (heap != NULL) ? heap->full_count() : 0;
}
};