Skip to content

feat: Add logging of the contents of the aot cache to the map file#1

Open
Delawen wants to merge 3 commits into
vnkozlov:8380476from
Delawen:map-file-code-cache
Open

feat: Add logging of the contents of the aot cache to the map file#1
Delawen wants to merge 3 commits into
vnkozlov:8380476from
Delawen:map-file-code-cache

Conversation

@Delawen

@Delawen Delawen commented Jun 2, 2026

Copy link
Copy Markdown

Adding to the assembly mapfile the assets of the code cache.

Tests in https://github.com/Delawen/jdk/actions/runs/27264662339

The map file is generated for example with -Xlog:aot+map=trace,aot+map+oops=trace,aot=warning:file=${FOLDER}/aot.map:none:filesize=0

Example of output:

For NMethods:
Pointer : @@ Nmethod Size Compilation Level Compilation ID Method signature

Fort the rest:
Pointer : @@ Kind Size ID Name

0x00007fbcf7ffeff4: @@ StubGenBlob       25896 73 initial_blob (stub gen)
0x00007fbcf7ffefc8: @@ SharedBlob        403 13 throw_StackOverflowError_blob (shared runtime)
0x00007fbcf7ffef9c: @@ StubGenBlob       3621 74 continuation_blob (stub gen)
0x00007fbcf7ffed34: @@ SharedBlob        2156 0 deopt_blob (shared runtime)
0x00007fbcf7ffe49c: @@ StubGenBlob       129373 75 compiler_blob (stub gen)
0x00007fbcf7ffe470: @@ StubGenBlob       59182 76 final_blob (stub gen)
0x00007fbcf7ffcc8c: @@ C1Blob            650 17 dtrace_object_alloc_blob (C1 runtime)
0x00007fbcf7ffcc60: @@ C1Blob            387 18 unwind_exception_blob (C1 runtime)
0x00007fbcf7ffbe74: @@ C2Blob            335 70 vthread_start_transition_blob (C2 runtime)
0x00007fbcf7ffbe48: @@ Adapter           1333 217 ILIL
0x00007fbcf7ffbe1c: @@ Adapter           1376 218 LIIILLL
0x00007fbcf7ffbdf0: @@ C2Blob            333 71 vthread_end_transition_blob (C2 runtime)
0x00007fbcf7ffbdc4: @@ Adapter           1460 219 LLLIILILLII
0x00007fbcf7ffbd98: @@ Adapter           1342 220 LIIIL
0x00007fbcf7fe5500: @@ Nmethod           2788 2 2906 java.util.concurrent.ConcurrentHashMap$MapEntry.<init>(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/concurrent/ConcurrentHashMap;)V
0x00007fbcf7fe54d4: @@ Nmethod           5552 2 2905 java.util.concurrent.ConcurrentHashMap$EntryIterator.next()Ljava/util/Map$Entry;
0x00007fbcf7fe25e8: @@ Nmethod           11537 4 3183 java.math.BigInteger.subtract([I[I)[I
0x00007fbcf7fe25bc: @@ Nmethod           6965 4 3251 java.util.regex.Pattern$CharProperty.match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z


@Delawen Delawen force-pushed the map-file-code-cache branch 3 times, most recently from 070d4a1 to 70eb990 Compare June 9, 2026 08:46
@Delawen Delawen marked this pull request as ready for review June 9, 2026 08:48
@Delawen

Delawen commented Jun 9, 2026

Copy link
Copy Markdown
Author

@vnkozlov Ready to integrate ;)

On a normal execution (-XX:AOTCacheOutput=...) there are two map files generated: one after training and the other at the end describing the final cache. This logs the contents of the aot code cache on the final one, the one that regular developers will want to check.

I haven't been able to properly explore the aot code cache after training and before assembly, maybe it is empty? This intermediate map file would be useful only for Leyden debugging purposes ("why does my method not end up in the cache I use on production if it is stored on the training run?"), so I would just merge this and maybe come back later to try to fill that map file.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant