Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 578
[NativeAOT] Migrate GC bridge logging to printf#12211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jonathanpeppers
merged 29 commits into
main
from
jonathanpeppers-finish-gc-bridge-printfJul 27, 2026
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
c14b3ef
[NativeAOT] Add printf-style native logging
simonrozsival 90e6fb6
[native] Test printf-style logging
simonrozsival 2cb0c4e
[Tests] Follow Android string helper convention
simonrozsival 4a27f68
[Tests] Import Android string helpers
simonrozsival ee07100
[Tests] Remove native logging test harness
simonrozsival c907892
[NativeAOT] Migrate runtime utility logging to printf
simonrozsival 7a34259
[CoreCLR/NativeAOT] Migrate configuration diagnostics to printf
simonrozsival a1bf4b7
Address printf logging review feedback
simonrozsival 2e31630
Merge updated printf logging base
simonrozsival 3b8673f
Merge updated printf logging base
simonrozsival 09f0690
Support printf logging helpers on MonoVM
simonrozsival 66d731d
Merge MonoVM printf logging support
simonrozsival 88ca523
Merge MonoVM printf logging support
simonrozsival 72cad5d
Use printf configuration logging on MonoVM
simonrozsival 00aa7d4
Centralize native printf logging declarations
jonathanpeppers fcd87d4
Reuse NativeAOT bridge status strings
jonathanpeppers 1c244d8
Merge main into native printf logging
jonathanpeppers 71cfe50
Use canonical printf logging declarations
jonathanpeppers f28e855
Preserve mmap diagnostic alignment
jonathanpeppers b8f2e27
Merge PR 12155 for stacked review
jonathanpeppers 23fa284
Merge branch 'main' into dev/simonrozsival/nativeaot-runtime-printf-l…
jonathanpeppers d11efec
Update CoreCLR APK size reference
jonathanpeppers fce7aeb
Merge branch 'main' into dev/simonrozsival/nativeaot-runtime-printf-l…
jonathanpeppers 4952d57
[NativeAOT] Migrate shared GC logging to printf
jonathanpeppers 470c947
Avoid string_view for segment errors
jonathanpeppers df63756
[NativeAOT] Migrate GC bridge logging to printf
jonathanpeppers 1ae4c40
Make segment error mapping constexpr
jonathanpeppers 462c434
Merge remote-tracking branch 'origin/jonathanpeppers-native-printf-lo…
jonathanpeppers d674211
Merge branch 'main' into jonathanpeppers-finish-gc-bridge-printf
jonathanpeppers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| #include <cerrno> | ||
| #include <cinttypes> | ||
| #include <pthread.h> | ||
| #include <semaphore.h> | ||
| @@ -128,13 +129,13 @@ void GCBridge::log_mark_cross_references_args_if_enabled (MarkCrossReferencesArg | ||
| return; | ||
| } | ||
| log_info (LOG_GC, "cross references callback invoked with {} sccs and {} xrefs.", args->ComponentCount, args->CrossReferenceCount); | ||
| log_infof (LOG_GC, "cross references callback invoked with %zu sccs and %zu xrefs.", args->ComponentCount, args->CrossReferenceCount); | ||
| JNIEnv *env = OSBridge::ensure_jnienv (); | ||
| for (size_t i = 0; i < args->ComponentCount; ++i) { | ||
| const StronglyConnectedComponent &scc = args->Components [i]; | ||
| log_info (LOG_GC, "group {} with {} objects", i, scc.Count); | ||
| log_infof (LOG_GC, "group %zu with %zu objects", i, scc.Count); | ||
| for (size_t j = 0; j < scc.Count; ++j) { | ||
| log_handle_context (env, scc.Contexts [j]); | ||
| } | ||
| @@ -147,7 +148,7 @@ void GCBridge::log_mark_cross_references_args_if_enabled (MarkCrossReferencesArg | ||
| for (size_t i = 0; i < args->CrossReferenceCount; ++i) { | ||
| size_t source_index = args->CrossReferences [i].SourceGroupIndex; | ||
| size_t dest_index = args->CrossReferences [i].DestinationGroupIndex; | ||
| log_info_nocheck_fmt (LOG_GC, "xref [{}] {} -> {}", i, source_index, dest_index); | ||
| log_writef (LOG_GC, LogLevel::Info, "xref [%zu] %zu -> %zu", i, source_index, dest_index); | ||
| } | ||
| } | ||
| @@ -161,10 +162,10 @@ void GCBridge::log_handle_context (JNIEnv *env, HandleContext *ctx) noexcept | ||
| jclass java_class = env->GetObjectClass (handle); | ||
| if (java_class != nullptr) { | ||
| char *class_name = Host::get_java_class_name_for_TypeManager (java_class); | ||
| log_info (LOG_GC, "gref {:#x} [{}]", reinterpret_cast<intptr_t> (handle), class_name); | ||
| log_infof (LOG_GC, "gref 0x%" PRIxPTR " [%s]", reinterpret_cast<uintptr_t> (handle), optional_string (class_name)); | ||
jonathanpeppers marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| free (class_name); | ||
| env->DeleteLocalRef (java_class); | ||
| } else { | ||
| log_info (LOG_GC, "gref {:#x} [unknown class]", reinterpret_cast<intptr_t> (handle)); | ||
| log_infof (LOG_GC, "gref 0x%" PRIxPTR " [unknown class]", reinterpret_cast<uintptr_t> (handle)); | ||
| } | ||
| } | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.