- System requirements
- Profiler architecture
- Profiler installation
- Uninstall profiler
- Running the profiler
- Profiler activation
- Welcome screen
- Start profiling
- IDE integration
- Profile .NET executable
- Profile ASP.NET application in IIS
- Profile ASP.NET web app on Azure App Service on Linux
- Profile ASP.NET web app on Azure App Service on Windows
- 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
- Agent startup options
- Connect to profiled application
- Profiling overhead
- Snapshots
- Solving performance problems
- CPU profiling
- Thread profiling
- Object allocation profiling
- Memory profiling
- Exception profiling
- Telemetry
- Probes: monitor higher level events
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Automatic deobfuscation
- Summary, automatic deobfuscation
- Filters
- Profiler command line
- Command line tool to control profiling
- Export of profiling results to external formats
- Profiler .NET API
- Profiler HTTP API
- Settings
- Troubleshooting
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, macOS
Variable | Value |
CORECLR_PROFILER | {E5A4ADC4-C749-400D-B066-6AC8C1D3790A} |
CORECLR_ENABLE_PROFILING | 1 |
CORECLR_PROFILER_PATH_64 | <profiler agent path> |
Set <profiler agent path>
according to the target .NET platform of the profiled application:
Platform | Agent path | |
Linux (glibc) | x86, 64-bit | <profiler directory>/bin/linux-x86-64/libynpagent.so |
ARM 64-bit (AArch64) | <profiler directory>/bin/linux-arm-64/libynpagent.so |
|
Alpine Linux (musl) | x86, 64-bit | <profiler directory>/bin/linux-musl-x86-64/libynpagent.so |
ARM 64-bit (AArch64) | <profiler directory>/bin/linux-musl-arm-64/libynpagent.so |
|
macOS | Universal binary for arm64 and x86_64 |
<profiler directory>/Contents/Resources/bin/mac/libynpagent.dylib |
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/<application 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.