Skip to content
Open
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 Jul 16, 2026
90e6fb6
[native] Test printf-style logging
simonrozsival Jul 17, 2026
2cb0c4e
[Tests] Follow Android string helper convention
simonrozsival Jul 17, 2026
4a27f68
[Tests] Import Android string helpers
simonrozsival Jul 17, 2026
ee07100
[Tests] Remove native logging test harness
simonrozsival Jul 17, 2026
c907892
[NativeAOT] Migrate runtime utility logging to printf
simonrozsival Jul 17, 2026
7a34259
[CoreCLR/NativeAOT] Migrate configuration diagnostics to printf
simonrozsival Jul 17, 2026
a1bf4b7
Address printf logging review feedback
simonrozsival Jul 17, 2026
2e31630
Merge updated printf logging base
simonrozsival Jul 17, 2026
3b8673f
Merge updated printf logging base
simonrozsival Jul 17, 2026
09f0690
Support printf logging helpers on MonoVM
simonrozsival Jul 17, 2026
66d731d
Merge MonoVM printf logging support
simonrozsival Jul 17, 2026
88ca523
Merge MonoVM printf logging support
simonrozsival Jul 17, 2026
72cad5d
Use printf configuration logging on MonoVM
simonrozsival Jul 17, 2026
00aa7d4
Centralize native printf logging declarations
jonathanpeppers Jul 20, 2026
fcd87d4
Reuse NativeAOT bridge status strings
jonathanpeppers Jul 20, 2026
1c244d8
Merge main into native printf logging
jonathanpeppers Jul 20, 2026
71cfe50
Use canonical printf logging declarations
jonathanpeppers Jul 20, 2026
f28e855
Preserve mmap diagnostic alignment
jonathanpeppers Jul 21, 2026
b8f2e27
Merge PR 12155 for stacked review
jonathanpeppers Jul 21, 2026
23fa284
Merge branch 'main' into dev/simonrozsival/nativeaot-runtime-printf-l…
jonathanpeppers Jul 21, 2026
d11efec
Update CoreCLR APK size reference
jonathanpeppers Jul 22, 2026
fce7aeb
Merge branch 'main' into dev/simonrozsival/nativeaot-runtime-printf-l…
jonathanpeppers Jul 22, 2026
4952d57
[NativeAOT] Migrate shared GC logging to printf
jonathanpeppers Jul 22, 2026
470c947
Avoid string_view for segment errors
jonathanpeppers Jul 22, 2026
df63756
[NativeAOT] Migrate GC bridge logging to printf
jonathanpeppers Jul 22, 2026
1ae4c40
Make segment error mapping constexpr
jonathanpeppers Jul 22, 2026
462c434
Merge remote-tracking branch 'origin/jonathanpeppers-native-printf-lo…
jonathanpeppers Jul 22, 2026
d674211
Merge branch 'main' into jonathanpeppers-finish-gc-bridge-printf
jonathanpeppers Jul 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/native/clr/host/gc-bridge.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <cerrno>
#include <cinttypes>
#include <pthread.h>
#include <semaphore.h>

Expand Down Expand Up @@ -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]);
}
Expand All @@ -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);
}
}

Expand All @@ -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);
Comment thread
jonathanpeppers marked this conversation as resolved.
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));
Comment thread
jonathanpeppers marked this conversation as resolved.
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));
}
}
Loading