[Debugger] Stabilized the instrumentation of Method Probes and Line Probes#3164
Conversation
3903b17 to
86b5da9
Compare
This comment has been minimized.
This comment has been minimized.
748566e to
f33d95e
Compare
This comment has been minimized.
This comment has been minimized.
c5f529c to
2cf4cb9
Compare
This comment has been minimized.
This comment has been minimized.
2cf4cb9 to
4c49fbd
Compare
This comment has been minimized.
This comment has been minimized.
4c49fbd to
dd442bb
Compare
This comment has been minimized.
This comment has been minimized.
f6f8ca2 to
dea8c94
Compare
This comment has been minimized.
This comment has been minimized.
4010753 to
87ad71b
Compare
87ad71b to
b095e64
Compare
This comment has been minimized.
This comment has been minimized.
b095e64 to
de453b4
Compare
This comment has been minimized.
This comment has been minimized.
de453b4 to
e0b7860
Compare
Just double-checking, is the disabling of c'tor instrumentation only for live debugger instrumentation? We have a couple of tracer instrumentations that rely on instrumenting the c'tor of a library type |
zacharycmontoya
left a comment
There was a problem hiding this comment.
LGTM in regards to the Datadog.Tracer.Native files that are shared with the Tracer
Yep, I added this check in our rewriter: |
97d3033 to
ef35009
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ef35009 to
28176ac
Compare
This comment has been minimized.
This comment has been minimized.
tonyredondo
left a comment
There was a problem hiding this comment.
LGTM ( I reviewed the tracer's C++ parts )
…gger to instrument a method
…ues + memory leak in ProbeRateLimiter + Line probe document invalid searching + Increased blamre dump from 1 min to 60 min + activated several tests
…Comment + disabled the line probe test of `AsyncInstanceMethod`
28176ac to
b0eeffd
Compare
Benchmarks Report 🐌Benchmarks for #3164 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️Raw results
|
Code Coverage Report 📊
View the full report for further details: Datadog.Trace Breakdown
|
| master | #3164 | Change | |
|---|---|---|---|
| Lines % | 72% |
68% |
-4% |
| Branches % | 69% |
67% |
-2% |
| Complexity | 16477 |
16491 |
14 ⛔ |
The following classes have significant coverage changes.
| File | Line coverage change | Branch coverage change | Complexity change |
|---|---|---|---|
| Datadog.Trace.Debugger.PInvoke.NativeMethodProbeDefinition | -100% ⛔ |
-100% ⛔ |
0 ✔️ |
| Datadog.Trace.Debugger.Sink.SnapshotSink | -100% ⛔ |
-100% ⛔ |
0 ✔️ |
| Datadog.Trace.Debugger.Snapshots.LazySnapshotSerializerFieldsAndPropsSelector | -100% ⛔ |
-100% ⛔ |
0 ✔️ |
| Datadog.Trace.Debugger.Snapshots.DebuggerSnapshotCreator | -100% ⛔ |
-68% ⛔ |
1 ⛔ |
| BoundLineProbeLocation | -100% ⛔ |
0% ✔️ |
0 ✔️ |
| Datadog.Trace.Debugger.CapturedLines | -100% ⛔ |
0% ✔️ |
0 ✔️ |
| Datadog.Trace.Debugger.Instrumentation.DebuggerReturn | -100% ⛔ |
0% ✔️ |
0 ✔️ |
| Datadog.Trace.Debugger.Instrumentation.MethodMetadataInfo | -100% ⛔ |
0% ✔️ |
0 ✔️ |
| Datadog.Trace.Debugger.Models.LineProbeResolveResult | -100% ⛔ |
0% ✔️ |
0 ✔️ |
| Datadog.Trace.Debugger.PInvoke.NativeLineProbeDefinition | -100% ⛔ |
0% ✔️ |
0 ✔️ |
| ...And 74 more |
View the full reports for further details:
Summary of changes
The Exploration Tests revealed numerous
InvalidProgramException&BadImageFormatException&TypeLoadException(and more) that occurred due to faulty instrumentation of the Live Debugger. This PR introduces fixes to all of them.Reason for change
We are starting to evaluate the Live Debugger with beta testers, it's crucial to have resilient instrumentation that will NEVER break customer code what-so-ever.
Implementation details
refreturn value (Internal Jira Ticket:DEBUG-1065).InvalidProgramExceptionthat occur when we attempt to place a Method Probe on c'tors that reside in an assembly that is marked as 'Transparent Code' security level as part of CAS which only applicable in .NET Framework). To be on the safe side I disabled the instrumentation of c'tors regardless of the .NET Runtime in use (.NET Framework / .NET Core). (Internal Jira Ticket:DEBUG-1063).retinstruction.this).InvalidProgramException.ProbeRateLimiter(exposed by the Exploration Tests).MissingFieldExceptionthat happened because we were adding our State Machine's boolean field (IsReEnter) at incorrect timing (when the probe was applied, which sometime was after the containing module was loaded) - now I'm adding it onModuleLoadFinishedto all Compiler-Generated State Machines (async transformation) that can be found.Test coverage
EmptyCtorTestandNonEmptyCtorTestare in place to make sure we avoid instrumenting those.CtorTransparentCodeTest(that uses a new dependencySamples.Probes.Externalthat creates an assembly that is marked asTransparentusing SecurityTransparentAttribute).GenericRefReturnTest.