Commit 425276d
authored
Add Probe Metadata (#9723)
Introducing ProbeMetadata class to help get probe from instrumented
code. Instead of getting the probe instance from a map based on
probeId we are directly getting it from an array that is filled at
instrumentation time. This way it's cheaper and abstracted the way to
get probe definition to evaluate conditions for example.
In instrumented code, instead of referring the probe by the probeId
hard-coded we are using index in probe metadata array.
ProbeMetadata class encapsulate an AtomicReferenceArray to make sure
every cell as a volatile-style access and provide linear way to remove
or add into this array.
For now linear scanning is fine as we don't expect a lot of probes in
a same location. Could improve on that using bitmaps later if require.
Instrumentation is changed to push int arrays instead of String arrays
and can be optimize later to accept static arguments instead of
varargs/array instead.1 parent 7a9a005 commit 425276d
File tree
36 files changed
+307
-181
lines changed- dd-java-agent
- agent-debugger
- debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger
- src
- main/java/com/datadog/debugger
- agent
- instrumentation
- probe
- test/java/com/datadog/debugger
- agent
- exception
- probe
- trigger
- instrumentation-testing/src/main/groovy/datadog/trace/agent/test
36 files changed
+307
-181
lines changedLines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
298 | 297 | | |
299 | 298 | | |
300 | 299 | | |
301 | 300 | | |
302 | 301 | | |
303 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
304 | 305 | | |
305 | 306 | | |
306 | 307 | | |
| |||
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
329 | 342 | | |
330 | 343 | | |
331 | 344 | | |
| |||
Lines changed: 20 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 147 | + | |
| 148 | + | |
152 | 149 | | |
153 | 150 | | |
154 | 151 | | |
155 | 152 | | |
156 | | - | |
| 153 | + | |
157 | 154 | | |
158 | 155 | | |
159 | 156 | | |
| |||
253 | 250 | | |
254 | 251 | | |
255 | 252 | | |
256 | | - | |
| 253 | + | |
257 | 254 | | |
258 | 255 | | |
259 | 256 | | |
| |||
287 | 284 | | |
288 | 285 | | |
289 | 286 | | |
290 | | - | |
| 287 | + | |
291 | 288 | | |
292 | 289 | | |
293 | | - | |
294 | | - | |
| 290 | + | |
| 291 | + | |
295 | 292 | | |
296 | 293 | | |
297 | 294 | | |
298 | 295 | | |
299 | 296 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
| 297 | + | |
305 | 298 | | |
306 | 299 | | |
307 | 300 | | |
| |||
321 | 314 | | |
322 | 315 | | |
323 | 316 | | |
324 | | - | |
| 317 | + | |
325 | 318 | | |
326 | 319 | | |
327 | | - | |
328 | | - | |
| 320 | + | |
| 321 | + | |
329 | 322 | | |
330 | 323 | | |
331 | 324 | | |
332 | 325 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 326 | + | |
338 | 327 | | |
339 | 328 | | |
340 | 329 | | |
| |||
345 | 334 | | |
346 | 335 | | |
347 | 336 | | |
348 | | - | |
| 337 | + | |
349 | 338 | | |
350 | | - | |
| 339 | + | |
351 | 340 | | |
352 | 341 | | |
353 | 342 | | |
| |||
365 | 354 | | |
366 | 355 | | |
367 | 356 | | |
368 | | - | |
| 357 | + | |
369 | 358 | | |
370 | 359 | | |
371 | 360 | | |
372 | 361 | | |
373 | 362 | | |
374 | 363 | | |
375 | | - | |
376 | | - | |
377 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
378 | 367 | | |
379 | 368 | | |
380 | 369 | | |
| |||
383 | 372 | | |
384 | 373 | | |
385 | 374 | | |
386 | | - | |
| 375 | + | |
387 | 376 | | |
388 | 377 | | |
389 | 378 | | |
| |||
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
122 | 128 | | |
123 | 129 | | |
124 | 130 | | |
| |||
201 | 207 | | |
202 | 208 | | |
203 | 209 | | |
204 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
205 | 215 | | |
206 | 216 | | |
207 | 217 | | |
| |||
231 | 241 | | |
232 | 242 | | |
233 | 243 | | |
| 244 | + | |
234 | 245 | | |
235 | 246 | | |
236 | 247 | | |
| |||
240 | 251 | | |
241 | 252 | | |
242 | 253 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
247 | 258 | | |
248 | | - | |
| 259 | + | |
249 | 260 | | |
250 | 261 | | |
251 | 262 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
| 398 | + | |
398 | 399 | | |
399 | 400 | | |
400 | 401 | | |
| |||
412 | 413 | | |
413 | 414 | | |
414 | 415 | | |
| 416 | + | |
415 | 417 | | |
416 | | - | |
| 418 | + | |
417 | 419 | | |
418 | 420 | | |
419 | 421 | | |
| |||
0 commit comments