From dd26000238b51f0c260aa097f9e5d80fe1512811 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Fri, 25 Sep 2026 16:19:19 +0000 Subject: [PATCH] Update README.md for optional -PenableFaultInjection and -PenableSamplerPerf builds --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 3b71cb6fc0..863ae4312d 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,26 @@ cd java-profiler The resulting artifact will be in `ddprof-lib/build/libs/ddprof-.jar` +#### Optional Build Flags +Opt-in compile-time flags for the `release`/`debug` configurations. They are +deliberately not applied to `asan`/`tsan`/`fuzzer` builds, but gtest builds +inherit them automatically: + +- `-PenableFaultInjection` — appends `-D__FAULT_INJECTION__`, compiling in + deliberate fault injection used by the fault-injection test suite + (`faultInjection_ut.cpp`) to exercise crash-recovery paths. Never used in + production builds. +- `-PenableSamplerPerf` — appends `-D__SAMPLER_PERF__`, compiling in + per-sampler timing counters that print a stop-time report of per-sampler + cost. See [doc/reference/SamplerPerfCounters.md](doc/reference/SamplerPerfCounters.md). + +```bash +./gradlew buildRelease -PenableFaultInjection +./gradlew buildDebug -PenableFaultInjection +./gradlew buildRelease -PenableSamplerPerf +./gradlew buildDebug -PenableSamplerPerf +``` + #### Gritty details Since the upstream code might not be 100% compatible with the current version of the project, we extend the base classes with Datadog-specific functionality. These extensions are integrated directly into the base files (e.g., `stackWalker.h`)