Skip to content

Conversation

KavinSatheeskumar
Copy link
Contributor

The TR_PrintCompMem printout displays various statistics about code cache usage for each code cache. This pr simply adds code cache kind to those statistics

@KavinSatheeskumar
Copy link
Contributor Author

This is an example of one of the code cache printouts with the new change

Code Cache @0x7fa51c012990 flags=0x0 almostFull=2 codeCacheKind=DEFAULT_CC
   cold-warm hole size        =        0 bytes
   warmCodeAlloc=0x7fa4cc5fe920 coldCodeAlloc=0x7fa4cc5fe920
   warmCodeSize= 2091296 coldCodeSize= 2432
   sizeOfLargestFreeColdBlock =        0 bytes
   sizeOfLargestFreeWarmBlock =     3040 bytes
   reclaimed sizes: 3040 96 128 128 128 320 96 96 96 96 96 128 128 96 128 96 128 128 128 128 96 96 96 96 288 128 96 96 96 256 96 96 128 128 96 128 128 96 352 96 96 96 96
   trampoline free space = 0 (temp=0)
   config size     =  2097152 bytes
   total free size =     8384 bytes
   total used size =  2088768 bytes

@KavinSatheeskumar KavinSatheeskumar force-pushed the add_code_cache_kind_to_printout branch 2 times, most recently from 3e16ea7 to b269f0d Compare October 16, 2025 19:55
{
fprintf(stderr, "Code Cache @%p flags=0x%x almostFull=%d\n", this, _flags, _almostFull);
fprintf(stderr, "Code Cache @%p flags=0x%x almostFull=%d codeCacheKind=%s\n", this, _flags, _almostFull,
TR::CodeCacheKindStrings[this->_kind]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't use '_kind' directly like '_flags'?

Copy link
Contributor

@dsouzai dsouzai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably better to add a method to OMR::CodeCache, perhaps even just a static method, so that you're not accessing the CodeCacheKindStrings array directly.

@dsouzai dsouzai self-assigned this Oct 16, 2025
@KavinSatheeskumar KavinSatheeskumar force-pushed the add_code_cache_kind_to_printout branch 7 times, most recently from 0aaa8fe to c3257f0 Compare October 17, 2025 14:53
@KavinSatheeskumar KavinSatheeskumar force-pushed the add_code_cache_kind_to_printout branch from c3257f0 to 5a839d1 Compare October 17, 2025 16:34
@KavinSatheeskumar
Copy link
Contributor Author

Added more functionality, namely to print the code-base and code-top as well to make it easier to correlate with the verbose log

This is an example of the new message

Code Cache @0x1456380cda00 flags=0x0 almostFull=0 codeCacheKind=DEFAULT_CC
   range: 0x1455bae00008-0x1455bb000000
   cold-warm hole size        =  2045728 bytes
   warmCodeAlloc=0x1455bae0b7c0 coldCodeAlloc=0x1455baffeee0
   warmCodeSize= 47032 coldCodeSize= 960
   trampoline free space = 0 (temp=0)
   config size     =  2097152 bytes
   total free size =  2045728 bytes
   total used size =    51424 bytes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants