[Dynamic Instrumentation] DEBUG-4786 Explicitly track open nodes#7988
[Dynamic Instrumentation] DEBUG-4786 Explicitly track open nodes#7988dudikeleti merged 3 commits intomasterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7988) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7988) - mean (69ms) : 67, 70
master - mean (69ms) : 67, 70
section Bailout
This PR (7988) - mean (72ms) : 71, 74
master - mean (72ms) : 71, 74
section CallTarget+Inlining+NGEN
This PR (7988) - mean (1,012ms) : 949, 1075
master - mean (1,029ms) : 933, 1124
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7988) - mean (106ms) : 104, 109
master - mean (106ms) : 104, 108
section Bailout
This PR (7988) - mean (107ms) : 105, 108
master - mean (107ms) : 105, 108
section CallTarget+Inlining+NGEN
This PR (7988) - mean (740ms) : 686, 794
master - mean (736ms) : 679, 793
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7988) - mean (94ms) : 92, 96
master - mean (94ms) : 92, 96
section Bailout
This PR (7988) - mean (95ms) : 93, 96
master - mean (94ms) : 94, 95
section CallTarget+Inlining+NGEN
This PR (7988) - mean (722ms) : 697, 747
master - mean (716ms) : 671, 761
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7988) - mean (92ms) : 90, 95
master - mean (93ms) : 90, 95
section Bailout
This PR (7988) - mean (93ms) : 92, 94
master - mean (93ms) : 92, 95
section CallTarget+Inlining+NGEN
This PR (7988) - mean (636ms) : 619, 653
master - mean (637ms) : 618, 656
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7988) - mean (193ms) : 188, 197
master - mean (194ms) : 188, 200
section Bailout
This PR (7988) - mean (197ms) : 194, 200
master - mean (197ms) : 194, 201
section CallTarget+Inlining+NGEN
This PR (7988) - mean (1,135ms) : 1057, 1214
master - mean (1,136ms) : 1059, 1212
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7988) - mean (278ms) : 273, 283
master - mean (278ms) : 271, 284
section Bailout
This PR (7988) - mean (279ms) : 274, 283
master - mean (277ms) : 274, 281
section CallTarget+Inlining+NGEN
This PR (7988) - mean (935ms) : 898, 971
master - mean (936ms) : 891, 981
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7988) - mean (271ms) : 267, 275
master - mean (272ms) : 265, 280
section Bailout
This PR (7988) - mean (271ms) : 267, 276
master - mean (270ms) : 266, 274
section CallTarget+Inlining+NGEN
This PR (7988) - mean (921ms) : 867, 975
master - mean (916ms) : 854, 978
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7988) - mean (269ms) : 265, 273
master - mean (269ms) : 265, 273
section Bailout
This PR (7988) - mean (270ms) : 267, 273
master - mean (269ms) : 265, 273
section CallTarget+Inlining+NGEN
This PR (7988) - mean (836ms) : 810, 862
master - mean (831ms) : 812, 850
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2025-12-20 13:27:54 Comparing candidate commit ad6cf9c in PR branch Found 7 performance improvements and 7 performance regressions! Performance is the same for 153 metrics, 19 unstable metrics. scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1
scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472
scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1
scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1
scenario:Benchmarks.Trace.NLogBenchmark.EnrichedLog net6.0
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1
scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0
|
This comment has been minimized.
This comment has been minimized.
ad6cf9c to
4e6c883
Compare
…7989) ## Summary of changes Add defensive checks for open nodes before closing them, and delay writing `noCaptureReason` until we are certain that the array node is closed. ## Test coverage #7987 ## Other details This PR is part of an effort to make the Snapshot Exploration Test run successfully end-to-end. Related PRs: #7986 #7988
…l and LogArg to detect null byrefs (#7986) ## Reason for change Some methods can legitimately produce null managed byrefs (e.g., MemoryMarshal.GetReference(emptySpan)), which makes ref T point to address 0. Attempting to capture such locals/args would dereference an invalid reference and could crash in LogLocal/LogArg (NullReferenceException). This change makes DI runs stable and keeps probes installed while avoiding unsafe dereferences ## Implementation details Before reading a ref T capture input, we check Unsafe.IsNullRef(ref value) and return early to avoid dereferencing an invalid reference. Current behavior is to skip capturing that member entirely (no misleading null value for non-nullable types like byte). Follow-up option: if we decide we want the snapshot to explicitly show this case, we can reuse the existing snapshot notCapturedReason mechanism (no new reason added in this PR). ## Test coverage #7987 ## Other details This PR is part of an effort to make the Snapshot Exploration Test run successfully end-to-end. #7988 #7989
## Summary of changes Add a new test that uncovers two bugs: 1. When a null address is passed into our instrumentation code. 2. When locals or arguments exist but are skipped, resulting in an invalid JSON structure. ## Implementation details When a null address is passed to our debugger invoker classes, it must be handled explicitly by checking `Unsafe.IsNullRef`. ## Other details The test is currently skipped and will be enabled once the following PRs are merged: #7986 #7988 #7989
Reason for change
In some cases, we cannot rely on the method metadata to determine whether method arguments and locals exist, as they may still be skipped.
Implementation details
Track open nodes and open/close them as required.
Test coverage
#7987
Other details
This PR is part of an effort to make the Snapshot Exploration Test run successfully end-to-end.
#7986
#7989