Profiling from the command line is only available in ANTS Performance Profiler Professional edition.
To run a profiling session from the command line, run Profile.exe with the appropriate options.
For example, to profile an executable called SimpleApp.exe using line-level timings and saving results as a CSV file, use:
Profile.exe /e:"C:\testing\SimpleApp.exe" /ll /csv:"C:\testing\results.csv"
Profiling applications from the command line is useful if you want to integrate performance profiling in an automated test procedure. For more information on this, see Integrating ANTS Performance Profiler in a test procedure.
Applications that run on IIS Express or the ASP.NET web development server (Cassini) can be profiled directly from the command line. You cannot currently profile applications which run on IIS 5, 6, 7, 7.5, or 8 from the command line.
To work around this limitation:
/projectargument on the command line to load the saved session settings.
Arguments for IIS Express profiling are included below.
Displays this help message. Use in conjunction with
/verbose for more detailed information.
If this switch is used with any switches other than
outputwidth, those switches will be ignored, the help message will be printed, and 0 will be returned as the process exit code.
Causes help to be output as HTML.
Must be used with the
Quiet mode - no output.
Forces overwriting of output files that already exist. If this flag is not set and a file already exists then program will exit with an exit code indicating an I/O error.
File containing the XML argument specification.
Redirects console output to the specified file.
A performance profiler session settings that will be used to begin profiling.
(Session settings files were called 'projects' in version 7.4 and earlier.)
The filepath to an executable to run in the profiler.
The Windows process ID of the .NET 4+ process to attach to. (Available in ANTS Performance Profiler 8.2 and later.)
The arguments to pass to the executable.
The working directory to use when profiling the application.
The port that web applications running on IIS Express or the ASP.NET web development server (Cassini) should be profiled on (default: 8013).
Profile on the ASP.NET web development server (Cassini).
The location of the ASP.NET project to use with the ASP.NET web development server (Cassini).
The virtual directory to use for the ASP.NET web development server (Cassini).
If Visual Studio 2010 or later is installed, this is the version of .NET to use when running on the web development server (Cassini). Default: 0
Profile on the IIS Express webserver.
The path where the website can be located on the disk.
The path to an applicationHost.config file to load.
The site name to load from an applicationHost.config file. By default the first site found will be used.
The version of .NET (2.0 or 4.0) to use when running IIS Express. If you are using .NET 3.5, choose .NET 2.0. If you are using .NET 4.5, choose .NET 4.0.
The name of a Windows service to profile.
The name of a COM+ server to profile.
The URL of a site containing a Silverlight application to profile.
Record SQL and File I/O events.
Profile both the target and any child processes spawned.
The number of seconds to wait before terminating the target process. Set to 0 to indicate that no timeout should be used. The default is 120 seconds.
The profiler should record line-level timings as well as method-level timings.
Record only method-level timings (the default).
Record only values for methods which have source code files specified in their debugging data (pdb) files.
Use sampling to produce approximate profiling results quickly.
Whether or not the results will include the source code. Permitted values are on and off. The default is on.
Whether or not the profiler will allow .NET to inline functions. Turning this off will produce results for more methods, at the expense of a less accurate reflection of the processes performance. Permitted values are on and off. The default is on.
Whether or not the profiler should adjust results to account for its own overhead. Permitted values are on and off. The default is on.
Whether or not the profiler will simplify certain complicated stack traces to reduce resource requirements. Permitted values are on and off. The default is on.
Whether or not the profiler will avoid extremely trivial functions to reduce resource requirements. These functions have a low hit count and a running time of only a few processor cycles. Permitted values are on and off. The default is on.
Whether or not the profiler will profile the compiled contents of ASPX pages as well as the code that lies behind them. Turning this option on may considerably increase the amount of time the application spends in the JIT. Permitted values are on and off. The default is off.
The threshold time in percent that a method must have used in order to be included in the report. Set to 0 to include all results. The default is 0.1.
The name of a file to write a summary of the profiler results as CSV data to.
The name of a file to write a summary of the profiler results as XML data to.
The name of a file to write a summary of the profiler results as an HTML report.
The name of a file to write a summary of the call tree results as XML data to.
The name of a file to write a summary of the call tree results as an HTML report.
The name of a file to save the profiler results to. The contents of this file can be inspected using the ANTS Performance Profiler desktop application.
When profiling IIS Express, set to '32' to profile a 32-bit application in the 32-bit version of IIS Express or '64' to profile a 64-bit application in the 64-bit version of IIS Express.
When profiling Silverlight, optionally enter a URL to set the 'origin' parameter to pass to sllauncher.exe. Use this if you have problems with permissions to set the URL the application should be treated as running from.
Specify the application ID of the Windows Store app to profile. Note: the application ID must be unique to your application.
If an error occurs, the following exit codes may be displayed:
1 General error code.
3 Illegal argument duplication. Some arguments may not appear more than once in a command-line. If such arguments appear more than once this exit code will be returned.
8 Unsatisfied argument dependency or violated exclusion when user runs command line.
/arg2 depends on
/arg1 but you have specified
/arg2 without specifying
/arg1, or alternatively
/arg2 cannot be used with
/arg1 but you have tried to use them both.
32 Value out of range. Numeric value supplied for an argument that is outside the range of valid values for that argument.
33 Value overflow. The magnitude of a value supplied for an argument is too large and causes an overflow.
34 Invalid value. The value supplied for an argument is invalid.
35 No / invalid software license or trial period has expired.
64 General command-line usage error.
65 Data error. Some input data required by the tool is invalid or corrupt.
69 A resource or service required to run the tool is unavailable.
73 Failed to create report.
74 IO error occurred. Generally returned if the program attempts to write to a file that already exists without the user having specified the /force option.
77 Action cannot be completed because the user does not have permission.
126 Execution failed because of an unknown error.
130 Execution stopped because the user pressed Ctrl+Break.
Exporting results to HTML, XML and CSV files
You can save profiling results to HTML, XML, and CSV files. For more information about saving profiling results in different formats, see Saving profiling results.