• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# SmartPerf Device User Guide
2
3## Introduction
4
5SmartPerf 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 indicators, such as FPS, CPU, GPU, RAM, and Temp.
6
7Targeted 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.
8
9### Indicators
10
11- CPU: The tool reads the frequencies and usage of CPU cores on the test device on a per second basis to measure the CPU usage of the target application. Sustained high CPU may lead to overheating.
12- GPU: The tool reads the GPU frequency and load information of the test device on a per second basis to measure the GPU usage of the target application. High GPU usage can lead to performance drops and application slowdowns.
13- FPS: The tool reads the frame rate, in frames per second (FPS), of the target application to measure the smoothness of the application image. A higher FPS generally means smoother visuals.
14- TEMP: The tool reads the temperature information of the test device on a per second basis, including the GPU temperature and system chip temperature.
15- RAM: The tool reads the RAM usage of the target application on a per second basis.
16- snapshot: The tool takes a screenshot of the application UI every 2 seconds.
17
18## Principles
19
20The 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.
21
22![SmartPerf](figures/SmartPerfStru.png)
23
24## Constraints
25
261. Device-daemon and <!--Del-->Device-hap <!--DelEnd-->are pre-installed since API version 9.<!--RP1--><!--RP1End-->
27
282. Device-daemon must be connected to a hardware device, and Device-hap can only be used on devices with a screen.
29
303. Before using Device-Daemon, configure the [hdc environment](../dfx/hdc.md).
31
32<!--RP3-->
33## SmartPerf Device-hap
34
35The RK3568 development board is used as an example below.
36
37### Obtaining the Application List
38
39Start SmartPerf Device-hap. On the home screen, click **Select an app**.
40
41![SmartPerfConfig1](figures/SmartPerfConfig1.png)
42![SmartPerfConfig2](figures/SmartPerfConfig2.png)
43![SmartPerfConfig3](figures/SmartPerfConfig3.png)
44
45### Setting Collection Parameters
46
47After the target application is selected, return to the start page and set the test indicators. 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, click the **Start** button at the bottom.
48
49### Using the Floating Window to Manage Data Collection
50
51To 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.<br>You can drag the floating window to anywhere you like.
52
53![SmartPerfControl1](figures/SmartPerfControl1.png)
54![SmartPerfControl2](figures/SmartPerfControl2.png)
55
56### Viewing the Report
57
58Click **Report** to access the report list. Touch a report to view its details.
59
60![SmartPerfReport1](figures/SmartPerfReport1.png)
61![SmartPerfReport2](figures/SmartPerfReport2.png)
62
63## SmartPerf Device-daemon
64
65### Collection Prerequisites
66
67#### Switching to Shell
68
69  ```
70  C:\Users\issusser>hdc shell
71  $
72  ```
73
74#### Starting and Viewing the daemon Process
75
76  ```
77  C:\Users\issusser>hdc shell
78  // Start the daemon process.
79  $ SP_daemon
80  // Check whether the daemon process is running.
81  $ ps -ef | grep SP_daemon
82  shell          1584     1 0 21:50:05 ?     00:00:00 SP_daemon
83  shell          1595  1574 3 21:51:02 pts/0 00:00:00 grep SP_daemon
84  $
85  ```
86
87#### Viewing the Help Information
88
89  ```
90  $ SP_daemon --help
91  OpenHarmony performance testing tool SmartPerf command-line version
92   Usage: SP_daemon [options] [arguments]
93
94   options:
95    -N              set the collection times(default value is 0) range[1,2147483647], for example: -N 10
96    -PKG            set package name, must add, for example: -PKG ohos.samples.ecg
97    -PID            set process pid, must add, for example: -PID 3568
98    -threads        get threads, must add -PID or -PKG for example:
99                    -threads -PID 3568 or -threads -PKG ohos.samples.ecg
100    -fds            get file descriptor, must add -PID or -PKG for example:
101                    -fds -PID 3568 or -fds -PKG ohos.samples.ecg
102    -c              get device CPU frequency and CPU usage, process CPU usage and CPU load ..
103    -ci             get cpu instructions and cycles
104    -g              get device GPU frequency and GPU load
105    -f              get app refresh fps(frames per second) and fps jitters and refreshrate
106    -profilerfps    get refresh fps and timestamp
107    -sections       set collection time period(using with profilerfps)
108    -t              get remaining battery power and temperature..
109    -p              get battery power consumption and voltage(Not supported by some devices)
110    -print          start mode print log
111    -r              get process memory and total memory
112    -snapshot       get screen capture
113    -net            get uplink and downlink traffic
114    -start          collection start command
115    -stop           collection stop command
116    -VIEW           set layler, for example: -VIEW DisplayNode
117    -OUT            set csv output path.
118    -d              get device DDR information
119    -screen         get screen resolution
120    -deviceinfo     get device information
121    -server         start a process to listen to the socket message of the start and stop commands
122    -clear          clear the process ID
123    -ohtestfps      used by the validator to obtain the fps, the collection times can be set
124    -editorServer   start a process to listen to the socket message of the editor
125    -recordcapacity get the battery level difference
126    --version       get version
127    --help          get help
128    -editor         scenario-based collection identifier, parameter configuration items can be added later
129    responseTime   get the page response delay after an application is operated
130    completeTime   get the page completion delay after an application is operated
131    fpsohtest      used by the validator to obtain the fps
132    example1:
133    SP_daemon -N 20 -c -g -t -p -r -net -snapshot -d
134    SP_daemon -N 20 -PKG ohos.samples.ecg -c -g -t -p -f -r -net -snapshot -d
135    SP_daemon -start -c
136    SP_daemon -stop
137    example2: These parameters need to be used separately
138    SP_daemon -screen
139    SP_daemon -deviceinfo
140    SP_daemon -server
141    SP_daemon -clear
142    SP_daemon -ohtestfps 10
143    SP_daemon -editorServer
144    SP_daemon -recordcapacity
145    example3: These parameters need to be used separately
146    SP_daemon -editor responseTime ohos.samples.ecg app name
147    SP_daemon -editor completeTime ohos.samples.ecg app name
148    SP_daemon -editor fpsohtest
149
150
151
152    command exec finished!
153   $
154  ```
155
156### Basic Collection
157
158#### Run the **-N** command to enable the collection
159
160| Command  |Mandatory| Description                  |
161| :-----| :-----| :--------------------- |
162| -N    |Yes| Sets the number of collection times (once per second).   |
163| -PKG  |No| Sets the bundle name.               |
164| -PID  |No| Sets the process ID or thread ID.               |
165| -threads  |No| Collects the number of child threads of an application.               |
166| -fds  |No| Collects application file descriptors. This option is available only for the root user.               |
167| -c    |No| Collects the CPU frequency and usage.<br>When the application bundle name is set, the system and application CPU information is collected.<br>Otherwise, only the system CPU information is collected.    |
168| -ci    |No| Collects the number of CPU instructions.<br>When the application bundle name is set, the number of CPU instructions of the system and application is collected.<br>Otherwise, the number of CPU instructions of the system is collected.    |
169| -g    |No| Collects the GPU frequency and load information.  |
170| -f    |No| Collects the screen refresh rate and frame rate of the target application. The application bundle name must be specified.       |
171| -t    |No| Collects the temperature of GPU and system chip.          |
172| -r    |No| Collects the memory.<br>When the application bundle name is set, the system and application memory information is obtained.<br>Otherwise, only the system memory information is obtained.            |
173| -snapshot |No| Takes a screenshot.            |
174| -net |No| Collects the network speed.             |
175| -VIEW |No| Sets the view layer. You must obtain the layer name first.               |
176| -d    |No| Collects the DDR data.                |
177| -sections|No| Sets segment-based collection.         |
178
179##### Samples
180- Collect the number of application threads once based on the bundle name.
181
182  ```
183    $ SP_daemon -N 1 -PKG ohos.samples.ecg -threads
184
185    order:0 timestamp=1741415592481
186    order:1 threadsNum=18847:113|
187    order:2 tids=18847:43411 43409 43350 43236 25783 25622 25384 25381 19423 19170 19167 19166 19165 19163 19162 19159 19157 19156 19154 19153 19152 19151 19150 19149 19147 19146 19145 19142 19141 19140 19139 19136 19135 19134 19120 19112 19111 19088 19083 19081 19077 19076 19075 19074 19073 19072 19071 19070 19055 19044 19040 19039 19034 19033 19032 19031 19030 19029 19028 19027 19019 19017 19016 19015 19014 19013 19012 19011 19009 19007 19006 19005 19004 19003 19001 19000 18999 18998 18997 18996 18995 18994 18993 18992 18991 18990 18989 18988 18987 18986 18985 18984 18983 18982 18981 18980 18977 18974 18946 18942 18936 18934         18933 18931 18930 18929 18928 18927 18926 18925 18924 18923 18847|
188
189    command exec finished!
190    $
191  ```
192
193- Collect the frequency and usage of CPU cores twice.
194
195  ```
196    $ SP_daemon -N 2 -c
197
198    order:0 timestamp=1501839064260
199    order:1 TotalcpuUsage=0.502513
200    order:2 TotalcpuidleUsage=99.497487
201    order:3 TotalcpuioWaitUsage=0.000000
202    order:4 TotalcpuirqUsage=0.000000
203    order:5 TotalcpuniceUsage=0.000000
204    order:6 TotalcpusoftIrqUsage=0.000000
205    order:7 TotalcpusystemUsage=0.251256
206    order:8 TotalcpuuserUsage=0.251256
207    order:9 cpu0Frequency=1992000
208    order:10 cpu0Usage=1.000000
209    order:11 cpu0idleUsage=99.000000
210    order:12 cpu0ioWaitUsage=0.000000
211    order:13 cpu0irqUsage=0.000000
212    order:14 cpu0niceUsage=0.000000
213    order:15 cpu0softIrqUsage=0.000000
214    order:16 cpu0systemUsage=0.000000
215    order:17 cpu0userUsage=1.000000
216    order:18 cpu1Frequency=1992000
217    order:19 cpu1Usage=0.000000
218    order:20 cpu1idleUsage=100.000000
219    order:21 cpu1ioWaitUsage=0.000000
220    order:22 cpu1irqUsage=0.000000
221    order:23 cpu1niceUsage=0.000000
222    order:24 cpu1softIrqUsage=0.000000
223    order:25 cpu1systemUsage=0.000000
224    order:26 cpu1userUsage=0.000000
225    order:27 cpu2Frequency=1992000
226    order:28 cpu2Usage=1.000000
227    order:29 cpu2idleUsage=99.000000
228    order:30 cpu2ioWaitUsage=0.000000
229    order:31 cpu2irqUsage=0.000000
230    order:32 cpu2niceUsage=0.000000
231    order:33 cpu2softIrqUsage=0.000000
232    order:34 cpu2systemUsage=1.000000
233    order:35 cpu2userUsage=0.000000
234    order:36 cpu3Frequency=1992000
235    order:37 cpu3Usage=0.000000
236    order:38 cpu3idleUsage=100.000000
237    order:39 cpu3ioWaitUsage=0.000000
238    order:40 cpu3irqUsage=0.000000
239    order:41 cpu3niceUsage=0.000000
240    order:42 cpu3softIrqUsage=0.000000
241    order:43 cpu3systemUsage=0.000000
242    order:44 cpu3userUsage=0.000000
243
244    ...
245
246    command exec finished!
247    $
248  ```
249
250- Collect the frequency and usage of CPU cores and CPU usage and load of processes twice based on the bundle name.
251
252  ```
253    $ SP_daemon -N 2 -PKG ohos.samples.ecg -c
254
255
256
257    order:0 timestamp=1741415021814
258    order:1 ChildProcCpuLoad=NA
259    order:2 ChildProcCpuUsage=NA
260    order:3 ChildProcId=NA
261    order:4 ChildProcSCpuUsage=NA
262    order:5 ChildProcUCpuUsage=NA
263    order:6 ProcAppName=ohos.samples.ecg
264    order:7 ProcCpuLoad=2.742330
265    order:8 ProcCpuUsage=7.825508
266    order:9 ProcId=18847
267    order:10 ProcSCpuUsage=2.014652
268    order:11 ProcUCpuUsage=5.810856
269    order:12 TotalcpuUsage=22.527016
270    order:13 TotalcpuidleUsage=77.472984
271    order:14 TotalcpuioWaitUsage=0.000000
272    order:15 TotalcpuirqUsage=0.083126
273    order:16 TotalcpuniceUsage=0.000000
274    order:17 TotalcpusoftIrqUsage=0.000000
275    order:18 TotalcpusystemUsage=7.148795
276    order:19 TotalcpuuserUsage=15.295096
277    order:20 cpu0Frequency=1430000
278    order:21 cpu0Usage=52.475248
279    order:22 cpu0idleUsage=47.524752
280    order:23 cpu0ioWaitUsage=0.000000
281    order:24 cpu0irqUsage=0.000000
282
283    ...
284
285    command exec finished!
286    $
287  ```
288
289- Collect the frequency and usage of CPU cores and CPU usage and load of processes twice based on the process ID.
290
291  ```
292    $ SP_daemon -N 2 -PID 18847 -c
293
294
295
296    order:0 timestamp=1741415133211
297    order:1 ChildProcCpuLoad=NA
298    order:2 ChildProcCpuUsage=NA
299    order:3 ChildProcId=NA
300    order:4 ChildProcSCpuUsage=NA
301    order:5 ChildProcUCpuUsage=NA
302    order:6 ProcAppName=ohos.samples.ecg
303    order:7 ProcCpuLoad=2.510634
304    order:8 ProcCpuUsage=7.005678
305    order:9 ProcId=18847
306    order:10 ProcSCpuUsage=2.697061
307    order:11 ProcUCpuUsage=4.308617
308    order:12 TotalcpuUsage=24.979114
309    order:13 TotalcpuidleUsage=75.020886
310    order:14 TotalcpuioWaitUsage=0.000000
311    order:15 TotalcpuirqUsage=0.083542
312    order:16 TotalcpuniceUsage=0.000000
313    order:17 TotalcpusoftIrqUsage=0.000000
314    order:18 TotalcpusystemUsage=8.270677
315    order:19 TotalcpuuserUsage=16.624896
316    order:20 cpu0Frequency=1430000
317    order:21 cpu0Usage=50.000000
318    order:22 cpu0idleUsage=50.000000
319    order:23 cpu0ioWaitUsage=0.000000
320    order:24 cpu0irqUsage=0.000000
321    ...
322    command exec finished!
323    $
324  ```
325  >**NOTE**
326  >
327  >- Make sure you are on the application screen when running this command.
328
329- Collect the GPU frequency and load of the system once.
330
331  ```
332    $ SP_daemon -N 1 -g
333
334
335
336    order:0 timestamp=1503078740268
337    order:1 gpuFrequency=200000000
338    order:2 gpuLoad=38.000000
339
340    command exec finished!
341    $
342  ```
343
344- Collect the system temperature twice.
345
346  ```
347    $ SP_daemon -N 2 -t
348
349    order:0 timestamp=1502720711191
350    order:1 gpu-thermal=42500.000000
351    order:2 soc-thermal=43.125000
352
353
354    order:0 timestamp=1502720712191
355    order:1 gpu-thermal=41875.000000
356    order:2 soc-thermal=42.500000
357
358    command exec finished!
359    $
360  ```
361
362- Collect the memory information of the system twice.
363
364  ```
365    $ SP_daemon -N 2 -r
366    order:0 timestamp=1705041562521
367    order:1 memAvailable=7339224
368    order:2 memFree=7164708
369    order:3 memTotal=11641840
370
371    order:0 timestamp=1705041563527
372    order:1 memAvailable=7339136
373    order:2 memFree=7164684
374    order:3 memTotal=11641840
375
376    command exec finished!
377    $
378  ```
379
380- Collect the memory of the system and specified application process once based on the bundle name.
381
382  ```
383    $ SP_daemon -N 1 -PKG ohos.samples.ecg -r
384
385
386
387    order:0 timestamp=1741415257059
388    order:1 arktsHeapPss=44835
389    order:2 childCarktsHeapPss=NA
390    order:3 childGpuPss=NA
391    order:4 childGraphicPss=NA
392    order:5 childHeapAlloc=NA
393    order:6 childHeapFree=NA
394    order:7 childHeapSize=NA
395    order:8 childNativeHeapPss=NA
396    order:9 childPrivateClean=NA
397    order:10 childPrivateDirty=NA
398    order:11 childPss=NA
399    order:12 childSharedClean=NA
400    order:13 childSharedDirty=NA
401    order:14 childStackPss=NA
402    order:15 childSwap=NA
403    order:16 childSwapPss=NA
404    order:17 gpuPss=222377
405    order:18 graphicPss=184276
406    order:19 heapAlloc=154696
407    order:20 heapFree=780
408    order:21 heapSize=163208
409    order:22 memAvailable=4612096
410    order:23 memFree=1240924
411    order:24 memTotal=11692696
412    order:25 nativeHeapPss=85290
413    order:26 privateClean=195816
414    order:27 privateDirty=418973
415    order:28 pss=693349
416    order:29 sharedClean=146848
417    order:30 sharedDirty=71056
418    order:31 stackPss=2492
419    order:32 swap=25360
420    order:33 swapPss=25356
421
422    command exec finished!
423    $
424  ```
425
426- Collect the memory of the system and specified application process once based on the process ID.
427
428  ```
429    $ SP_daemon -N 1 -PID 18847 -r
430
431
432
433    order:0 timestamp=1741415293198
434    order:1 arktsHeapPss=45011
435    order:2 childCarktsHeapPss=NA
436    order:3 childGpuPss=NA
437    order:4 childGraphicPss=NA
438    order:5 childHeapAlloc=NA
439    order:6 childHeapFree=NA
440    order:7 childHeapSize=NA
441    order:8 childNativeHeapPss=NA
442    order:9 childPrivateClean=NA
443    order:10 childPrivateDirty=NA
444    order:11 childPss=NA
445    order:12 childSharedClean=NA
446    order:13 childSharedDirty=NA
447    order:14 childStackPss=NA
448    order:15 childSwap=NA
449    order:16 childSwapPss=NA
450    order:17 gpuPss=222381
451    order:18 graphicPss=184276
452    order:19 heapAlloc=154588
453    order:20 heapFree=757
454    order:21 heapSize=163184
455    order:22 memAvailable=4612096
456    order:23 memFree=1238420
457    order:24 memTotal=11692696
458    order:25 nativeHeapPss=85274
459    order:26 privateClean=195996
460    order:27 privateDirty=418977
461    order:28 pss=693440
462    order:29 sharedClean=146848
463    order:30 sharedDirty=71056
464    order:31 stackPss=2492
465    order:32 swap=25360
466    order:33 swapPss=25356
467
468    command exec finished!
469    $
470  ```
471  >**NOTE**
472  >
473  >- Make sure you are on the application screen when running this command.
474  >- This command integrates the **-m** command of earlier version, which obtains data such as **arktsHeapPss**, **gpuPss**, **graphicPss**.
475
476- Collect the number of CPU instructions of the system once.
477
478  ```
479    $ SP_daemon -N 1 -ci
480
481    order:0 cycles per instruction=4.098151
482    order:1 hw-cpu-cycles=190604622.000000
483    order:2 hw-instructions=46509906.000000
484    order:3 timestamp=1609502927840
485    command exec finished!
486    $
487  ```
488
489- Collect the number of CPU instructions of the system and specified application once based on the bundle name.
490
491  ```
492    $ SP_daemon -N 1 -PKG ohos.samples.ecg -ci
493
494    order:0 cycles per instruction=4.121963
495    order:1 hw-cpu-cycles=190092457.000000
496    order:2 hw-instructions=46116973.000000
497    order:3 timestamp=1609502995191
498    command exec finished!
499    $
500  ```
501  >**NOTE**
502  >
503  >- Make sure you are on the application screen when running this command.
504
505- Take two screenshots.
506
507  ```
508    $ SP_daemon -N 2 -snapshot
509
510    order:0 timestamp=1501837609657
511    order:1 capture=data/local/tmp/capture/screenCap_1501837609657.png
512
513
514    order:0 timestamp=1501837610657
515    order:1 capture=NA
516
517    command exec finished!
518    $
519  ```
520  >**NOTE**
521  >
522  >- Screenshots are obtained every 2 seconds.
523  >
524  >- When the collection is complete, you can view the screenshots in **data/local/tmp/capture**.
525  >
526  >- To export the screenshots to drive D, open a new CLI and run the hdc file recv data/local/tmp/capture/screenCap_1700725192774.png D:\\ command.
527
528- Collect the network speeds twice.
529
530  ```
531    $ SP_daemon -N 2 -net
532
533    order:0 timestamp=1705041904832
534    order:1 networkDown=0
535    order:2 networkUp=0
536
537    order:0 timestamp=1705041905870
538    order:1 networkDown=22931
539    order:2 networkUp=2004
540
541    command exec finished!
542    $
543  ```
544
545- Collect the frame rate of a specified application five times based on the bundle name.
546
547  ```
548    $ SP_daemon -N 5 -PKG ohos.samples.ecg -f
549
550    order:0 timestamp=1705306472232
551    order:1 fps=43
552    order:2 fpsJitters=602261688;;8352083;;8267708;;8305209;;8298437;;8308854;;8313542;;8569271;;8061458;;8300521;;8308333;;8309896;;8429167;;8241667;;8258333;;8318229;;8312500;;8304167;;41760937;;16418750;;8298959;;8319270;;8308334;;8313541;;8302605;;8320312;;8298958;;8326042;;8321354;;8301042;;8310417;;8309895;;8308855;;8331250;;8286458;;8343229;;8278125;;8311458;;8306250;;8312500;;8320834;;8346875;;8283333
553    order:3 refreshrate=69
554
555    order:0 timestamp=1705306473234
556    order:1 fps=40
557    order:2 fpsJitters=674427313;;8191145;;8310417;;8319271;;8301562;;8318750;;8302084;;8314062;;8333334;;8283854;;8307812;;8311979;;8310417;;8307813;;8309375;;8323958;;8306250;;8308333;;8317709;;8296875;;8721875;;7895833;;8320833;;8340625;;8276563;;8409896;;8216145;;8310938;;8301042;;8362500;;8252604;;8317708;;8376042;;8256250;;8292187;;8303125;;8313542;;8310417;;8520312
558    order:3 refreshrate=69
559    ...
560
561    command exec finished!
562    $
563  ```
564
565- Collect the frame rate of the specified view layer for 10 times.
566
567  ```
568    $ SP_daemon -N 10 -VIEW DisplayNode -f
569    order:0 timestamp=1705306822850
570    order:1 fps=15
571    order:2 fpsJitters=876291843;;8314062;;8308334;;8314583;;8310417;;8308333;;8326042;;8314583;;8292708;;8492709;;8143750;;8340104;;8294271;;8302604;;8297396
572    order:3 refreshrate=69
573
574    order:0 timestamp=1705306823852
575    order:1 fps=12
576    order:2 fpsJitters=906667363;;8279167;;8311458;;8315625;;8291146;;8313021;;8323438;;8293750;;8303125;;8313541;;8301563;;8317708
577    order:3 refreshrate=69
578    ...
579
580    command exec finished!
581    $
582  ```
583  >**NOTE**
584  >
585  >- **DisplayNode** indicates the name of the specified layer.
586  >
587  >- When using this command to collect data, you need to operate the page on the specified layer.
588  >
589  >- This command cannot be used together with the commands used to collect frame rate of a specified application, such as the **SP_daemon -N 20 -PKG ohos.samples.ecg -f** or **SP_daemon -N 20 -VIEW DisplayNode -f** commands.
590
591- Collect DDR information once.
592
593  ```
594    $ SP_daemon -N 1 -d
595
596    order:0 timestamp=1710916175201
597    order:1 ddrFrequency=1531000000
598
599    command exec finished!
600    $
601  ```
602
603- Example 1: Collect the full information of the system, including the CPU, GPU, temperature, memory, DDR, network speed, and screenshot information.
604
605  ```
606    $ SP_daemon -N 10 -c -g -t -r -d -net -snapshot
607
608    order:0 timestamp=1501837838664
609    order:1 TotalcpuUsage=0.751880
610    order:2 TotalcpuidleUsage=99.248120
611    order:3 TotalcpuioWaitUsage=0.000000
612    order:4 TotalcpuirqUsage=0.000000
613    order:5 TotalcpuniceUsage=0.000000
614    order:6 TotalcpusoftIrqUsage=0.000000
615    order:7 TotalcpusystemUsage=0.501253
616    order:8 TotalcpuuserUsage=0.250627
617    order:9 cpu0Frequency=1992000
618    order:10 cpu0Usage=0.000000
619    order:11 cpu0idleUsage=100.000000
620    order:12 cpu0ioWaitUsage=0.000000
621    order:13 cpu0irqUsage=0.000000
622    order:14 cpu0niceUsage=0.000000
623    order:15 cpu0softIrqUsage=0.000000
624    order:16 cpu0systemUsage=0.000000
625    order:17 cpu0userUsage=0.000000
626    order:18 cpu1Frequency=1992000
627    order:19 cpu1Usage=0.000000
628    order:20 cpu1idleUsage=100.000000
629    order:21 cpu1ioWaitUsage=0.000000
630    order:22 cpu1irqUsage=0.000000
631    order:23 cpu1niceUsage=0.000000
632    order:24 cpu1softIrqUsage=0.000000
633    order:25 cpu1systemUsage=0.000000
634    order:26 cpu1userUsage=0.000000
635    order:27 cpu2Frequency=1992000
636    order:28 cpu2Usage=1.000000
637    order:29 cpu2idleUsage=99.000000
638    order:30 cpu2ioWaitUsage=0.000000
639    order:31 cpu2irqUsage=0.000000
640    order:32 cpu2niceUsage=0.000000
641    order:33 cpu2softIrqUsage=0.000000
642    order:34 cpu2systemUsage=1.000000
643    order:35 cpu2userUsage=0.000000
644    order:36 cpu3Frequency=1992000
645    order:37 cpu3Usage=0.000000
646    order:38 cpu3idleUsage=100.000000
647    order:39 cpu3ioWaitUsage=0.000000
648    order:40 cpu3irqUsage=0.000000
649    order:41 cpu3niceUsage=0.000000
650    order:42 cpu3softIrqUsage=0.000000
651    order:43 cpu3systemUsage=0.000000
652    order:44 cpu3userUsage=0.000000
653    order:45 gpuFrequency=200000000
654    order:46 gpuLoad=0.000000
655    order:47 gpu-thermal=40000.000000
656    order:48 soc-thermal=40.625000
657    order:49 memAvailable=1142820
658    order:50 memFree=687988
659    order:51 memTotal=1935948
660    order:52 ddrFrequency=800000000
661    order:53 networkDown=0
662    order:54 networkUp=0
663    order:55 capture=data/local/tmp/capture/screenCap_1501837838669.png
664
665    ...
666
667    command exec finished!
668    $
669  ```
670
671- Example 2: Collect the full information of the specified application based on the bundle name, including the CPU, GPU, temperature, frame rate, memory, DDR, network speed, and screenshot information.
672
673  ```
674    $ SP_daemon -N 10 -PKG ohos.samples.ecg -c -g -t -f -r -d -net -snapshot -threads
675
676    order:0 timestamp=1741415955626
677    order:1 ChildProcCpuLoad=NA
678    order:2 ChildProcCpuUsage=NA
679    order:3 ChildProcId=NA
680    order:4 ChildProcSCpuUsage=NA
681    order:5 ChildProcUCpuUsage=NA
682    order:6 ProcAppName=ohos.samples.ecg
683    order:7 ProcCpuLoad=2.641511
684    order:8 ProcCpuUsage=6.026481
685    order:9 ProcId=18847
686    order:10 ProcSCpuUsage=1.747202
687    order:11 ProcUCpuUsage=4.279279
688    order:12 TotalcpuUsage=26.021798
689    order:13 TotalcpuidleUsage=73.978202
690    order:14 TotalcpuioWaitUsage=0.000000
691    order:15 TotalcpuirqUsage=0.068120
692    order:16 TotalcpuniceUsage=0.000000
693    order:17 TotalcpusoftIrqUsage=0.000000
694    order:18 TotalcpusystemUsage=10.762943
695    order:19 TotalcpuuserUsage=15.190736
696    ...
697    order:123 gpuFrequency=279000000
698    order:124 gpuLoad=0.000000
699    order:125 Battery=35.000000
700    order:126 cluster0=51.000000
701    order:127 gpu=47.000000
702    order:128 npu_thermal=35.000000
703    order:129 shell_back=36.627000
704    order:130 shell_frame=35.627000
705    order:131 shell_front=35.652000
706    order:132 soc_thermal=59.259000
707    order:133 system_h=37.000000
708    order:134 fps=30
709    order:135 fpsJitters=33501562;;50251042;;33522396;;16743750;;33482812;;33505730;;33507291;;33505209;;33502604;;50258854;;33518229;;33501563;;16753125;;50247916;;16751563;;33507812;;16740104;;16792188;;33464583;;33497917;;50261458;;33493750;;33511459;;33502083;;16744271;;16756250;;33505729;;50254687;;33507292;;50286979
710    order:136 refreshrate=60
711    order:137 arktsHeapPss=29564
712    order:138 gpuPss=254647
713    order:139 graphicPss=215796
714    order:140 heapAlloc=174032
715    order:141 heapFree=1232
716    order:142 heapSize=187924
717    order:143 memAvailable=3437568
718    order:144 memFree=780152
719    order:145 memTotal=11697880
720    order:146 nativeHeapPss=91244
721    order:147 privateClean=162560
722    order:148 privateDirty=488739
723    order:149 pss=761908
724    order:150 sharedClean=225060
725    order:151 sharedDirty=48740
726    order:152 stackPss=2596
727    order:153 swap=62024
728    order:154 swapPss=62024
729    order:155 ddrFrequency=1531000000
730    order:156 networkDown=215
731    order:157 networkUp=0
732    ...
733    order:180 capture=data/local/tmp/capture/screenCap_1741415955811.png
734    order:181 threadsNum=18847:111|
735    order:182 tids=18847:45862 45700 25783 25622 25384 25381 19423 19170 19167 19166 19165 19163 19162 19159 19157 19156 19154 19153 19152 19151 19150 19149 19147 19146 19145 19142 19141 19140 19139 19136 19135 19134 19120 19112 19111 19088 19083 19081 19077 19076 19075 19074 19073 19072 19071 19070 19055 19044 19040 19039 19034 19033 19032 19031 19030 19029 19028 19027 19019 19017 19016 19015 19014 19013 19012 19011 19009 19007 19006 19005 19004 19003 19001 19000 18999 18998 18997 18996 18995 18994 18993 18992 18991 18990 18989 18988 18987 18986 18985 18984 18983 18982 18981 18980 18977 18974 18946 18942 18936 18934 18933 18931 18930 18929 18928 18927 18926 18925 18924 18923 18847|
736    ...
737
738    command exec finished!
739    $
740  ```
741
742- Example 3: Collect the full information of the specified application based on the process ID, including the CPU, GPU, temperature, frame rate, memory, DDR, network speed, and screenshot information.
743
744  ```
745    $ SP_daemon -N 10 -PID 18847 -c -g -t -f -r -d -net -snapshot -threads
746
747    order:0 timestamp=1741416084766
748    order:1 ChildProcCpuLoad=NA
749    order:2 ChildProcCpuUsage=NA
750    order:3 ChildProcId=NA
751    order:4 ChildProcSCpuUsage=NA
752    order:5 ChildProcUCpuUsage=NA
753    order:6 ProcAppName=ohos.samples.ecg
754    order:7 ProcCpuLoad=2.857003
755    order:8 ProcCpuUsage=5.932203
756    order:9 ProcId=18847
757    order:10 ProcSCpuUsage=1.765537
758    order:11 ProcUCpuUsage=4.166667
759    order:12 TotalcpuUsage=28.442728
760    order:13 TotalcpuidleUsage=71.557272
761    order:14 TotalcpuioWaitUsage=0.000000
762    order:15 TotalcpuirqUsage=0.000000
763    order:16 TotalcpuniceUsage=0.000000
764    order:17 TotalcpusoftIrqUsage=0.000000
765    order:18 TotalcpusystemUsage=9.716860
766    order:19 TotalcpuuserUsage=18.725869
767    ...
768    order:123 gpuFrequency=279000000
769    order:124 gpuLoad=0.000000
770    order:125 Battery=35.000000
771    order:126 cluster0=51.000000
772    order:127 gpu=47.000000
773    order:128 npu_thermal=35.000000
774    order:129 shell_back=36.627000
775    order:130 shell_frame=35.627000
776    order:131 shell_front=35.652000
777    order:132 soc_thermal=59.259000
778    order:133 system_h=37.000000
779    order:134 fps=30
780    order:135 fpsJitters=33501562;;50251042;;33522396;;16743750;;33482812;;33505730;;33507291;;33505209;;33502604;;50258854;;33518229;;33501563;;16753125;;50247916;;16751563;;33507812;;16740104;;16792188;;33464583;;33497917;;50261458;;33493750;;33511459;;33502083;;16744271;;16756250;;33505729;;50254687;;33507292;;50286979
781    order:136 refreshrate=60
782    order:137 arktsHeapPss=29564
783    order:138 gpuPss=254647
784    order:139 graphicPss=215796
785    order:140 heapAlloc=174032
786    order:141 heapFree=1232
787    order:142 heapSize=187924
788    order:143 memAvailable=3437568
789    order:144 memFree=780152
790    order:145 memTotal=11697880
791    order:146 nativeHeapPss=91244
792    order:147 privateClean=162560
793    order:148 privateDirty=488739
794    order:149 pss=761908
795    order:150 sharedClean=225060
796    order:151 sharedDirty=48740
797    order:152 stackPss=2596
798    order:153 swap=62024
799    order:154 swapPss=62024
800    order:155 ddrFrequency=1531000000
801    order:156 networkDown=215
802    order:157 networkUp=0
803    ...
804    order:180 capture=data/local/tmp/capture/screenCap_1741416084923.png
805    order:181 threadsNum=18847:113|
806    order:182 tids=18847:46736 46734 46731 46663 25783 25622 25384 25381 19423 19170 19167 19166 19165 19163 19162 19159 19157 19156 19154 19153 19152 19151 19150 19149 19147 19146 19145 19142 19141 19140 19139 19136 19135 19134 19120 19112 19111 19088 19083 19081 19077 19076 19075 19074 19073 19072 19071 19070 19055 19044 19040 19039 19034 19033 19032 19031 19030 19029 19028 19027 19019 19017 19016 19015 19014 19013 19012 19011 19009 19007 19006 19005 19004 19003 19001 19000 18999 18998 18997 18996 18995 18994 18993 18992 18991 18990 18989 18988 18987 18986 18985 18984 18983 18982 18981 18980 18977 18974 18946 18942 18936 18934 18933 18931 18930 18929 18928 18927 18926 18925 18924 18923 18847|
807    ...
808
809    command exec finished!
810    $
811  ```
812  >**NOTE**
813  >
814  >- Make sure you are on the application screen when running this command.
815
816
817#### Run the **-start** command to start the collection
818
819Run the **start** command to start collection, operate the device or application, and then run the **stop** command to stop collection.
820
821| Command  |Mandatory| Description                  |
822| :-----|:-----| :--------------------- |
823| -start |Yes| Starts collection. You can add a basic collection command after this command parameter. The collection is performed every second.           |
824| -stop |Yes| Stops collection. A report is generated when collection is complete.             |
825| -print |No| Prints collection information every second.             |
826
827##### Samples
828
829- Start and stop collecting the frequency and usage of CPU cores.
830
831   ```
832   # Start data collection
833   $ SP_daemon -start -c
834   SP_daemon Collection begins
835
836
837   command exec finished!
838   $
839
840   # Stop data collection
841   $ SP_daemon -stop
842   SP_daemon Collection ended
843   Output Path: data/local/tmp/smartperf/1/t_index_info.csv
844
845
846   command exec finished!
847   $
848   ```
849
850- Start and stop collecting the frequency and usage of CPU cores and print the information.
851
852   ```
853    # Start data collection
854    # Start printing the collection information
855    $ SP_daemon -start -c -print
856    SP_daemon Collection begins
857
858    order:0 TotalcpuUsage=20.860927
859    order:1 TotalcpuidleUsage=79.139073
860    order:2 TotalcpuioWaitUsage=0.000000
861    order:3 TotalcpuirqUsage=0.082781
862    order:4 TotalcpuniceUsage=0.000000
863    order:5 TotalcpusoftIrqUsage=0.000000
864    order:6 TotalcpusystemUsage=8.029801
865    order:7 TotalcpuuserUsage=12.748344
866    order:8 cpu0Frequency=1430000
867    order:9 cpu0Usage=44.554455
868    order:10 cpu0idleUsage=55.445545
869    order:11 cpu0ioWaitUsage=0.000000
870    order:12 cpu0irqUsage=0.000000
871    order:13 cpu0niceUsage=0.000000
872    order:14 cpu0softIrqUsage=0.000000
873    order:15 cpu0systemUsage=17.821782
874    order:16 cpu0userUsage=26.732673
875    order:17 cpu10Frequency=1239000
876    order:18 cpu10Usage=0.000000
877    order:19 cpu10idleUsage=100.000000
878    order:20 cpu10ioWaitUsage=0.000000
879    order:21 cpu10irqUsage=0.000000
880    order:22 cpu10niceUsage=0.000000
881    order:23 cpu10softIrqUsage=0.000000
882    order:24 cpu10systemUsage=0.000000
883    order:25 cpu10userUsage=0.000000
884    order:26 cpu11Frequency=1239000
885    order:27 cpu11Usage=0.000000
886    order:28 cpu11idleUsage=100.000000
887    order:29 cpu11ioWaitUsage=0.000000
888    order:30 cpu11irqUsage=0.000000
889    order:31 cpu11niceUsage=0.000000
890    order:32 cpu11softIrqUsage=0.000000
891    order:33 cpu11systemUsage=0.000000
892    order:34 cpu11userUsage=0.000000
893    ...
894    command exec finished!
895    $
896
897    # Stop data collection
898    # To stop printing, you need to open the CLI and run the following command:
899    $ SP_daemon -stop
900    SP_daemon Collection ended
901    Output Path: data/local/tmp/smartperf/1/t_index_info.csv
902
903    command exec finished!
904    $
905   ```
906   >**NOTE**
907   >
908   >- Example 1: Run the **SP_daemon -start -c -g -t -r -d -net -snapshot** command to collect the CPU, GPU, temperature, frame rate, memory, DDR, network rate, and screenshot information of the system.
909   >
910   >- Example 2: Run the **SP_daemon -start -PKG ohos.samples.ecg -c -g -t -f -r -d -net -snapshot -threads -fd** command to collect the CPU load, GPU, temperature, frame rate, memory, DDR, network rate, screenshot, number of threads, and file descriptor information of the system and processes.
911   >
912   >- Example 3: Run the **SP_daemon -start -PID 18847 -c -g -t -f -r -d -net -snapshot -threads -fd** command to collect the CPU load, GPU, temperature, frame rate, memory, DDR, network rate, screenshot, number of threads, and file descriptor information of the system and processes.
913   >
914   >- Example 4: Run the **SP_daemon -start -c -g -t -r -d -net -snapshot -threads -fd -print** command to collect and print the CPU, GPU, temperature, frame rate, memory, DDR, network rate, screenshot, number of threads, and file descriptor information of the system.
915   >
916   >- Example 5: Run the **SP_daemon -start -PID 18847 -c -g -t -f -r -d -net -snapshot -threads -fd -print** command to collect and print the CPU load, GPU, temperature, frame rate, memory, DDR, network rate, screenshot, number of threads, and file descriptor information of the system and processes.
917   >
918   >- The service start and stop file is stored in **data/local/tmp/smartperf/1/t_index_info.csv**. You can run the **hdc file recv** command to export the report. For details, see [Viewing Collection Result in the CSV File](#viewing-collection-result-in-the-csv-file).
919
920#### Viewing Collection Result in the CSV File
921
922If the collection result is saved in a CSV file, perform the following steps to export and view the result:
923
924  - By default, the collection results are saved to **/data/local/tmp/data.csv**.
925
926  - To check the path to the test result file:
927
928    ```
929    C:\Users\issusser>hdc shell
930    $ cd data/local/tmp
931    # ls
932    data.csv
933    $
934    ```
935
936  - To export the test result file:
937    ```
938    C:\Users\issusser>hdc file recv data/local/tmp/data.csv D:\
939    [I][2023-11-08 16:16:41] HdcFile::TransferSummary success
940    FileTransfer finish, Size:429, File count = 1, time:6ms rate:71.50kB/s
941
942    C:\Users\issusser>
943    ```
944
945  - Open the **data.csv** file to view the collected data.
946
947    The table below describes the data fields in the **data.csv** file.
948
949    | Data Field   | Description            |Remarks|
950    | :-----| :--------------------- |:-----|
951    | threadsNum              | Total number of threads.             |-|
952    | tids                    | Thread ID.               |-|
953    | fdTotal                 | Total number of file descriptors.        |-|
954    | fds                     | File descriptor.            |Unit: Hz|
955    | cpuFrequency            | CPU core frequency.       |Unit: Hz|
956    | cpuUasge                | CPU core usage.         |%|
957    | cpuidleUsage            | CPU usage in idle state.       |%|
958    | cpuioWaitUsage          | CPU usage of I/O wait.       |%|
959    | cpuirqUsage             | CPU usage of hardware interrupts.        |%|
960    | cpuniceUsage            | CPU usage of user level processes with lower scheduling priority.   |%|
961    | cpusoftIrqUsage         | CPU usage of software interrupts.        |%|
962    | cpusystemUsage          | CPU usage in kernel mode.     |%|
963    | cpuuserUsage            | CPU usage in user mode.          |%|
964    | ProcId                  | Process ID.               |-|
965    | ChildProcId             | Child process ID.               |-|
966    | ProcAppName             | Application bundle name.               |-|
967    | ProcCpuLoad             | Process CPU load.       |%|
968    | ChildProcCpuLoad        | CPU load of the child process.       |%|
969    | ProcCpuUsage            | CPU usage of the process.         |%|
970    | ChildProcCpuUsage       | CPU usage of the child process.         |%|
971    | ProcUCpuUsage           | CPU usage of the process in user mode.    |%|
972    | ChildProcCpuUsage       | CPU usage of the child process in user mode.         |%|
973    | ProcSCpuUsage           | CPU usage of the process in kernel mode.    |%|
974    | ChildProcSCpuUsage      | CPU usage of the child process in kernel mode.    |%|
975    | gpuFrequency            | GPU frequency of the system.         |%|
976    | gpuLoad                 | GPU load of the system.     |%|
977    | hw-instructions         | Number of executed instructions.         |-|
978    | cycles per instruction  | Average number of cycles per instruction.   |Unit: ns|
979    | hw-cpu-cycles           | Number of CPU clock cycles.         |Unit: ns|
980    | currentNow              | Current value.      |Unit: mA|
981    | voltageNow              | Voltage value.      |Unit: μV|
982    | fps                     | Number of frames per second.             |Unit: FPS|
983    | fpsJitters              | Frame interval.       |Unit: ns|
984    | refreshrate             | Screen refresh rate.           |Unit: Hz|
985    | networkDown             | Downstream rate.             |Unit: byte/s|
986    | networkUp               | Uplink rate.             |Unit: byte/s|
987    | ddrFrequency            | DDR frequency.              |Unit: Hz|
988    | gpu-thermal             | GPU temperature.             |Unit: °C|
989    | soc-thermal             | SoC temperature.         |Unit: °C|
990    | memAvailable            | Available memory of the system.        |Unit: KB|
991    | memFree                 | Free memory of the system.        |Unit: KB|
992    | memTotal                | Total memory of the system.          |Unit: KB|
993    | pss                     | Proportional set size (PSS) of the process.     |Unit: KB|
994    | Childpss                | Proportional set size (PSS) of the child process.     |Unit: KB|
995    | sharedClean             | Shared unwritten pages of the process.     |Unit: KB|
996    | ChildsharedClean        | Shared unwritten pages of the child process.     |Unit: KB|
997    | sharedDirty             | Shared rewritten pages of the process.     |Unit: KB|
998    | ChildsharedDirty        | Shared rewritten pages of the child process.     |Unit: KB|
999    | priviateClean           | Private unwritten pages of the process.     |Unit: KB|
1000    | ChildpriviateClean      | Private unwritten pages of the child process.     |Unit: KB|
1001    | privateDirty            | Private rewritten pages of the process.     |Unit: KB|
1002    | ChildprivateDirty       | Private rewritten pages of the child process.     |Unit: KB|
1003    | swapTotal               | Total swap memory of the process.         |Unit: KB|
1004    | ChildswapTotal          | Total swap memory of the child process.         |Unit: KB|
1005    | swapPss                 | Swapped PSS of the process.       |Unit: KB|
1006    | ChildswapPss            | Swapped PSS of the child process.       |Unit: KB|
1007    | HeapSize                | Heap size of the process.          |Unit: KB|
1008    | ChildHeapSize           | Heap size of the child process.          |Unit: KB|
1009    | HeapAlloc               | Heap size that can be allocated of the process.   |Unit: KB|
1010    | ChildHeapAlloc          | Heap size that can be allocated of the child process.   |Unit: KB|
1011    | HeapFree                | Remaining heap size of the process.     |Unit: KB|
1012    | ChildHeapFree           | Remaining heap size of the child process.     |Unit: KB|
1013    | gpuPss                  | Used GPU size of the process.    |Unit: KB|
1014    | ChildgpuPss             | Used GPU size of the child process.    |Unit: KB|
1015    | graphicPss              | Used graphics memory size of the process.    |Unit: KB|
1016    | ChildgraphicPss         | Used graphics memory size of the child process.    |Unit: KB|
1017    | arktsHeapPss            | Used ArkTS memory size of the process.   |Unit: KB|
1018    | ChildarktsHeapPss       | Used ArkTS memory size of the child process.   |Unit: KB|
1019    | nativeHeapPss           | Used native memory size of the process.  |Unit: KB|
1020    | ChildnativeHeapPss      | Used native memory size of the child process.  |Unit: KB|
1021    | stackPss                | Used stack memory size of the process.      |Unit: KB|
1022    | ChildstackPss           | Used stack memory size of the child process.      |Unit: KB|
1023    | timeStamp               | Timestamp.           |Collection time.|
1024
1025### Scenario Collection
1026
1027In addition to basic collection, the response and completion delay can be collected. The scenario collection result is displayed in the CLI instead of being written into the **data.csv** file.
1028
1029| Command  |Mandatory| Description                  |
1030| :-----|:-----| :--------------------- |
1031| -editor|Yes|    Identifies scenario collection. Parameter options can be added after.        |
1032| -responseTime|No|    Collects the response latency.        |
1033| -completeTime|No|    Collects the completion delay.        |
1034| -fpsohtest|No|    A validator used to collect the frame rate every second. The frame rate is collected 10 times by default.      |
1035
1036#### Samples
1037
1038- Collect the application response latency. (This command supports only the RK3568 device.)
1039
1040  ```
1041   $ SP_daemon -editor responseTime ohos.samples.ecg ohtest
1042   time:544ms
1043
1044   command exec finished!
1045  ```
1046  >**NOTE**
1047  >
1048  >- Open the application before collection, press **Enter** in the CLI, switch to the application page, and wait for the collection result to be printed.
1049
1050- Collect the application completion latency. (This command supports only the RK3568 device.)
1051
1052  ```
1053   $ SP_daemon -editor completeTime ohos.samples.ecg ohtest
1054   time:677ms
1055
1056   command exec finished!
1057  ```
1058  >**NOTE**
1059  >
1060  >- Open the application before collection, press **Enter** in the CLI, switch to the application page, and wait for the collection result to be printed.
1061
1062- Use the validator to obtain the application page frame rate.
1063
1064  ```
1065   $ SP_daemon -editor fpsohtest
1066   set num:10 successfps:0|1726909713442fps:97|1726909714442fps:113|1726909715442fps:116|1726909716442fps:116|1726909717442fps:118|1726909718442fps:114|1726909719442fps:114|1726909720442fps:115|1726909721442fps:118|1726909722442SP_daemon exec finished!
1067  ```
1068  >**NOTE**
1069  >
1070  >- You need to swipe or switch the current page after running the command, and the collection result will be printed after 10s.
1071
1072### Other Collection
1073
1074The 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.
1075
1076| Command  |Mandatory| Description                  |
1077| :-----|:-----| :--------------------- |
1078| -screen |No| Collects the screen resolution and refresh rate.              |
1079| -deviceinfo|No| Obtains device information.             |
1080| -server|No|    Starts a daemon process by starting or stopping collection.          |
1081| -clear|No|    Clears all the SP_daemon processes.          |
1082| -ohtestfps|No|    Obtains the frame rate. You can set the number of collection times (collection is performed every second).         |
1083| -editorServer|No|    Starts a daemon process by using an editor.        |
1084| -recordcapacity|No|    Obtains the battery level of the current device.        |
1085| -profilerfps |No| Collects the frame rate of the current page.         |
1086
1087#### Samples
1088
1089- Obtain the screen resolution.
1090
1091  ```
1092   $ SP_daemon -screen
1093   activeMode: 720x1280, refreshrate=69
1094
1095
1096   command exec finished!
1097   $
1098  ```
1099  >**NOTE**
1100  >
1101  >- **activeMode** indicates the current screen resolution, and **refreshrate** indicates the screen refresh rate.
1102
1103- Obtain the device information.
1104
1105  ```
1106   $ SP_daemon -deviceinfo
1107   abilist: default
1108   activeMode: 720x1280
1109   board: hw
1110   brand: default
1111   cpu_c1_cluster: 0 1 2 3
1112   cpu_c1_max: 1992000
1113   cpu_c1_min: 408000
1114   cpu_cluster_name: policy0
1115   daemonPerfVersion: 1.0.5
1116   deviceTypeName: rk3568
1117   fullname: OpenHarmony-5.1.0.46
1118   gpu_max_freq: 800000000
1119   gpu_min_freq: 200000000
1120   model: ohos
1121   name: OpenHarmony 3.2
1122   sn: 150100424a5444345209d941bec6b900
1123   version: OpenHarmony 5.1.0.46
1124
1125   command exec finished!
1126   $
1127  ```
1128
1129- Start a process to listen for the socket messages of the **start** and **stop** commands.
1130
1131  ```
1132   $ SP_daemon -server
1133   $
1134   $ pidof SP_daemon
1135   7024
1136   $
1137  ```
1138  >**NOTE**
1139  >
1140  >- You can run the **pidof SP_daemon** command to view the process ID.
1141
1142- Clear the SP_daemon process ID.
1143
1144  ```
1145   $ pidof SP_daemon
1146   2725
1147   $ SP_daemon -clear
1148
1149
1150   command exec finished!
1151   $
1152   $ pidof SP_daemon
1153   $
1154  ```
1155  >**NOTE**
1156  >
1157  >- You can run the **pidof SP_daemon** command to view the process ID.
1158
1159- Obtain the frame rate of the current page using a validator.
1160
1161  ```
1162   $ SP_daemon -ohtestfps 10
1163   set num:10 success
1164   fps:1|1501926684532
1165   fps:18|1501926685532
1166   fps:37|1501926686532
1167   fps:41|1501926687532
1168   fps:42|1501926688532
1169   fps:16|1501926689532
1170   fps:40|1501926690532
1171   fps:40|1501926691532
1172   fps:42|1501926692532
1173   fps:41|1501926693532
1174   SP_daemon exec finished!
1175   $
1176  ```
1177  >**NOTE**
1178  >
1179  >- In this command, **10** indicates the number of collection times (collection is performed every second). You can set it to a positive integer.
1180
1181
1182- Start a process to listen for the socket messages of the editor tool.
1183
1184  ```
1185   $ SP_daemon -editorServer
1186
1187
1188   command exec finished!
1189  ```
1190
1191
1192- Obtain the battery level.
1193
1194  ```
1195   $ SP_daemon -recordcapacity
1196   recordTime: 1726903063
1197   recordPower: 5502
1198  ```
1199  >**NOTE**
1200  >
1201  >- **recordTime** indicates the timestamp, and **recordPower** indicates the current battery level.
1202  >
1203  >- This command needs to be executed separately. The collection result is written into the **/data/local/tmp/powerLeftRecord.csv** file and can be exported to the local PC by running the **hdc file recv** command. For details, see [Viewing Collection Result in the CSV File](#viewing-collection-result-in-the-csv-file).
1204
1205- Collect the frame rate of the current page.
1206
1207  ```
1208    $ SP_daemon -profilerfps 10
1209    set num:10 success
1210    fps:0|1711692357278
1211    fps:0|1711692358278
1212    fps:1|1711692359278
1213    fps:0|1711692360278
1214    fps:0|1711692361278
1215    fps:0|1711692362278
1216    fps:0|1711692363278
1217    fps:0|1711692364278
1218    fps:26|1711692365278
1219    fps:53|1711692366278
1220    SP_daemon exec finished!
1221    $
1222  ```
1223  >**NOTE**
1224  >
1225  >- In this command, **100** indicates the number of collection times (collection is performed every second). You can set it to a positive integer.
1226
1227- Collect the frame rate by time segment.
1228
1229  ```
1230    $ SP_daemon -profilerfps 100 -sections 10
1231    set num:100 success
1232    fps:0|1711692393278
1233    fps:0|1711692394278
1234    fps:0|1711692395278
1235    fps:44|1711692396278
1236    sectionsFps:0|1711692396278
1237    sectionsFps:0|1711692396378
1238    sectionsFps:40|1711692396478
1239    sectionsFps:60|1711692396578
1240    sectionsFps:60|1711692396678
1241    sectionsFps:60|1711692396778
1242    sectionsFps:60|1711692396878
1243    sectionsFps:40|1711692396978
1244    sectionsFps:60|1711692397078
1245    sectionsFps:60|1711692397178
1246    fps:51|1711692397278
1247
1248    ...
1249
1250    SP_daemon exec finished!
1251    $
1252  ```
1253  >**NOTE**
1254  >
1255  >- In this command, **100** indicates the number of collection times (collection is performed every second) and can be set to a positive integer. **10** indicates collection by segment. Currently, the number of collection segments can be set to a positive integer ranging from 1 to 10.
1256
1257
1258<!--RP3End-->
1259