目录

SmartPerf Device User Guide

Introduction

SmartPerf Device is a reliable, easy-to-use performance and power consumption test tool. In this tool, you can monitor the performance and power consumption of your application and device with quantitative metrics, such as FPS, CPU, GPU, RAM, and Temp.

Targeted at devices with or without screens, SmartPerf Device provides two modes: Device-hap and Device-daemon. Device-hap is applicable to devices with screens and provides a visualized, intuitive UI that simplifies your operations. You can start and pause a test with a floating window, view performance data in real time, and save the test results for further analysis. Device-daemon is applicable to devices with and without screens and works with shell commands.

[h2]Metrics

Implementation Principles

The figure below demonstrates the main functions of SmartPerf Device. Set data collection items and parameters on Device-hap, start the application, and then send data requests for KPIs (such as FPS, RAM, and Trace) from Device-hap to Device-daemon through messages. Device-daemon collects, persists, and analyzes data as requested, and then sends the data to Device-hap for display.

Constraints

  1. Device-daemon and are pre-installed since API version 9.

  2. Device-daemon must be connected to a hardware device, and Device-hap can only be used on devices with a screen.

  3. Before using Device-Daemon, configure the hdc environment.

SmartPerf Device-hap

The RK3568 development board is used as an example below.

[h2]Obtaining the Application List

Start SmartPerf Device-hap. On the home screen, touch Select an app.

[h2]Setting Collection Parameters

After the target application is selected, return to the start page and set the test metrics. You can also change the test name (which includes the name of the target application and the test time and will be displayed in the report), and specify whether to capture traces and whether to enable the screenshot feature. When you are done, touch the Start button at the bottom.

[h2]Using the Floating Window to Manage Data Collection

To start collection, touch Start in the floating window. To pause, touch the timer in the floating window. To resume, touch the timer again. To view the collected data in real time, double-touch the timer. To stop, touch and hold the timer.

You can drag the floating window to anywhere you like.

[h2]Viewing the Report

Touch Report to access the report list. Touch a report to view its details.

SmartPerf Device-daemon

[h2]Collection Prerequisites

[h2]Basic Collection

This feature collects GPU, FPS, CPU, DDR, and memory metrics for the entire device or specific applications. It supports the following operations:

1. Per-second sampling

Command Mandatory Description
-N Yes Sets the number of collection times (once per second).
-PKG No Sets the bundle name.
-PID No Sets the process ID or thread ID.
-threads No Collects the number of child threads of an application.
-fds No Collects application file descriptors. This option is available only for the root user.
-c No

Collects the CPU frequency and usage.

When the application bundle name is set, the system and application CPU information is collected.

Otherwise, only the system CPU information is collected.

-ci No

Collects the number of CPU instructions.

When the application bundle name is set, the number of CPU instructions of the system and application is collected.

Otherwise, the number of CPU instructions of the system is collected.

-g No Collects the GPU frequency and load information.
-f No Collects the screen refresh rate and frame rate of the target application. The application bundle name must be specified.
-t No Collects the temperature of GPU and system chip.
-r No

Collects the memory.

When the application bundle name is set, the system and application memory information is obtained.

Otherwise, only the system memory information is obtained.

-snapshot No Takes a screenshot.
-net No Collects the network speed.
-VIEW No Sets the view layer. You must obtain the layer name first.
-d No Collects the DDR data.
-sections No Sets segment-based collection.

2. On-demand start and stop

Run the start command to start the collection. After operating the device or application, run the stop command to stop the collection.

Command Mandatory Description
-start Yes Starts collection. You can add a basic collection command after this command parameter. The collection is performed every second.
-stop Yes Stops collection and generates a report.
-print No Prints the collection start and stop information every second.

3. CSV output

If the collection result is saved in a CSV file, perform the following steps to export and view the result:

[h2]Scenario Collection

In addition to basic collection, the response and completion latency can be collected. The scenario collection result is displayed in the CLI instead of being written into the data.csv file.

Command Mandatory Description
-editor Yes Identifies scenario collection. Parameter options can be added after.
-responseTime No Collects the response latency.
-completeTime No Collects the completion delay.
-fpsohtest No Collects the frame rate every second. The frame rate is collected 10 times by default.

[h2]Other Collection

The power collection result of the current device can be written into the data.csv file. Other data is collected separately and the collection result is displayed only in the command box.

Command Mandatory Description
-screen No Collects the screen resolution and refresh rate.
-deviceinfo No Obtains device information.
-server No Starts a daemon process by starting or stopping collection.
-clear No Clears all the SP_daemon processes.
-ohtestfps No Obtains the frame rate. You can set the number of collection times (collection is performed every second).
-editorServer No Starts a daemon process by using an editor.
-recordcapacity No Obtains the battery level of the current device.
-profilerfps No Collects the frame rate of the current page.