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

[Profiler] Signal-based profiler/Non-Signal-based: prevent deadlock #5812

Conversation

gleocadie
Copy link
Collaborator

Summary of changes

Prevent deadlock betwen signal-based profilers (walltime/manual cpu profilers) and non-signal based profilers (exception, contention....)

Reason for change

When an exception occurs, the thread can be interrupted by a signal-based profiler (walltime/manual cpu). It can be interrupted while holding the lock used to update the dl-iterate-phdr cache.

Thread 18 (LWP 995):
#0  __syscall_cp_c (nr=202, u=140244538814536, v=128, w=-1, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
#1  0x00007f8dba343ccd in __futex4_cp (to=0x0, val=-1, op=128, addr=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>) at src/thread/__timedwait.c:24
#2  __timedwait_cp (addr=addr@entry=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>, val=val@entry=-1, clk=clk@entry=0, at=at@entry=0x0, priv=priv@entry=128) at src/thread/__timedwait.c:52
#3  0x00007f8dba343d74 in __timedwait (addr=addr@entry=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>, val=-1, clk=clk@entry=0, at=at@entry=0x0, priv=128) at src/thread/__timedwait.c:68
#4  0x00007f8dba3463e6 in __pthread_rwlock_timedrdlock (at=<optimized out>, rw=<optimized out>) at src/thread/pthread_rwlock_timedrdlock.c:18
#5  __pthread_rwlock_timedrdlock (rw=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>, at=0x0) at src/thread/pthread_rwlock_timedrdlock.c:3
#6  0x00007f8d398f3ca8 in std::__glibcxx_rwlock_rdlock (__rwlock=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>) at /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../include/c++/10.3.1/shared_mutex:73
#7  std::__shared_mutex_pthread::lock_shared (this=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>) at /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../include/c++/10.3.1/shared_mutex:224
#8  std::shared_mutex::lock_shared (this=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>) at /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../include/c++/10.3.1/shared_mutex:421
#9  std::shared_lock<std::shared_mutex>::shared_lock (this=0x7f4ca05a2ac0, __m=...) at /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../include/c++/10.3.1/shared_mutex:722
#10 LibrariesInfoCache::DlIteratePhdrImpl (this=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>, callback=0x7f8d3997d900 <_Ux86_64_dwarf_callback>, data=0x7f4ca05a2b20) at /project/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LibrariesInfoCache.cpp:104
#11 0x00007f8d3997e4ee in _Ux86_64_dwarf_find_proc_info (as=0x7f8d39eb2a00 <local_addr_space>, ip=140246691112115, pi=0x7f4ca05a3170, need_unwind_info=1, arg=0x7f4ca05a3411) at /project/obj/libunwind-prefix/src/libunwind/src/dwarf/Gfind_proc_info-lsb.c:807
#12 0x00007f8d3997e690 in fetch_proc_info (c=0x7f4ca05a3018, ip=140246691112115) at /project/obj/libunwind-prefix/src/libunwind/src/dwarf/Gparser.c:473
#13 0x00007f8d3998113d in find_reg_state (sr=0x7f4ca05a2dc0, c=0x7f4ca05a3018) at /project/obj/libunwind-prefix/src/libunwind/src/dwarf/Gparser.c:1024
#14 _Ux86_64_dwarf_step (c=c@entry=0x7f4ca05a3018) at /project/obj/libunwind-prefix/src/libunwind/src/dwarf/Gparser.c:1069
#15 0x00007f8d3997d13a in _Ux86_64_step (cursor=0x7f4ca05a3018) at /project/obj/libunwind-prefix/src/libunwind/src/x86_64/Gstep.c:75
#16 0x00007f8d398f55c8 in LinuxStackFramesCollector::CollectStackManually (this=this@entry=0x7f8d392dc6d0, ctx=ctx@entry=0x7f4ca05a3880) at /project/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LinuxStackFramesCollector.cpp:288
#17 0x00007f8d398f53dc in LinuxStackFramesCollector::CollectCallStackCurrentThread (this=this@entry=0x7f8d392dc6d0, ctx=ctx@entry=0x7f4ca05a3880) at /project/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LinuxStackFramesCollector.cpp:227
#18 0x00007f8d398f4672 in LinuxStackFramesCollector::CollectStackSampleSignalHandler (signal=<optimized out>, info=<optimized out>, context=0x7f4ca05a3880) at /project/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LinuxStackFramesCollector.cpp:373
#19 0x00007f8d398fb871 in ProfilerSignalManager::CallCustomHandler (this=0x7f8d39eaf928 <ProfilerSignalManager::Get(int)::signalManagers+1944>, signal=10, info=0x7f4ca05a39b0, context=0x7f4ca05a3880) at /project/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/ProfilerSignalManager.cpp:197
#20 ProfilerSignalManager::SignalHandler (signal=10, info=0x7f4ca05a39b0, context=0x7f4ca05a3880) at /project/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/ProfilerSignalManager.cpp:188
#21 <signal handler called>
#22 __pthread_rwlock_unlock (rw=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>) at src/thread/pthread_rwlock_unlock.c:5
#23 0x00007f8d398f3bf9 in std::__glibcxx_rwlock_unlock (__rwlock=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>) at /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../include/c++/10.3.1/shared_mutex:77
#24 std::__shared_mutex_pthread::unlock (this=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>) at /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../include/c++/10.3.1/shared_mutex:208
#25 std::shared_mutex::unlock (this=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>) at /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../include/c++/10.3.1/shared_mutex:417
#26 std::unique_lock<std::shared_mutex>::unlock (this=0x7f4ca05a3e20) at /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../include/c++/10.3.1/bits/unique_lock.h:194
#27 std::unique_lock<std::shared_mutex>::~unique_lock (this=0x7f4ca05a3e20) at /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../include/c++/10.3.1/bits/unique_lock.h:103
#28 LibrariesInfoCache::UpdateCache (this=0x7f8d39eaf048 <LibrariesInfoCache::Get()::Instance>) at /project/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LibrariesInfoCache.cpp:88
#29 0x00007f8d398f4e59 in LinuxStackFramesCollector::CollectStackSampleImplementation (this=0x7f8d3b91bc90, pThreadInfo=0x7f4ca06b9900, pHR=0x7f8d3a63c510, selfCollect=true) at /p--Type <RET> for more, q to quit, c to continue without paging--
roject/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LinuxStackFramesCollector.cpp:100
#30 0x00007f8d399637ba in StackFramesCollectorBase::CollectStackSample (this=0x7f8d3b91bc90, pThreadInfo=0x7f4ca06b9900, pHR=0x7f4ca05a3fdc) at /project/profiler/src/ProfilerEngine/Datadog.Profiler.Native/StackFramesCollectorBase.cpp:185
#31 0x00007f8d3992acb9 in ExceptionsProvider::OnExceptionThrown (this=0x7f8d392a7160, thrownObjectId=139969739182080) at /project/profiler/src/ProfilerEngine/Datadog.Profiler.Native/ExceptionsProvider.cpp:149
#32 0x00007f8d39917045 in CorProfilerCallback::ExceptionThrown (this=0x7f8d392c0d20, thrownObjectId=139969739182080) at /project/profiler/src/ProfilerEngine/Datadog.Profiler.Native/CorProfilerCallback.cpp:1734

Implementation details

  • move the call which updates the cache after acquiring the thread lock
  • call Update before sending signal

Test coverage

Other details

@gleocadie gleocadie requested a review from a team as a code owner July 26, 2024 13:13
@github-actions github-actions bot added the area:profiler Issues related to the continous-profiler label Jul 26, 2024
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jul 26, 2024

Datadog Report

Branch report: gleocadie/fix-deadlock-while-updating-dl_iterate_phdr-cache_backport
Commit report: 915580c
Test service: dd-trace-dotnet

✅ 0 Failed, 343849 Passed, 2064 Skipped, 16h 53m 3.35s Total Time
⌛ 14 Performance Regressions

⌛ Performance Regressions vs Default Branch (14)

This report shows up to 5 performance regressions.

  • Profiler_cpu_walltime_old_stackwalk - scenarios 3.24s (+895.6ms, +38%)
  • Profiler_cpu_walltime - scenarios 3.23s (+888.56ms, +38%)
  • Profiler_walltime - scenarios 3.24s (+892.59ms, +38%)
  • Profiler_cpu_walltime_timer_create - scenarios 3.25s (+907.29ms, +39%)
  • Profiler_liveheap - scenarios 4.2s (+1.02s, +32%)

@andrewlock
Copy link
Member

andrewlock commented Jul 26, 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 (5812) - mean (73ms)  : 63, 84
     .   : milestone, 73,
    master - mean (72ms)  : 64, 79
     .   : milestone, 72,

    section CallTarget+Inlining+NGEN
    This PR (5812) - mean (1,027ms)  : 1003, 1052
     .   : milestone, 1027,
    master - mean (1,072ms)  : 1045, 1098
     .   : milestone, 1072,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5812) - mean (110ms)  : 106, 113
     .   : milestone, 110,
    master - mean (109ms)  : 105, 113
     .   : milestone, 109,

    section CallTarget+Inlining+NGEN
    This PR (5812) - mean (717ms)  : 695, 738
     .   : milestone, 717,
    master - mean (747ms)  : 729, 764
     .   : milestone, 747,

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

    section CallTarget+Inlining+NGEN
    This PR (5812) - mean (672ms)  : 648, 696
     .   : milestone, 672,
    master - mean (704ms)  : 677, 730
     .   : milestone, 704,

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

    section CallTarget+Inlining+NGEN
    This PR (5812) - mean (1,132ms)  : 1113, 1150
     .   : milestone, 1132,
    master - mean (1,169ms)  : 1144, 1195
     .   : milestone, 1169,

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

    section CallTarget+Inlining+NGEN
    This PR (5812) - mean (890ms)  : 858, 923
     .   : milestone, 890,
    master - mean (914ms)  : 896, 933
     .   : milestone, 914,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5812) - mean (267ms)  : 263, 271
     .   : milestone, 267,
    master - mean (265ms)  : 260, 270
     .   : milestone, 265,

    section CallTarget+Inlining+NGEN
    This PR (5812) - mean (873ms)  : 849, 896
     .   : milestone, 873,
    master - mean (901ms)  : 879, 922
     .   : milestone, 901,

Loading

@andrewlock
Copy link
Member

andrewlock commented Jul 26, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #5812 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.167
  • 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.8μs 41ns 201ns 0.0111 0.00371 0 5.43 KB
master StartStopWithChild netcoreapp3.1 9.98μs 55.1ns 326ns 0.0145 0.00482 0 5.62 KB
master StartStopWithChild net472 16.1μs 50.8ns 197ns 1.02 0.306 0.0968 6.07 KB
#5812 StartStopWithChild net6.0 7.87μs 44.1ns 303ns 0.0147 0.00368 0 5.43 KB
#5812 StartStopWithChild netcoreapp3.1 9.93μs 57ns 434ns 0.0197 0.00986 0 5.61 KB
#5812 StartStopWithChild net472 16.1μs 36ns 135ns 1.03 0.321 0.0964 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 480μs 192ns 745ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 633μs 298ns 1.15μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 826μs 1.09μs 4.08μs 0.408 0 0 3.3 KB
#5812 WriteAndFlushEnrichedTraces net6.0 478μs 266ns 1.03μs 0 0 0 2.7 KB
#5812 WriteAndFlushEnrichedTraces netcoreapp3.1 644μs 385ns 1.49μs 0 0 0 2.7 KB
#5812 WriteAndFlushEnrichedTraces net472 844μs 658ns 2.46μs 0.422 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 189μs 1.03μs 6.62μs 0.184 0 0 18.45 KB
master SendRequest netcoreapp3.1 220μs 1.29μs 12.2μs 0.208 0 0 20.61 KB
master SendRequest net472 0.000191ns 0.000182ns 0.000658ns 0 0 0 0 b
#5812 SendRequest net6.0 191μs 1μs 6.57μs 0.186 0 0 18.45 KB
#5812 SendRequest netcoreapp3.1 215μs 1.25μs 10.5μs 0.204 0 0 20.61 KB
#5812 SendRequest net472 0.000994ns 0.000422ns 0.00152ns 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 546μs 2.67μs 13.9μs 0.579 0 0 41.58 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 680μs 3.22μs 13.3μs 0.353 0 0 41.72 KB
master WriteAndFlushEnrichedTraces net472 866μs 4.08μs 17.3μs 8.13 2.57 0.428 53.27 KB
#5812 WriteAndFlushEnrichedTraces net6.0 560μs 2.23μs 8.35μs 0.534 0 0 41.63 KB
#5812 WriteAndFlushEnrichedTraces netcoreapp3.1 666μs 3.1μs 12μs 0.326 0 0 41.71 KB
#5812 WriteAndFlushEnrichedTraces net472 859μs 2.2μs 8.25μs 8.19 2.59 0.431 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.28μs 1ns 3.89ns 0.0141 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.8μs 0.637ns 2.3ns 0.0135 0 0 1.02 KB
master ExecuteNonQuery net472 1.99μs 1.18ns 4.56ns 0.156 0 0 987 B
#5812 ExecuteNonQuery net6.0 1.34μs 1.25ns 4.83ns 0.0139 0 0 1.02 KB
#5812 ExecuteNonQuery netcoreapp3.1 1.78μs 0.672ns 2.52ns 0.0134 0 0 1.02 KB
#5812 ExecuteNonQuery net472 1.98μs 1.97ns 7.65ns 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.16μs 0.399ns 1.55ns 0.0135 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.51μs 1.39ns 5.37ns 0.0128 0 0 976 B
master CallElasticsearch net472 2.51μs 1.4ns 5.24ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.29μs 1.97ns 7.63ns 0.0135 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.56μs 1.33ns 5.16ns 0.0135 0 0 1.02 KB
master CallElasticsearchAsync net472 2.63μs 2.77ns 10.7ns 0.166 0 0 1.05 KB
#5812 CallElasticsearch net6.0 1.24μs 0.635ns 2.46ns 0.0137 0 0 976 B
#5812 CallElasticsearch netcoreapp3.1 1.55μs 1.68ns 6.29ns 0.013 0 0 976 B
#5812 CallElasticsearch net472 2.5μs 1.16ns 4.33ns 0.158 0 0 995 B
#5812 CallElasticsearchAsync net6.0 1.32μs 0.514ns 1.92ns 0.0134 0 0 952 B
#5812 CallElasticsearchAsync netcoreapp3.1 1.66μs 1.24ns 4.81ns 0.0134 0 0 1.02 KB
#5812 CallElasticsearchAsync net472 2.6μs 2.02ns 7.81ns 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.22μs 1.12ns 4.33ns 0.0135 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.64μs 0.632ns 2.28ns 0.0123 0 0 952 B
master ExecuteAsync net472 1.67μs 0.961ns 3.72ns 0.145 0 0 915 B
#5812 ExecuteAsync net6.0 1.18μs 0.796ns 3.08ns 0.0135 0 0 952 B
#5812 ExecuteAsync netcoreapp3.1 1.66μs 2.94ns 11ns 0.0124 0 0 952 B
#5812 ExecuteAsync net472 1.68μs 0.839ns 3.25ns 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.21μs 1.66ns 6.44ns 0.0296 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.12μs 1.64ns 5.9ns 0.0363 0 0 2.76 KB
master SendAsync net472 7.7μs 2.98ns 11.6ns 0.499 0 0 3.15 KB
#5812 SendAsync net6.0 4.21μs 1.7ns 6.13ns 0.0295 0 0 2.22 KB
#5812 SendAsync netcoreapp3.1 5.15μs 2.07ns 8.03ns 0.036 0 0 2.76 KB
#5812 SendAsync net472 7.8μs 1.11ns 4.14ns 0.499 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.47μs 0.858ns 3.21ns 0.0233 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.1μs 1.74ns 6.74ns 0.0221 0 0 1.64 KB
master EnrichedLog net472 2.69μs 0.911ns 3.41ns 0.25 0 0 1.57 KB
#5812 EnrichedLog net6.0 1.53μs 1.07ns 3.99ns 0.023 0 0 1.64 KB
#5812 EnrichedLog netcoreapp3.1 2.2μs 1.74ns 6.53ns 0.0223 0 0 1.64 KB
#5812 EnrichedLog net472 2.62μs 10.4ns 40.2ns 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 116μs 91.3ns 353ns 0.0583 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 117μs 106ns 411ns 0 0 0 4.28 KB
master EnrichedLog net472 150μs 77.9ns 291ns 0.671 0.224 0 4.46 KB
#5812 EnrichedLog net6.0 117μs 205ns 793ns 0.058 0 0 4.28 KB
#5812 EnrichedLog netcoreapp3.1 121μs 252ns 974ns 0.06 0 0 4.28 KB
#5812 EnrichedLog net472 150μs 333ns 1.2μs 0.671 0.224 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 3.01μs 0.78ns 2.92ns 0.0304 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.08μs 2.3ns 8.9ns 0.0287 0 0 2.2 KB
master EnrichedLog net472 4.91μs 1.15ns 4.3ns 0.318 0 0 2.02 KB
#5812 EnrichedLog net6.0 3.1μs 0.691ns 2.58ns 0.0311 0 0 2.2 KB
#5812 EnrichedLog netcoreapp3.1 4.23μs 1.55ns 6ns 0.0295 0 0 2.2 KB
#5812 EnrichedLog net472 4.78μs 0.901ns 3.49ns 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.27μs 0.756ns 2.93ns 0.0158 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.76μs 0.504ns 1.82ns 0.015 0 0 1.14 KB
master SendReceive net472 2.14μs 0.687ns 2.66ns 0.183 0.00107 0 1.16 KB
#5812 SendReceive net6.0 1.27μs 0.276ns 0.995ns 0.016 0 0 1.14 KB
#5812 SendReceive netcoreapp3.1 1.74μs 0.888ns 3.44ns 0.0157 0 0 1.14 KB
#5812 SendReceive net472 2.17μs 0.922ns 3.57ns 0.183 0.00108 0 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.73μs 0.605ns 2.1ns 0.0218 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.97μs 6.61ns 25.6ns 0.0221 0 0 1.65 KB
master EnrichedLog net472 4.36μs 3.12ns 11.7ns 0.324 0 0 2.04 KB
#5812 EnrichedLog net6.0 2.85μs 0.836ns 3.13ns 0.0213 0 0 1.6 KB
#5812 EnrichedLog netcoreapp3.1 3.88μs 1.27ns 4.93ns 0.0213 0 0 1.65 KB
#5812 EnrichedLog net472 4.42μs 2.62ns 10.1ns 0.323 0 0 2.04 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 net6.0 405ns 0.257ns 0.961ns 0.00814 0 0 576 B
master StartFinishSpan netcoreapp3.1 594ns 0.863ns 3.34ns 0.00767 0 0 576 B
master StartFinishSpan net472 642ns 0.609ns 2.28ns 0.0917 0 0 578 B
master StartFinishScope net6.0 475ns 0.143ns 0.553ns 0.00969 0 0 696 B
master StartFinishScope netcoreapp3.1 663ns 0.645ns 2.5ns 0.00964 0 0 696 B
master StartFinishScope net472 894ns 0.393ns 1.52ns 0.104 0 0 658 B
#5812 StartFinishSpan net6.0 406ns 0.148ns 0.574ns 0.00806 0 0 576 B
#5812 StartFinishSpan netcoreapp3.1 628ns 0.187ns 0.723ns 0.00769 0 0 576 B
#5812 StartFinishSpan net472 639ns 0.283ns 1.06ns 0.0915 0 0 578 B
#5812 StartFinishScope net6.0 489ns 0.143ns 0.536ns 0.00982 0 0 696 B
#5812 StartFinishScope netcoreapp3.1 701ns 0.241ns 0.934ns 0.00949 0 0 696 B
#5812 StartFinishScope net472 855ns 0.482ns 1.87ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5812

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.167 616.78 719.96

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 617ns 0.161ns 0.623ns 0.00981 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 889ns 0.454ns 1.76ns 0.00931 0 0 696 B
master RunOnMethodBegin net472 1.16μs 0.259ns 0.935ns 0.104 0 0 658 B
#5812 RunOnMethodBegin net6.0 720ns 0.465ns 1.8ns 0.00975 0 0 696 B
#5812 RunOnMethodBegin netcoreapp3.1 984ns 2.55ns 9.87ns 0.00939 0 0 696 B
#5812 RunOnMethodBegin net472 1.08μs 0.411ns 1.59ns 0.104 0 0 658 B

@gleocadie gleocadie force-pushed the gleocadie/fix-deadlock-while-updating-dl_iterate_phdr-cache_backport branch from 1ad93b5 to 915580c Compare August 9, 2024 15:52
Copy link
Contributor

@chrisnas chrisnas left a comment

Choose a reason for hiding this comment

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

LGTM - same as #5808

@gleocadie gleocadie merged commit 3fb67b0 into release/2.x Aug 12, 2024
68 of 71 checks passed
@gleocadie gleocadie deleted the gleocadie/fix-deadlock-while-updating-dl_iterate_phdr-cache_backport branch August 12, 2024 07:45
@github-actions github-actions bot added this to the vNext-v2 milestone Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:profiler Issues related to the continous-profiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants