Commit 8657403
authored
fix(gpu): gate the event monitor on enable_ebpf_probes (#54372)
### What does this PR do?
Gates the system-probe event monitor on `gpu_monitoring.enable_ebpf_probes` in
addition to `gpu_monitoring.enabled`, in both the module-enablement logic
(`pkg/system-probe/config`) and the GPU process-consumer creation
(`cmd/system-probe/modules/eventmonitor.go`).
The GPU monitoring module itself remains gated on `gpu_monitoring.enabled`, so
NVML-based collection is unchanged.
### Motivation
The event monitor exists only to feed process exec/exit events to the GPU eBPF
probes. Keyed on `gpu_monitoring.enabled` alone, a host running GPU monitoring
through NVML only still loaded the event monitor's eBPF programs and built a
process consumer that nothing read.
Follow-up to the discussion on #54291.
### Describe how you validated your changes
Extended `TestEventMonitor` with the `enabled` × `enable_ebpf_probes` matrix,
setting both explicitly rather than relying on the default (which is changing as
the probes are deprecated). Verified that with the probes disabled the `gpu`
module is still enabled while `event_monitor` is not:
| `gpu_monitoring.enabled` | `enable_ebpf_probes` | enabled modules |
| --- | --- | --- |
| true | true | `discovery, event_monitor, gpu` |
| true | false | `discovery, gpu` |
| false | true | `discovery` |
Also built `cmd/system-probe/modules` with `linux_bpf,nvml` to cover the
configuration that includes both `eventmonitor.go` and the real `gpu.go`.
### Additional Notes
Both gates had to move together to stay consistent with the
`EnableEBPFProbes && processEventConsumer == nil` guard in the GPU module
factory.
Note that `gpu_monitoring.enable_ebpf_probes` still defaults to `true` on `main`,
so this is a no-op for default configurations until #54291 lands; it currently
only affects deployments that set it to `false` explicitly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: matteo.bertrone <matteo.bertrone@datadoghq.com>1 parent 822ef92 commit 8657403
3 files changed
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| |||
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
148 | | - | |
| 151 | + | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
| |||
0 commit comments