Implement 64-bit trace ID system with double-buffered storage and liveness tracking#262
Merged
Implement 64-bit trace ID system with double-buffered storage and liveness tracking#262
Conversation
Contributor
55f7fa6 to
98d82be
Compare
Contributor
98d82be to
0e22d49
Compare
What does this PR do?:
This PR implements a liveness-aware double-buffered call trace storage system with several key improvements:
CallTraceHashTableclassMotivation:
The changes address critical issues in call trace management:
Additional Notes:
Key Features:
Liveness-Aware Storage:
processTraces()methodContention Handling:
<dropped due to contention>shown in JFR stack traces instead of null entriesDouble-Buffered Architecture:
(instance_id << 32) | slotpreventing collisionsHash Table Improvements:
CallTraceHashTableclass (441 lines)Implementation Details:
Core Storage Refactoring:
CallTraceStoragereduced from 265→142 lines through hash table extraction64-bit Trace ID Migration:
recordJVMTISample(),recordSample(),recordDeferredSample()LivenessTrackerfor 64-bit trace ID handlingPlatform Compatibility:
arch_dd.hfor consistent designated initializer syntaxNew Files:
callTraceHashTable.{h,cpp}- Dedicated hash table implementation (441 lines)test_callTraceStorage.cpp- Comprehensive unit tests with liveness scenarios (387 lines)LivenessTrackingTest.java- Java integration test for end-to-end validation (246 lines)ContendedCallTraceStorageTest.java- Contention measurement and validation test (249 lines)Modified Files:
profiler.{h,cpp},objectSampler.cpp,wallClock.{h,cpp}- 64-bit trace ID adoptioncallTraceStorage.{h,cpp}- major refactoring with liveness integrationflightRecorder.{h,cpp}- 64-bit trace ID support and dropped trace handlinglivenessTracker.{h,cpp}- 64-bit trace ID migrationarch_dd.h- COMMA macro consolidationHow to test the change?:
The implementation includes extensive test coverage:
CallTraceStorageliveness scenariosFor Datadog employees:
@DataDog/security-design-and-guidance.Summary: +1689 lines, -447 lines (net +1239 lines)
This implementation provides a robust foundation for liveness-aware profiling with clear visibility into contention issues while maintaining high performance through lock-free operations and efficient storage management.