The hrt_ucp_monitor Tool Introduction

hrt_ucp_monitor is a tool that monitors the hardware IP usage, and the supported IPs include BPU, DSP, GDC, STITCH, PYM, ISP, CODEC(VPU and JPU). When submitting tasks, UCP can specify the Backend for task deployment, which corresponds to the hardware supported by UCP.

Parameters Description

   Parameter   TypeDescription
-b, --batchnullSpecified to run in non-interactive batch mode, which is the default mode for interactive mode.
-d, --delayintSpecify the update interval in milliseconds, with a default value of 1000 milliseconds and an effective range of [100, 10000].
-f, --freqintSpecify the sampling frequency,defaluting to 1000 samples per second, only effective for BPU and DSP, valid range [10, 1000].
-n, --numberintSpecify the usage refresh rate, valid range is [1, INT32_MAX].
-t, --timeintSpecify the tool running time in seconds, valid range is [1, INT32_MAX].
-e, --enablestringSpecify the hardware IP to be monitored, valid values are bpu, dsp, gdc, stitch, pym, isp, jpu, vpu, case insensitive. Multiple parameters are separated by semicolons.

Usage Instructions

Running hrt_ucp_monitor -h or hrt_ucp_monitor --help to obtain tool usage details, as shown in the following:

Usage: hrt_ucp_monitor [Option...] [Parameter] [Option] [Instruction] --------------------------------------------------------------------------------------------------------------- -h --help Display this information -v --verbose Show additional information [Option] [Parameter] --------------------------------------------------------------------------------------------------------------- -b --batch [null] : Run in non-interactive batch mode, default is interactive mode. -d --delay [int] : Delay between updates in milliseconds, default is 1000 ms. parameter range: [100, 10000]. -f --freq [int] : Sampling frequency, default is 500 samples/sec, only used for BPU and DSP. parameter range: [10, 1000]. -n --number [int] : Specifies the maximum number of iterations, default is forever. parameter range: [1, INT32_MAX]. -t --time [int] : Specifies the duration time in seconds, default is forever. parameter range: [1, INT32_MAX]. -e --enable [string]: Hardware IP to be monitored, valid values are "bpu, dsp, gdc, stitch, pym, isp, jpu, vpu", case insensitive. Multiple parameters are separated by semicolons.

During the operation of hrt_ucp_monitor, you can early exit by pressing the Q key or exectuing CTRL+C.

Default Parameters

Overview

when running hrt_ucp_monitor without specifying parameters, it will use default parameters to run. By default, all hardware IPs are monitored, the interactive mode is used, BPU and DSP samples are taken every 500 times per second, and the hardware IP utilization is refreshed every 1000ms.

Example

hrt_ucp_monitor
ucp_monitor_default

batch

Overview

In the batch mode, it is not supported to receive user keystrokes. Instead, each time hrt_ucp_monitor refreshed the data, it will output a new line and is suitable for redirecting data to a file.

Exampe 1: Output results in terminal

hrt_ucp_monitor -b
ucp_monitor_batch

Example 2: Redirect output results to file.

hrt_ucp_monitor -b > ucp_monitor.txt

delay

Overview

Refresh time for hardware IP usage, unit milliseconds, current supported setting range is [100, 10000]. If the setting time is not within the valid ranges, it will fail and print error prompt information.

Example

hrt_ucp_monitor -d 3000

The refesh time is set to 3 seconds, indicating that the data will be refreshed every 3 seconds.

freq

Overview

Applicable only to BPU and DSP, used to control the status sampling frequency of hardware IP. Currently supported range is [10, 1000], indicating a minimum sampling of 10 times and a maximum of 1000 samples per second. Due to different statistical methods for utilization, other hardware IPs such as GDC, STITCH do not require setting a sampling frequency. When setting a refresh time, utilization data for the specified period will be obtained.

Example

hrt_ucp_monitor -f 100

Set the sampleling period for the busy state of BPU and DSP to 100 samples per second.

number

Overview

Specify the maximum refresh numbers for the hareware IP usage, and when the refresh numbers reaches the maximum numbers, the hrt_ucp_monitor will automatically exit. You can also press CTRL+C to exit early.

Example

hrt_ucp_monitor -n 2 # interactive mode hrt_ucp_monitor -b -n 2 # batch mode

time

Overview

For specifying the tool running time in seconds, hrt_ucp_monitor will calculate the maximum refresh numbers based on the refresh time. When the refresh numbers reaches the maximum refresh numbers, hrt_ucp_monitor will automatically exit. You can also early exit by presing CTRL+C just like the number paramerte. The time and number parameters can not be set simultaneously, an error message will be prompted.

Example

hrt_ucp_monitor -t 10

The default refresh time of the tool is 1 second, and after running for 10 seconds, it will exit.

enable

Overview

You can set the hardware IP to be monitored, which will only monitor the data you care about and reduce the CPU usage of the tool.

Example

hrt_ucp_monitor -e bpu

The tool will only output BPU usage data.

ucp_monitor_bpu

verbose

Overview

Display more detailed log information such as tool parameters during the operation of hrt_ucp_monitor.

Example

hrt_ucp_monitor -v
ucp_monitor_verbose