NVIDIA DOCA DPA Statistics Tool
DOCA dpa-statistics is a CLI tool which allows users to monitor and obtain statistics on thread execution per running DPA process and thread. The tool is used to expose information about the running DPA processes and threads and to collect statistics on DPA thread performance.
The tool presents performance information for running DPA threads, including the number of cycles and instructions executed in a time period. The tool enables initiating and stopping collection of statistics and displaying the data collected per thread.
The process ID output of the dpa-ps tool may be used as the input parameter for the dpa-statistics tool.
This tool is supported for NVIDIA® BlueField®-3 only.
The command collect works on four mutually exclusive modes:
- Enable mode – start collecting performance data 
- Disable mode – stop collecting performance data 
- Timeout mode – start collecting, wait with a timeout, stop collect and print info. User could break the wait with Ctrl-C command and then the timeout will be canceled and tool will disable statistics collection and prints the info with the actual time of the collect operation. 
- Infinite mode – no special flags. Same as timeout mode but with infinite timeout. The tool awaits the Ctrl-C command to stop. 
The following table lists the collect command's flags and arguments:
| Short Option | Long Option | Description | 
| -h | --help | Help information | 
| -d | --device | Device interface name (MST/RDMA) | 
| -p | --process-id | Hexadecimal process ID for filtering Info This flag indicates a specific command for the command to operate on. Otherwise, statistics are collected from all processes. 
 | 
| -i | --suppress-header-info | Suppress print header info | 
| -n | --enable | Enable collect info | 
| -o | --disable | Disable collect info | 
| -t | --timeout | Enable collect, wait with timeout, disable collect and print info Info Timeout value is in milliseconds. 
 Examples for inputting timeout value: 
 | 
| -r | --reset | Reset counters before operation starting collect operation | 
Presenting performance statistics is applicable after initiating data collection.
The following table lists the show command's flags and arguments:
| Short Option | Long Option | Description | 
| -h | --help | Help information | 
| -d | --device | Device interface name (MST/RDMA) | 
| -p | --process-id | Hexadecimal process ID for filtering | 
| -i | --suppress-header-info | Suppress print header info | 
Output example:
            
            $ sudo ./dpa-statistics show -d mlx5_0 -p 1
ProcessID
    ThreadID    Cycles             Instruction        Time               Executions
1
    3           266268             18193              164                41
    4           411571             32727              252                47
    
Where:
- ProcessID – The dpa_process_object_id to which the threads belongs 
- ThreadID – DPA thread object ID 
- Cycles – Total EU cycles the thread used 
- Instruction – Total number of instructions the thread executed 
- Time – Total time in ticks the thread was active 
- Executions – Total number of thread invocations 
Examples
- Example of collect in infinite mode for process 0 with suppress header info: - $ sudo ./dpa-statistics collect -d mlx5_0 -p 0 -i ...^C Data collected for 4606 milliseconds 0 nanoseconds 0 5 223964 13754 140 31 6 190130 13754 114 31 
- Example of collect in timeout mode with a timeout of 1 second and half a millisecond. - $ sudo ./dpa-statistics collect -d mlx5_0 -t 1000.500 Data collected for 1000 milliseconds 500000 nanoseconds ProcessID ThreadID Cycles Instruction Time Executions 0 5 223964 13754 140 31 6 190130 13754 114 31 1 3 266268 18193 164 41 4 411571 32727 252 47 2 3 0 223205 13754 137 31 1 189896 13754 113 31 2 191796 13754 117 31 4 
- Example of enabling statistics collection with reset of counters. - $ sudo ./dpa-statistics collect -d mlx5_0 -n -r 
- Example of disabling statistics collection. - $ sudo ./dpa-statistics collect -d mlx5_0 -o 
- Reading large statistics counter blocks takes a long time 
- The dpa-ps and dpa-statistics tools cannot be run at the same time on the same device