Profiling the Host System
msprof supports profiling the host system data, including the CPU usage, memory usage, disk I/O usage, and network I/O usage. It automatically parses the profile data and flush files to the disk.
Command Example (Depending on AI Task Runtime Profiling)
Log in as a running user to the environment where the CANN Toolkit package and ops operator package are installed, and run the profiling command.
msprof --output=/home/projects/output --host-sys=cpu /home/projects/MyApp/out/main
Command Example (Depending on Ascend AI Processor System Profiling)
Log in as a running user to the environment where the CANN Toolkit package and ops operator package are installed, and run the profiling command.
msprof --output=/home/projects/output --sys-devices=<ID> --sys-period=<period> --sys-hardware-mem=on --host-sys-pid=<pid> --host-sys=cpu
Options
Option |
Description |
Required/Optional |
Result File |
|---|---|---|---|
--host-sys |
Host-side system profile data collection option (or options separated by commas), selected from cpu, mem, disk, network, and osrt. To set this option, you must set host-sys-pid or pass a user application. The arguments are as follows:
Example: --host-sys=cpu,mem,disk,network NOTE:
|
Either --host-sys or --host-sys-usage must be specified. |
The CPU Usage layer in msprof_*.json and the host_cpu_usage_*.csv file The Memory Usage layer in msprof_*.json and the host_mem_usage_*.csv The Disk Usage layer in msprof_*.json and the host_disk_usage_*.csv file The Network Usage layer in msprof_*.json and the host_network_usage_*.csv file The OS Runtime API layer in msprof_*.json and the os_runtime_statistic_*.csv file HOST_MEM_USAGE in the .db file HOST_DISK_USAGE in the .db file |
--host-sys-usage |
Host-side system and process profile data collection option (or options separated by commas), selected from cpu and mem. If the host-sys-pid option is also configured, the CPU or memory usage of a specified process on the host is collected. The values are described as follows:
Example: --host-sys-usage=cpu,mem |
Either --host-sys or --host-sys-usage must be specified. |
CPU usage of processes on the host |
--host-sys-pid |
PID of the host-side application to profile. This option is not required and will be ignored for profiling depending on AI task runtime. |
Optional |
- |
--host-sys-usage-freq |
CPU and memory usage profiling frequency (Hz). Defaults to 50. Must be in the range [1, 50]. |
Optional |
- |