~/talk

Writing a .NET Core cross platform profiler in an hour

Talkat DotNext 2019 Moscow · 2019-11-06..11-07· [dotnet, observability]
slides:none on file

Demonstrates a working native C++ .NET Core profiler that builds from one codebase for Windows and Linux using MSBuild shared items and clang on WSL, exports DllGetClassObject, implements ICorProfilerCallback and uses std::atomic for COM-style ref counting; loader is activated by CORECLR_ENABLE_PROFILING=1 plus CORECLR_PROFILER and CORECLR_PROFILER_PATH. The demo logs assembly loads, JIT start/stop, GC events and thread creation to files, instruments via JIT IL hooks, and runs successfully against a Mandelbrot GUI, a primes console app and an ASP.NET Kestrel site.

AI-written summary · about

  1. 0:00Introduction to profiling
  2. 1:52What is a .NET profiler
  3. 4:00How profiling works in .NET Core
  4. 6:50Steps to load a profiler
  5. 10:07COM and the Platform Adaptation Layer
  6. 14:43Building for Windows and Linux
  7. 19:44Environment variables setup
  8. 20:45Code walkthrough: DLL entry points
  9. 24:17Project properties and compiler settings
  10. 27:07Common code and abstractions
  11. 29:15Demo: Profiling on Windows
  12. 34:36Demo: Profiling on Linux with WSL
  13. 39:56Core profiler class implementation
  14. 46:18Initialize method and event handling
  15. 51:57Challenges in cross-platform code
  16. 57:33Advanced profiling techniques
  17. 57:56Summary and future of profiling
  18. 59:41Q&A and resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.