Skip to content

Fix ICorProfilerInfo11 framework support message#3194

Merged
andrewlock merged 2 commits into
masterfrom
andrew/fix-native-log
Sep 9, 2022
Merged

Fix ICorProfilerInfo11 framework support message#3194
andrewlock merged 2 commits into
masterfrom
andrew/fix-native-log

Conversation

@andrewlock

@andrewlock andrewlock commented Sep 8, 2022

Copy link
Copy Markdown
Member

Summary of changes

  • Fix the log message in the native loader
  • Record when ICorProfilerInfo12 is available

Reason for change

ICorProfilerInfo11 is supported in .NET Core 3.1, not .NET 5.0.

Implementation details

Update the log and check for ICorProfilerInfo12

Test coverage

N/A

Other details

N/A

@andrewlock andrewlock added the area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native) label Sep 8, 2022
@andrewlock
andrewlock requested review from a team as code owners September 8, 2022 16:01
if (S_OK == corProfilerInfoUnk->QueryInterface(__uuidof(ICorProfilerInfo11), (void**) &tstVerProfilerInfo))
{
Log::Info("ICorProfilerInfo11 available. Profiling API compatibility: .NET Core 5.0 or later.");
Log::Info("ICorProfilerInfo11 available. Profiling API compatibility: .NET Core 3.1 or later.");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add checks for ICorProfilerInfo12 (.NET 5) and ICorProfilerInfo13 (.NET 7)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, let's find out

@andrewlock

Copy link
Copy Markdown
Member Author

Benchmarks Report 🐌

Benchmarks for #3194 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.198
  • 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.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net472 732μs 354ns 1.37μs 0.363 0 0 3.18 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 460μs 204ns 734ns 0 0 0 2.59 KB
#3194 WriteAndFlushEnrichedTraces net472 726μs 345ns 1.29μs 0.363 0 0 3.18 KB
#3194 WriteAndFlushEnrichedTraces netcoreapp3.1 472μs 354ns 1.32μs 0 0 0 2.58 KB
Benchmarks.Trace.AppSecBodyBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #3194

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.AppSecBodyBenchmark.AllCycleSimpleBody‑net472 1.198 225.32 188.14

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net472 226ns 0.208ns 0.806ns 0.0675 0 0 425 B
master AllCycleSimpleBody netcoreapp3.1 238ns 0.278ns 1.04ns 0.00586 0 0 424 B
master AllCycleMoreComplexBody net472 185ns 0.108ns 0.403ns 0.0637 0 0 401 B
master AllCycleMoreComplexBody netcoreapp3.1 233ns 0.286ns 1.07ns 0.00537 0 0 400 B
master BodyExtractorSimpleBody net472 267ns 0.315ns 1.22ns 0.0573 0 0 361 B
master BodyExtractorSimpleBody netcoreapp3.1 229ns 0.354ns 1.37ns 0.00368 0 0 272 B
master BodyExtractorMoreComplexBody net472 14.6μs 10.3ns 39.9ns 1.21 0.0145 0 7.62 KB
master BodyExtractorMoreComplexBody netcoreapp3.1 11.8μs 17.8ns 68.9ns 0.0888 0 0 6.75 KB
#3194 AllCycleSimpleBody net472 188ns 0.204ns 0.737ns 0.0676 0 0 425 B
#3194 AllCycleSimpleBody netcoreapp3.1 236ns 0.0803ns 0.278ns 0.00589 0 0 424 B
#3194 AllCycleMoreComplexBody net472 185ns 0.211ns 0.818ns 0.0637 0 0 401 B
#3194 AllCycleMoreComplexBody netcoreapp3.1 234ns 0.427ns 1.65ns 0.00549 0 0 400 B
#3194 BodyExtractorSimpleBody net472 281ns 0.309ns 1.11ns 0.0573 0 0 361 B
#3194 BodyExtractorSimpleBody netcoreapp3.1 228ns 0.205ns 0.767ns 0.00378 0 0 272 B
#3194 BodyExtractorMoreComplexBody net472 14.4μs 10.2ns 39.6ns 1.21 0.0216 0 7.62 KB
#3194 BodyExtractorMoreComplexBody netcoreapp3.1 12μs 15.9ns 59.3ns 0.0892 0 0 6.75 KB
Benchmarks.Trace.AspNetCoreBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
master SendRequest netcoreapp3.1 183μs 192ns 743ns 0.273 0 0 20.57 KB
#3194 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
#3194 SendRequest netcoreapp3.1 184μs 232ns 870ns 0.186 0 0 20.57 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 net472 1.86μs 1.36ns 5.27ns 0.15 0.000922 0 947 B
master ExecuteNonQuery netcoreapp3.1 1.45μs 0.442ns 1.65ns 0.0124 0 0 936 B
#3194 ExecuteNonQuery net472 1.88μs 0.827ns 3.2ns 0.15 0.000941 0 947 B
#3194 ExecuteNonQuery netcoreapp3.1 1.44μs 0.819ns 3.07ns 0.0124 0 0 936 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 net472 2.49μs 2.05ns 7.93ns 0.183 0 0 1.16 KB
master CallElasticsearch netcoreapp3.1 1.6μs 1.06ns 3.95ns 0.0151 0 0 1.1 KB
master CallElasticsearchAsync net472 2.61μs 0.571ns 2.21ns 0.205 0 0 1.29 KB
master CallElasticsearchAsync netcoreapp3.1 1.62μs 0.355ns 1.33ns 0.0163 0 0 1.22 KB
#3194 CallElasticsearch net472 2.49μs 0.697ns 2.7ns 0.183 0 0 1.16 KB
#3194 CallElasticsearch netcoreapp3.1 1.59μs 0.685ns 2.47ns 0.0151 0 0 1.1 KB
#3194 CallElasticsearchAsync net472 2.69μs 0.888ns 3.32ns 0.204 0 0 1.29 KB
#3194 CallElasticsearchAsync netcoreapp3.1 1.63μs 0.448ns 1.74ns 0.0162 0 0 1.22 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 net472 2.66μs 7.3ns 28.3ns 0.225 0 0 1.42 KB
master ExecuteAsync netcoreapp3.1 1.81μs 5.04ns 19.5ns 0.0185 0 0 1.34 KB
#3194 ExecuteAsync net472 2.7μs 6.49ns 24.3ns 0.225 0 0 1.42 KB
#3194 ExecuteAsync netcoreapp3.1 1.69μs 3.8ns 14.7ns 0.0185 0 0 1.34 KB
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net472 5.73μs 14ns 54.1ns 0.44 0 0 2.77 KB
master SendAsync netcoreapp3.1 3.61μs 6.13ns 22.9ns 0.0358 0 0 2.6 KB
#3194 SendAsync net472 5.64μs 15.1ns 58.4ns 0.439 0 0 2.77 KB
#3194 SendAsync netcoreapp3.1 3.54μs 9.76ns 37.8ns 0.0358 0 0 2.6 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 net472 3.13μs 3.58ns 13.4ns 0.287 0 0 1.81 KB
master EnrichedLog netcoreapp3.1 2.47μs 2.74ns 10.6ns 0.0248 0 0 1.85 KB
#3194 EnrichedLog net472 3.29μs 2.79ns 10.8ns 0.287 0 0 1.81 KB
#3194 EnrichedLog netcoreapp3.1 2.46μs 1.37ns 5.11ns 0.0257 0 0 1.85 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 net472 154μs 210ns 812ns 0.692 0.231 0 4.65 KB
master EnrichedLog netcoreapp3.1 117μs 232ns 900ns 0.0586 0 0 4.49 KB
#3194 EnrichedLog net472 153μs 111ns 431ns 0.691 0.23 0 4.65 KB
#3194 EnrichedLog netcoreapp3.1 118μs 151ns 565ns 0.0588 0 0 4.49 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 net472 5.57μs 17.2ns 66.7ns 0.569 0.00273 0 3.59 KB
master EnrichedLog netcoreapp3.1 4.21μs 8.57ns 33.2ns 0.054 0 0 3.91 KB
#3194 EnrichedLog net472 5.55μs 11.6ns 44.9ns 0.568 0.00271 0 3.59 KB
#3194 EnrichedLog netcoreapp3.1 4.32μs 6.8ns 26.4ns 0.0524 0 0 3.91 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 net472 2.33μs 2.92ns 11.3ns 0.217 0 0 1.37 KB
master SendReceive netcoreapp3.1 1.88μs 0.878ns 3.29ns 0.0177 0 0 1.32 KB
#3194 SendReceive net472 2.43μs 1.68ns 6.52ns 0.218 0 0 1.37 KB
#3194 SendReceive netcoreapp3.1 1.81μs 1.08ns 4.05ns 0.0172 0 0 1.32 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 net472 5.13μs 1.91ns 7.14ns 0.354 0 0 2.23 KB
master EnrichedLog netcoreapp3.1 4.38μs 3.45ns 12ns 0.0241 0 0 1.8 KB
#3194 EnrichedLog net472 4.97μs 3.83ns 14.8ns 0.353 0 0 2.23 KB
#3194 EnrichedLog netcoreapp3.1 4.34μs 1.87ns 7.02ns 0.0239 0 0 1.8 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net472 1.13μs 1.95ns 7.57ns 0.129 0 0 810 B
master StartFinishSpan netcoreapp3.1 923ns 0.441ns 1.71ns 0.0105 0 0 760 B
master StartFinishScope net472 1.39μs 0.816ns 3.16ns 0.141 0 0 891 B
master StartFinishScope netcoreapp3.1 1.02μs 0.398ns 1.54ns 0.0117 0 0 880 B
#3194 StartFinishSpan net472 1.16μs 0.84ns 3.25ns 0.129 0 0 810 B
#3194 StartFinishSpan netcoreapp3.1 928ns 5.09ns 30.5ns 0.0105 0 0 760 B
#3194 StartFinishScope net472 1.4μs 0.203ns 0.733ns 0.141 0 0 891 B
#3194 StartFinishScope netcoreapp3.1 1.07μs 0.388ns 1.45ns 0.0118 0 0 880 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 net472 1.51μs 1.19ns 4.46ns 0.141 0 0 891 B
master RunOnMethodBegin netcoreapp3.1 1.18μs 0.792ns 2.96ns 0.0118 0 0 880 B
#3194 RunOnMethodBegin net472 1.54μs 0.628ns 2.43ns 0.141 0 0 891 B
#3194 RunOnMethodBegin netcoreapp3.1 1.31μs 0.47ns 1.76ns 0.0118 0 0 880 B

@andrewlock

Copy link
Copy Markdown
Member Author

Code Coverage Report 📊

✔️ Merging #3194 into master will not change line coverage
✔️ Merging #3194 into master will will increase branch coverage by 1%
✔️ Merging #3194 into master will will decrease complexity by 6

master #3194 Change
Lines 17675 / 24344 17775 / 24344
Lines % 73% 73% 0% ✔️
Branches 10392 / 14964 10483 / 14960
Branches % 69% 70% 1% ✔️
Complexity 16166 16160 -6 ✔️

View the full report for further details:

Datadog.Trace Breakdown ✔️

master #3194 Change
Lines % 73% 73% 0% ✔️
Branches % 69% 70% 1% ✔️
Complexity 16166 16160 -6 ✔️

The following classes have significant coverage changes.

File Line coverage change Branch coverage change Complexity change
Datadog.Trace.Ci.GitInfo -17% -11% 0 ✔️
Datadog.Trace.Ci.CIVisibility 5% ✔️ 6% ✔️ 0 ✔️
Datadog.Trace.Logging.DatadogSerilogLogger 5% ✔️ 6% ✔️ 0 ✔️
Datadog.Trace.Agent.StatsAggregator 11% ✔️ 28% ✔️ 0 ✔️
Datadog.Trace.Processors.ObfuscatorTraceProcessor 12% ✔️ 15% ✔️ 0 ✔️
Datadog.Trace.Processors.NormalizerTraceProcessor 22% ✔️ 19% ✔️ 0 ✔️
Datadog.Trace.Telemetry.Transports.JsonTelemetryTransport 30% ✔️ 42% ✔️ 0 ✔️
Datadog.Trace.Util.SamplingHelpers 50% ✔️ 50% ✔️ 0 ✔️
Datadog.Trace.Agent.TraceSamplers.RareSampler 89% ✔️ 96% ✔️ 0 ✔️
Datadog.Trace.Agent.TraceSamplers.PrioritySampler 100% ✔️ 0% ✔️ 0 ✔️
...And 3 more

1 classes were removed from Datadog.Trace in #3194

View the full reports for further details:

@andrewlock
andrewlock merged commit 4cfe648 into master Sep 9, 2022
@andrewlock
andrewlock deleted the andrew/fix-native-log branch September 9, 2022 08:55
@github-actions github-actions Bot added this to the vNext milestone Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native) area:shared-components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants