Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dynamic Instrumentation] Fixed SymDB upload when PDB is absent #5789

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

GreenMatan
Copy link
Contributor

@GreenMatan GreenMatan commented Jul 17, 2024

Summary of changes

We had some issues in building up the symbols when PDB is absent which lead to failure in uploading them.

Reason for change

We are entering into the Open Beta of "Autocomplete and Search" feature of the Dynamic Instrumentation product and want to make sure things are working before shipping it. The absent of PDBs is a common scenario and we still want to display Methods and Classes information that exist in the assembly itself. Failing to build the symbols may yield bad user experience and possibly hurt the adoption of DI for .NET.

Implementation details

Mainly fixed a miscalculation of an index that lead to IndexOutOfBoundsException.

@GreenMatan GreenMatan requested a review from a team as a code owner July 17, 2024 07:59
@github-actions github-actions bot added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) area:debugger labels Jul 17, 2024
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jul 17, 2024

Datadog Report

Branch report: matang/symbdb-fixes
Commit report: 3f0daea
Test service: dd-trace-dotnet

✅ 0 Failed, 354051 Passed, 2251 Skipped, 22h 46m 51.16s Total Time

@andrewlock
Copy link
Member

andrewlock commented Jul 17, 2024

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-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 shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

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).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5789) - mean (76ms)  : 67, 85
     .   : milestone, 76,
    master - mean (75ms)  : 64, 87
     .   : milestone, 75,

    section CallTarget+Inlining+NGEN
    This PR (5789) - mean (1,045ms)  : 1027, 1063
     .   : milestone, 1045,
    master - mean (1,051ms)  : 1026, 1077
     .   : milestone, 1051,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5789) - mean (111ms)  : 107, 115
     .   : milestone, 111,
    master - mean (110ms)  : 107, 114
     .   : milestone, 110,

    section CallTarget+Inlining+NGEN
    This PR (5789) - mean (728ms)  : 709, 747
     .   : milestone, 728,
    master - mean (739ms)  : 715, 764
     .   : milestone, 739,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5789) - mean (95ms)  : 92, 99
     .   : milestone, 95,
    master - mean (94ms)  : 90, 98
     .   : milestone, 94,

    section CallTarget+Inlining+NGEN
    This PR (5789) - mean (684ms)  : 662, 706
     .   : milestone, 684,
    master - mean (689ms)  : 666, 711
     .   : milestone, 689,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5789) - mean (193ms)  : 189, 197
     .   : milestone, 193,
    master - mean (192ms)  : 188, 195
     .   : milestone, 192,

    section CallTarget+Inlining+NGEN
    This PR (5789) - mean (1,135ms)  : 1113, 1157
     .   : milestone, 1135,
    master - mean (1,158ms)  : 1134, 1182
     .   : milestone, 1158,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5789) - mean (278ms)  : 271, 286
     .   : milestone, 278,
    master - mean (276ms)  : 272, 280
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (5789) - mean (911ms)  : 882, 940
     .   : milestone, 911,
    master - mean (937ms)  : 920, 955
     .   : milestone, 937,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5789) - mean (265ms)  : 261, 269
     .   : milestone, 265,
    master - mean (265ms)  : 261, 268
     .   : milestone, 265,

    section CallTarget+Inlining+NGEN
    This PR (5789) - mean (888ms)  : 864, 912
     .   : milestone, 888,
    master - mean (913ms)  : 895, 931
     .   : milestone, 913,

Loading

@andrewlock
Copy link
Member

andrewlock commented Jul 17, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #5789 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.250
  • All benchmarks have the same allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 7.9μs 44.7ns 316ns 0.0157 0.00784 0 5.42 KB
master StartStopWithChild netcoreapp3.1 10μs 53.5ns 283ns 0.0196 0.0049 0 5.62 KB
master StartStopWithChild net472 16.2μs 60.7ns 235ns 1.02 0.303 0.0957 6.06 KB
#5789 StartStopWithChild net6.0 7.8μs 44.9ns 351ns 0.0156 0.0078 0 5.42 KB
#5789 StartStopWithChild netcoreapp3.1 9.72μs 50.7ns 248ns 0.0189 0.00946 0 5.62 KB
#5789 StartStopWithChild net472 16.1μs 40.6ns 157ns 1.02 0.299 0.105 6.06 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 470μs 172ns 645ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 630μs 119ns 446ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 833μs 492ns 1.84μs 0.414 0 0 3.3 KB
#5789 WriteAndFlushEnrichedTraces net6.0 491μs 282ns 1.05μs 0 0 0 2.7 KB
#5789 WriteAndFlushEnrichedTraces netcoreapp3.1 648μs 124ns 447ns 0 0 0 2.7 KB
#5789 WriteAndFlushEnrichedTraces net472 845μs 562ns 2.18μs 0.419 0 0 3.3 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 171μs 266ns 1.03μs 0.254 0 0 18.45 KB
master SendRequest netcoreapp3.1 193μs 479ns 1.85μs 0.192 0 0 20.61 KB
master SendRequest net472 0.00171ns 0.000564ns 0.00218ns 0 0 0 0 b
#5789 SendRequest net6.0 172μs 205ns 768ns 0.169 0 0 18.45 KB
#5789 SendRequest netcoreapp3.1 191μs 263ns 1.02μs 0.192 0 0 20.61 KB
#5789 SendRequest net472 1.48E‑05ns 1.02E‑05ns 3.55E‑05ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 543μs 293ns 1.1μs 0.532 0 0 41.45 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 641μs 1.59μs 6.17μs 0.321 0 0 41.72 KB
master WriteAndFlushEnrichedTraces net472 842μs 4.23μs 19.9μs 8.19 2.59 0.431 53.25 KB
#5789 WriteAndFlushEnrichedTraces net6.0 539μs 1.63μs 6.32μs 0.541 0 0 41.6 KB
#5789 WriteAndFlushEnrichedTraces netcoreapp3.1 649μs 1.34μs 5.2μs 0.324 0 0 41.69 KB
#5789 WriteAndFlushEnrichedTraces net472 880μs 2.7μs 10.1μs 8.56 2.57 0.428 53.25 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.19μs 0.762ns 2.95ns 0.0139 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.68μs 1.12ns 4.33ns 0.0135 0 0 1.02 KB
master ExecuteNonQuery net472 2.03μs 1.26ns 4.72ns 0.157 0 0 987 B
#5789 ExecuteNonQuery net6.0 1.32μs 0.631ns 2.44ns 0.0146 0 0 1.02 KB
#5789 ExecuteNonQuery netcoreapp3.1 1.76μs 0.934ns 3.62ns 0.014 0 0 1.02 KB
#5789 ExecuteNonQuery net472 1.91μs 1.78ns 6.91ns 0.156 0 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.26μs 0.984ns 3.68ns 0.0133 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.62μs 0.71ns 2.56ns 0.013 0 0 976 B
master CallElasticsearch net472 2.53μs 1.96ns 7.61ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.28μs 0.561ns 2.17ns 0.0135 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.6μs 0.738ns 2.76ns 0.0136 0 0 1.02 KB
master CallElasticsearchAsync net472 2.57μs 1.46ns 5.66ns 0.166 0.00129 0 1.05 KB
#5789 CallElasticsearch net6.0 1.17μs 1.01ns 3.51ns 0.014 0 0 976 B
#5789 CallElasticsearch netcoreapp3.1 1.6μs 0.594ns 2.3ns 0.0128 0 0 976 B
#5789 CallElasticsearch net472 2.54μs 1.33ns 5.16ns 0.158 0 0 995 B
#5789 CallElasticsearchAsync net6.0 1.29μs 0.457ns 1.71ns 0.013 0 0 952 B
#5789 CallElasticsearchAsync netcoreapp3.1 1.73μs 0.755ns 2.92ns 0.0139 0 0 1.02 KB
#5789 CallElasticsearchAsync net472 2.62μs 1.23ns 4.45ns 0.166 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.15μs 0.176ns 0.634ns 0.0133 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.59μs 1.41ns 5.28ns 0.0127 0 0 952 B
master ExecuteAsync net472 1.81μs 1.48ns 5.75ns 0.145 0.000902 0 915 B
#5789 ExecuteAsync net6.0 1.11μs 0.31ns 1.16ns 0.0134 0 0 952 B
#5789 ExecuteAsync netcoreapp3.1 1.55μs 0.914ns 3.42ns 0.0131 0 0 952 B
#5789 ExecuteAsync net472 1.89μs 0.568ns 2.13ns 0.145 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.23μs 1.77ns 6.63ns 0.0295 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.06μs 2.53ns 9.81ns 0.0377 0 0 2.76 KB
master SendAsync net472 7.93μs 2.85ns 11ns 0.497 0 0 3.15 KB
#5789 SendAsync net6.0 4.14μs 1.18ns 4.59ns 0.0311 0 0 2.22 KB
#5789 SendAsync netcoreapp3.1 5.06μs 2.36ns 9.14ns 0.0379 0 0 2.76 KB
#5789 SendAsync net472 7.91μs 1.44ns 5.38ns 0.497 0 0 3.15 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.62μs 0.652ns 2.44ns 0.0227 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.2μs 1.52ns 5.88ns 0.0221 0 0 1.64 KB
master EnrichedLog net472 2.63μs 1.33ns 5.15ns 0.249 0 0 1.57 KB
#5789 EnrichedLog net6.0 1.51μs 0.458ns 1.72ns 0.0234 0 0 1.64 KB
#5789 EnrichedLog netcoreapp3.1 2.31μs 0.716ns 2.58ns 0.022 0 0 1.64 KB
#5789 EnrichedLog net472 2.51μs 1.75ns 6.77ns 0.249 0 0 1.57 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 115μs 79.8ns 288ns 0.0572 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 117μs 94.5ns 366ns 0.0583 0 0 4.28 KB
master EnrichedLog net472 147μs 57.5ns 223ns 0.663 0.221 0 4.46 KB
#5789 EnrichedLog net6.0 114μs 194ns 750ns 0.0562 0 0 4.28 KB
#5789 EnrichedLog netcoreapp3.1 119μs 236ns 916ns 0.0586 0 0 4.28 KB
#5789 EnrichedLog net472 150μs 48.7ns 189ns 0.675 0.225 0 4.46 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.87μs 0.546ns 2.12ns 0.0312 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.23μs 0.981ns 3.54ns 0.0297 0 0 2.2 KB
master EnrichedLog net472 4.88μs 1.22ns 4.57ns 0.319 0 0 2.02 KB
#5789 EnrichedLog net6.0 2.94μs 1.49ns 5.77ns 0.0309 0 0 2.2 KB
#5789 EnrichedLog netcoreapp3.1 4.13μs 2.31ns 8.65ns 0.0294 0 0 2.2 KB
#5789 EnrichedLog net472 4.84μs 1.15ns 4.47ns 0.32 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.41μs 0.913ns 3.54ns 0.0161 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.66μs 0.916ns 3.55ns 0.0149 0 0 1.14 KB
master SendReceive net472 2.04μs 1.46ns 5.67ns 0.183 0 0 1.16 KB
#5789 SendReceive net6.0 1.44μs 1.19ns 4.62ns 0.0159 0 0 1.14 KB
#5789 SendReceive netcoreapp3.1 1.8μs 3.05ns 11.8ns 0.0152 0 0 1.14 KB
#5789 SendReceive net472 2.03μs 1.34ns 5.01ns 0.183 0.00204 0.00102 1.16 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.82μs 0.895ns 3.47ns 0.0226 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.93μs 5.93ns 23ns 0.0214 0 0 1.65 KB
master EnrichedLog net472 4.33μs 2.33ns 9.01ns 0.323 0 0 2.04 KB
#5789 EnrichedLog net6.0 2.7μs 0.748ns 2.8ns 0.023 0 0 1.6 KB
#5789 EnrichedLog netcoreapp3.1 3.81μs 1.93ns 7.47ns 0.0212 0 0 1.65 KB
#5789 EnrichedLog net472 4.36μs 1.56ns 5.63ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5789

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.250 577.90 722.28

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 405ns 0.182ns 0.704ns 0.00809 0 0 576 B
master StartFinishSpan netcoreapp3.1 568ns 0.503ns 1.95ns 0.00768 0 0 576 B
master StartFinishSpan net472 579ns 0.732ns 2.84ns 0.0918 0 0 578 B
master StartFinishScope net6.0 532ns 0.209ns 0.811ns 0.00983 0 0 696 B
master StartFinishScope netcoreapp3.1 766ns 0.379ns 1.47ns 0.0095 0 0 696 B
master StartFinishScope net472 900ns 0.62ns 2.4ns 0.104 0 0 658 B
#5789 StartFinishSpan net6.0 394ns 0.144ns 0.558ns 0.00811 0 0 576 B
#5789 StartFinishSpan netcoreapp3.1 630ns 0.409ns 1.59ns 0.00786 0 0 576 B
#5789 StartFinishSpan net472 722ns 0.561ns 2.02ns 0.0915 0 0 578 B
#5789 StartFinishScope net6.0 520ns 0.139ns 0.538ns 0.00987 0 0 696 B
#5789 StartFinishScope netcoreapp3.1 711ns 0.211ns 0.788ns 0.00951 0 0 696 B
#5789 StartFinishScope net472 864ns 0.455ns 1.7ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 676ns 0.312ns 1.21ns 0.00988 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 895ns 0.243ns 0.909ns 0.00941 0 0 696 B
master RunOnMethodBegin net472 1.14μs 1.46ns 5.64ns 0.104 0 0 658 B
#5789 RunOnMethodBegin net6.0 653ns 0.288ns 1.11ns 0.00969 0 0 696 B
#5789 RunOnMethodBegin netcoreapp3.1 912ns 0.404ns 1.51ns 0.00918 0 0 696 B
#5789 RunOnMethodBegin net472 1.07μs 2.2ns 8.23ns 0.104 0 0 658 B

@GreenMatan GreenMatan merged commit bb443e4 into master Jul 17, 2024
59 of 62 checks passed
@GreenMatan GreenMatan deleted the matang/symbdb-fixes branch July 17, 2024 12:37
@github-actions github-actions bot added this to the vNext-v2 milestone Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:debugger area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants