- System requirements
- Profiler architecture
- Running the profiler
- Profiler activation
- Start profiling
- IDE integration
- Profile .NET executable
- Profile ASP.NET application IIS
- Profile all .NET processes that will start
- Attach profiler to a running application
- Profile remote applications
- Profiling in Docker container
- Manually enable profiling of local applications
- Startup options
- Profiling overhead: how to reduce or avoid
- Profiling troubleshooting
- Connect to profiled application
- Capturing snapshots
- Solving performance problems
- CPU profiling
- Threads
- Memory profiling
- Garbage collection
- Exception profiling
- Probes: monitor higher level events
- Performance Charts
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Summary, snapshot annotation, automatic deobfuscation
- Time measurement (CPU time, wall time)
- Filters
- Snapshot directory customization
- Export of profiling results to HTML, CSV, XML, plain text
- Profiler API
- Profiler HTTP API
- Command line tool to control profiling
- Settings
Manually enable profiling of local applications
The following describes how to manually enable profiling of local applications.
Note that in most cases, it is profile local applications using the profiler UI.
Should you need to profile remote applications, read here.
1. Make sure the profiler is installed
On Windows the profiler installer not only creates necessary files, but also registers the profiler agent DLL.
2. Set up a profiling environment
Specify the following environment variables for the process you want to profile:
Windows
Variable | Value |
COR_PROFILER | {E5A4ADC4-C749-400D-B066-6AC8C1D3790A} |
COR_ENABLE_PROFILING | 1 |
CORECLR_PROFILER | {E5A4ADC4-C749-400D-B066-6AC8C1D3790A} |
CORECLR_ENABLE_PROFILING | 1 |
Linux (glibc)
Variable | Value |
CORECLR_PROFILER | {E5A4ADC4-C749-400D-B066-6AC8C1D3790A} |
CORECLR_ENABLE_PROFILING | 1 |
CORECLR_PROFILER_PATH_64 | <profiler directory>/bin/linux-x86-64/libynpagent.so |
Alpine Linux (musl)
Variable | Value |
CORECLR_PROFILER | {E5A4ADC4-C749-400D-B066-6AC8C1D3790A} |
CORECLR_ENABLE_PROFILING | 1 |
CORECLR_PROFILER_PATH_64 | <profiler directory>/bin/linux-musl-x86-64/libynpagent.so |
Pay attention that GUID starts with {
and ends with }
.
You can change profiler startup options by setting YNP_STARTUP_OPTIONS
variable.
Special notes on profiling a Windows service can be found here.
3. Run the application
If profiling was properly enabled, the profiled application should start with the profiler agent.
To ensure it has started with the profiler, check whether log file has been created:
<user home>/.ynp/log/<session name>-<PID>.log
4. Connect to the application
The profiled application should appear on the Welcome screen of the profiler. If it does not, please refer to profiling troubleshooting.
Connect to the profiled application to obtain profiling results.