Skip to content

xiaomi7732/diagnostics

 
 

Repository files navigation

.NET Core Diagnostics - Fancy Trace

This is a fork of the .NET Core Diagnostics Repo repository, intending to provide a better experiences/solutions for dotnet diagnostic tools of .NET Core 3.0.

First glance

Live Demo

First glance

Motivation

Rules of Optimization
First rule of optimization - Dont't
Second rule of optimization - Don't...yet.
Profile before optimizing
-- Michael Jackson

If I would run to rule 3, I probably wanted the performance profiling to happen easily.

.NET Core 3.0 provides CLI tools to do the profiling.

  • Although the command line is a cross platform solution, it is not as easy as button clicks.
  • Once the trace is gathered, it is not easy to get the trace when it is inside a container or hosted remotely.

This repo does an experiment to put a web UI on top of the command lines to make it easier to use for various scenarios: premises box, locally hosted container, Azure container. Also, the web UI will stream the trace file gathered by dotnet-trace allows offline analysis.

Quick Start

Road map

  1. Provide a story for on premises profiling.
  2. Run it in local hosted containers, provides a way to easily fetch the trace files.
  3. Extend it to run in Azure.

Develop status

The implementation is provided at src/Tools/dotnet-trace-hosted and src/Tools/dotnet-trace-hosted-webui.

Architecture

// TODO: Add more details here.

Using SOS

Tools

  • dotnet-dump - Dump collection and analysis utility.
  • dotnet-trace - Enable the collection of events for a running .NET Core Application to a local trace file.
  • dotnet-counters - Monitor performance counters of a .NET Core application in real time.

New Features

The bpmd command can now be used before the runtime is loaded. You can load SOS or the sos plugin on Linux and execute bpmd. Always add the module extension for the first parameter.

bpmd SymbolTestApp.dll SymbolTestApp.Program.Main

You can set a source file/line number breakpoint like this (the fully qualified source file path is usually not necessary):

bpmd SymbolTestApp.cs:24

Symbol server support - The setsymbolserver command enables downloading the symbol files (portable PDBs) for managed assemblies during commands like clrstack, etc. See soshelp setsymbolserver for more details.

(lldb) setsymbolserver -ms

Before executing the "bt" command to dump native frames to load the native symbols (for live debugging only):

(lldb) loadsymbols

To add a local directory to search for symbols:

(lldb) setsymbolserver -directory /tmp/symbols

Useful Links

Build Status

Build Status

License

The diagnostics repository is licensed under the MIT license. This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Disclosure

I currently work for Microsoft. However, this project is a pure hobby and is not funded by Microsoft.

About

This repository contains the source code for various .NET Core runtime diagnostic tools and documents.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 73.6%
  • C 13.7%
  • C# 8.6%
  • CMake 0.9%
  • PowerShell 0.7%
  • Shell 0.7%
  • Other 1.8%