- Go to the location of the profiler binaries. See Step 1 in How To: Confirm Successful Installation . Alternatively, you can include the location of the profiler binaries into the system’s path environment variable.
- Run the profiler using the following instructions.
sprofile [options] <InputApplication> <InputApplication's command line arguments>
- -a [ –atpfile ] arg Path to the .atp file. Optional when performing API trace.
- -c [ –counterfile ] arg Path to the counter file to enable selected counters (case-sensitive). If not provided, all counters will be used. Ignored when performing an API trace.
- -e [ –envvar ] arg Environment variable that should be defined when running the profiled application. Argument should be in the format NAME=VALUE.
- -E [ –envvarfile ] arg Path to a file containing a list of environment variables that should be defined when running the profiled application. The file should contain one line for each variable in the format NAME=VALUE.
- -f [ –fullenv ] The environment variables specified with the envvar switch represent the full environment block. If not specified, then the environment variables represent additions or changes to the system environment block.
- -F [ –apifilterfile ] arg Path to the API filter file which contains a list of OpenCL™ APIs to be filtered out when performing API trace.
- -i [ –interval ] arg (=100) Timeout interval. Ignored when not performing API trace and using timeout mode.
- -k [ –kerneloutput ] arg Output the specified kernel file. Ignored when performing an API trace. Valid argument values are:
- il: output kernel IL files
- isa: output kernel ISA files
- cl: output kernel CL files
- asm: output DirectCompute shader ASM files
- all: output all files
- -l [ –list ] Print the list of valid counter names.
- -m [ –timeout ] Flush Trace data periodically, default timeout interval is 100 milliseconds (can be changed with -i option). Ignored when not performing an API trace. (Windows only, this is the default mode for Linux.)
- -M [ –maxapicalls ] (=1000000) Maximum number of API calls. Ignored when not performing an API trace.
- -n [ –nocollapse ] Do not collapse consecutive identical clGetEventInfo calls into a single call in the trace output. Ignored when not performing an API trace.
- -o [ –outputfile ] arg Path to OutputFile. If not provided, the default is Session1.csv in an “AMD APP Profiler” directory under the current user’s Documents directory; when performing an API trace, the default is cltrace.atp in the same location.
- -O [ –occupancy ] Generate kernel occupancy information file (.occupancy)
- -P [ –occupancydisplay ] arg Path to configuration file to use to generate an occupancy display file. The occupancy display file to generate should be specified with –outputfile. See below for information on the configuration file format.
- -r [ –ret ] Always include the OpenCL™ API return code in API trace even if client application doesn’t query it. Ignored when not performing an API trace.
- -R [ –apirulesfile ] arg Path to OpenCL™ API analyzer configuration file. If not specified, all rules are enabled. Ignored when –tracesummary is not specified.
- -s [ –outputseparator ] arg Character used to separate fields in the OutputFile. Ignored when performing an API trace.
- -t [ –apitrace ] Trace OpenCL™ application and generate CPU and GPU time stamps and detailed API call traces.
- -T [ –tracesummary ] Generate summary page from an input .atp file.
- -v [ –version ] Print the sprofile version number.
- -V [ –verbose ] Print out profiling result in console.
- -w [ –workingdirectory ] arg Set the working directory. If not provided, the default is the app binary’s path.
- -y [ –sym ] Generate symbol information file (.st) for API trace if available. Ignored when not performing an API trace. (Windows only)
- -h [ –help ] Produce this help message.
- An example to collect performance counters:
sprofile -o "/path/to/output.csv" -w "/path/to/app/working/directory" "/path/to/app.exe" "--device gpu"
- An example to collect API trace:
sprofile -o "/path/to/output.atp" -t -w "/path/to/app/working/directory" "/path/to/app.exe" "--device gpu"
- An example to collect API trace with summary pages:
sprofile -o "/path/to/output.atp" -t -T -w "/path/to/app/working/directory" "/path/to/app.exe" "--device gpu"
- An example to generate summary pages from .atp file:
sprofile -a "/path/to/output.atp" -T
- An example to generate an occupancy display page:
sprofile -P "/path/to/occupancy/params/file.txt" -o "path/to/output.html"
After you have used the command line to profile an application, you can view the results within the Visual Studio plugin using the Import Profile Result command in the APP Profiler Session Explorer.
The format of the configuration files passed to the –counterfile, –apirulesfile, –apifilterfile, and –occupancydisplay options can be found in the Description of Configuration Files topic.