File tree Expand file tree Collapse file tree
internal/datadog/profiling/heap_gotter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010``ddheap:free``) USDT sites fire; the Full Host eBPF profiler attaches uprobes.
1111Nothing is collected or uploaded from Python.
1212
13+ Two independent runtime gates, both required for GOT to be patched:
14+
15+ * ``DD_PROFILING_NATIVE_HEAP_ENABLED`` — ddtrace install gate (also the
16+ setup.py build gate). When false, this module is not imported from the
17+ profiler and ``install()`` is never called.
18+ * ``DD_HEAP_SAMPLING_ENABLED`` — libdatadog process-start bypass (unset =
19+ on; ``0``/``false``/``no``/``off`` disables). Honored inside
20+ ``install_heap_overrides``; a falsey value leaves the GOT untouched and
21+ ``install()`` returns False. ddtrace does not set or wrap this variable.
22+
1323``live_heap_enabled()`` is a compile-time property of the loaded artifact
1424(default-on ``live-heap`` feature): True when the cdylib stamps retain flags and
1525emits ``ddheap:free``. False if the cdylib is missing, alloc-only
Original file line number Diff line number Diff line change @@ -381,6 +381,8 @@ def _start_service(self) -> None:
381381 """Start the profiler."""
382382 # See DD_PROFILING_NATIVE_HEAP_ENABLED. install() is permanent; children
383383 # inherit the patched GOT (and the activator skips a redundant re-install).
384+ # libdatadog may still refuse the patch via DD_HEAP_SAMPLING_ENABLED
385+ # (unset = on); that is not a ddtrace setting — see heap_gotter docs.
384386 if profiling_config .native_heap .enabled :
385387 from ddtrace .internal .datadog .profiling import heap_gotter
386388
Original file line number Diff line number Diff line change 1010/// Returns the result of `install_heap_overrides`, i.e. whether at least one
1111/// allocator symbol's GOT entry was resolved and patched (so hooks will run).
1212///
13+ /// libdatadog independently honors `DD_HEAP_SAMPLING_ENABLED` (unset =
14+ /// enabled; `0`/`false`/`no`/`off` disables). That check lives inside
15+ /// `install_heap_overrides`: a falsey value returns false without touching
16+ /// the GOT. Distinct from `DD_PROFILING_NATIVE_HEAP_ENABLED`, which is the
17+ /// ddtrace-side gate that decides whether this function is called. This
18+ /// wrapper does not read or set the libdatadog env var.
19+ ///
1320/// After a successful install, a `fork()` child inherits the mapping and the
1421/// patched GOT, so a second native install is usually unnecessary. Upstream has
1522/// no `pthread_atfork` child reset for the process-global registry mutex
You can’t perform that action at this time.
0 commit comments