Conversation
cf94f93 to
66dbc18
Compare
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8021) 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 (8021) - mean (70ms) : 67, 72
master - mean (68ms) : 67, 70
section Bailout
This PR (8021) - mean (73ms) : 71, 75
master - mean (72ms) : 71, 73
section CallTarget+Inlining+NGEN
This PR (8021) - mean (1,020ms) : 968, 1072
master - mean (1,008ms) : 968, 1048
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 (8021) - mean (111ms) : 106, 117
master - mean (106ms) : 104, 108
section Bailout
This PR (8021) - mean (110ms) : 107, 114
master - mean (107ms) : 106, 108
section CallTarget+Inlining+NGEN
This PR (8021) - mean (741ms) : 672, 810
master - mean (731ms) : 669, 793
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8021) - mean (98ms) : 92, 103
master - mean (93ms) : 91, 96
section Bailout
This PR (8021) - mean (98ms) : 95, 101
master - mean (94ms) : 93, 95
section CallTarget+Inlining+NGEN
This PR (8021) - mean (713ms) : 669, 758
master - mean (713ms) : 682, 744
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8021) - mean (94ms) : 91, 98
master - mean (92ms) : 90, 94
section Bailout
This PR (8021) - mean (95ms) : 94, 97
master - mean (93ms) : 92, 94
section CallTarget+Inlining+NGEN
This PR (8021) - mean (638ms) : 620, 656
master - mean (630ms) : 618, 643
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 (8021) - mean (195ms) : 190, 199
master - mean (193ms) : 189, 198
section Bailout
This PR (8021) - mean (197ms) : 195, 200
master - mean (197ms) : 194, 199
section CallTarget+Inlining+NGEN
This PR (8021) - mean (1,125ms) : 1059, 1190
master - mean (1,112ms) : 1061, 1164
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 (8021) - mean (278ms) : 273, 283
master - mean (277ms) : 272, 282
section Bailout
This PR (8021) - mean (279ms) : 274, 284
master - mean (277ms) : 273, 282
section CallTarget+Inlining+NGEN
This PR (8021) - mean (927ms) : 876, 979
master - mean (918ms) : 871, 966
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8021) - mean (273ms) : 268, 277
master - mean (270ms) : 264, 275
section Bailout
This PR (8021) - mean (271ms) : 266, 276
master - mean (270ms) : 266, 274
section CallTarget+Inlining+NGEN
This PR (8021) - mean (928ms) : 888, 967
master - mean (926ms) : 889, 963
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8021) - mean (271ms) : 265, 276
master - mean (270ms) : 265, 275
section Bailout
This PR (8021) - mean (272ms) : 265, 278
master - mean (270ms) : 266, 273
section CallTarget+Inlining+NGEN
This PR (8021) - mean (831ms) : 810, 852
master - mean (829ms) : 799, 860
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2026-01-06 15:39:36 Comparing candidate commit adcb8f9 in PR branch Found 8 performance improvements and 6 performance regressions! Performance is the same for 157 metrics, 15 unstable metrics. scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0
scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1
scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0
scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1
|
66dbc18 to
9e59ae3
Compare
profiler/src/ProfilerEngine/Datadog.Profiler.Native/CorProfilerCallback.cpp
Show resolved
Hide resolved
…e unw_xx symbols as LibrariesInfoCache
…nt to dl_iterate_phdr
9e7b84d to
cb6d035
Compare
098c845 to
7e061b0
Compare
This comment has been minimized.
This comment has been minimized.
7e061b0 to
adcb8f9
Compare
Summary of changes
Prevent calling into
dl_iterate_phdrwhile unwinding.Reason for change
libunwind calls
dl_iterate_phdrto get unwinding information for each library. Calling intodl_iterate_phdrwhile unwinding may lead to dead lock.At frame
#26, the thread took the malloc lock. The profiler interrupted the thread (frame#21). The libunwind callsdl_iterate_phdr(#8) but the thread is blocked trying to acquire a lock. This lock is hold by another thread which calleddlopenbut got block while calling intomalloc.The
LibrariesInfoCachewas designed to prevent that situation but it actually failed.When starting the profiler
LibrariesInfoCacheinstance registers a customdl_iterate_phdrto libunwind. This function should be called instead of the one from the C runtime. Why it's not called though ?Libunwind is designed for remote and local unwinding. All libunwind symbols will have a prefix:
_<remote or local><arch>_<symbol_name>Local:
_ULx86_64_xxxxxxRemote:
_U86_64_xxxxxxxIf we include
libunwind.h, by default, the compilation unit will use the remote symbol(s). So when we register our customdl_iterate_phdr, we registered our function to the remote symbol specifying the function libunwind must call.When we call
unw_backtrace2, by default, it use the local symbol, but since this symbol does not have a pointer to our custom implementation, it will call the default one (C Runtimedl_iterate_phdr).To avoid that, we have to add
#define UNW_LOCAL_ONLYbefore#include <libunwind.h>. This will make sure we use the local symbol(s) instead.Implementation details
#define UNW_LOCAL_ONLYbefore includinglibunwind.h.Test coverage
dl_iterate_phdris not calleddl_iterate_phdrOther details