Repository navigation
Java profiler remote enablement - #907
Draft
zhengyu123 wants to merge 16 commits into
Draft
zhengyu123 wants to merge 16 commits into
zhengyu123 wants to merge 16 commits into
Conversation
Contributor
CI Test ResultsRun: #41750446348 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled ❌ Failing tests
Retried 2 of 32 cells. Failed JobsSummary: Total: 32 | Passed: 30 | Failed: 2 Updated: 2026-11-04 01:24:20 UTC |
Contributor
Contributor
Resolved the include conflict in hotspot/jitCodeCache.cpp by keeping both common.h (TEST_LOG, this branch) and counters.h (Counters::, main). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CallTraceStorage allocates no tables until acquire(): the profiler holds none before the first start(). processTraces() on released storage hands the processor only the dropped-trace placeholder instead of crashing. - start(): the nativemem-only failure path and the stack-buffer calloc failure path now close thread registration and release recording memory, like the "no engine activated" path. - Set DebugNonSafepoints at agent load on every HotSpot; COMPILED_METHOD_LOAD is only enabled on the first start(), and its replay cannot add debug info to code compiled before then. - recordTrace0()/recordQueueEnd0() do nothing while the profiler is idle, so they no longer re-allocate the dictionaries stop() released. - patch_pthread_create() re-checks already patched libraries only when glibc's unload count (dlpi_subs) changed since the last full pass. - Move the per-platform MallocHooker patch/unpatch into mallocTracer_linux.cpp and mallocTracer_macos.cpp. - Add missing Datadog copyright lines. - NativeMem::logLive() prints live bytes per category (total in KB) after Profiler::init() and before Profiler::start(); ProfilerLifecycleTest prints its totals in KB. - Update the affected architecture docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict resolution: - Thread registration: take main's gated registration (#912: in-flight counters, _engines_ready/_thread_tables_stable, ThreadTablesFreeze) and drop this branch's _thread_registration_open and CTimer::_registration_open gates, which it supersedes. unregisterThreadInEngines() keeps its NULL engine checks: the pthread_create hook is persistent here, so a thread can exit before the first start(). - CTimer: take main's ctimer.h/ctimer_linux.cpp. - Call-trace buffers: keep acquireRecordingMemory() and the reallocation after stop() freed the buffers, with main's capacity-based sizing; releaseRecordingMemory() now accounts and resets _calltrace_buffer_capacity. - start() error paths: main's rollBackStart() plus releaseRecordingMemory(). - Keep the persistent JVMTI event setup next to main's allocstack resolution. - Docs and AGENTS.md: combine both sides; describe main's registration gates. - allocStackDiagnostics_ut: acquire call-trace storage in the fixture; the storage holds no tables until a recording starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Scan-Build Report
Bug Summary
Reports
|
||||||||||||||||||||||||||||||||||||
- CTimer::stop(): sweep the timers inside releaseTimerTable()'s freeze, after the drain, so a registration that outlived the registration drain cannot publish a timer that the free then loses; without a drain, keep the table and sweep without the freeze. - LivenessTracker: track() drops a sample whose table generation (read before the stack capture) moved, i.e. a callback that straddled a stop and may carry a call_trace_id from released call-trace storage. - start(): a scope guard releases recording memory on every failure after acquireRecordingMemory(), including the replaceCpuEngine() path that leaked. - Intern gate (renamed from the tracer-API gate) also covers ObjectSampler::recordAllocation(); it opens before the engines start, so a late allocation callback cannot re-allocate the released class map. - releaseRecordingMemory(): free the stripe buffers and release call-trace storage outside lockAll(); release() tolerates a concurrent put(). - macOS malloc patch/restore: use a library only while dyld lists its path at the cache's slide; the name-based pin also succeeds after a reload elsewhere. - pthread_create re-check: re-hook only a slot holding the real pthread_create or the library's lazy-binding stub, not a third-party hook. - clearLeakTagsOnObjects(): MUST_POSSESS_CAPABILITY means nothing to clear. - recordQueueEnd0: ignore null names instead of interning "". - Fix stale comments; update the architecture docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ching - Profiler::recordingGeneration(), bumped by releaseRecordingMemory() under lockAll(). ObjectSampler reads it (and the liveness table generation) before resolving the class id; recordJVMTISample() compares it under its stripe lock and drops the sample if it moved, so an allocation callback paused across stop/start cannot emit a class id from the previous recording. - macOS isCurrentImage(): use dladdr() on the cache's Mach-O header instead of iterating dyld image indexes, which shift under concurrent unloads and could make a loaded library look gone (skipping its restore and dropping its entries). Drop the now unused CodeCache::textBase(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?:
Motivation:
Additional Notes:
How to test the change?:
For Datadog employees:
credentials of any kind, I've requested a security review (run the
dd:platform-security-reviewskill, or file a request via the PSEC review form).
bewairealso runs automatically on every PR.Unsure? Have a question? Request a review!