Commit 6cc94b2
Add IPOINT configuration via environment variables (#183)
Summary:
Pull Request resolved: #183
Add support for configuring instrumentation point (IPOINT_BEFORE vs IPOINT_AFTER) through two new environment variables:
- CUTRACER_INSTRUMENT_IPOINT_UNIFORM=a|b - Applies the same IPOINT uniformly to all enabled instruments
- CUTRACER_INSTRUMENT_IPOINT=a,b,... - Per-instrument IPOINT list (count must match final enabled instruments)
Design:
- Retired `enabled_instrument_types` (unordered_set) in favor of a single `enabled_instrument_types_ordered` vector + `instrument_type_to_index` map as the source of truth
- `add_enabled_instrument_type()` handles deduplication (returns false if already present)
- Init order: `init_instrumentation` (user-specified) runs first, then `init_analysis` (may add more instruments). Both use the same `add_enabled_instrument_type()`.
- CUTRACER_INSTRUMENT_IPOINT count must match the final `enabled_instrument_types_ordered.size()` (including analysis-added instruments)
- Includes validation for mutual exclusivity and count matching, plus warnings when mem_value_trace uses IPOINT_BEFORE
Reviewed By: FindHao
Differential Revision: D94141021
fbshipit-source-id: 80a51e327689b6138936be9ef071ffacc54875af1 parent c942fec commit 6cc94b2
3 files changed
Lines changed: 352 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
19 | 32 | | |
20 | 33 | | |
21 | 34 | | |
| |||
52 | 65 | | |
53 | 66 | | |
54 | 67 | | |
| 68 | + | |
55 | 69 | | |
56 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
57 | 75 | | |
58 | 76 | | |
59 | 77 | | |
| |||
126 | 144 | | |
127 | 145 | | |
128 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
0 commit comments