1e41f4b71Sopenharmony_ci# task 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## 命令功能 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_citask命令用于查询进程及线程信息。 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## 命令格式 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_citask/task -a 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci## 参数说明 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci**表1** 参数说明 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci| 参数 | 参数说明 | 取值范围 | 19e41f4b71Sopenharmony_ci| -------- | -------- | -------- | 20e41f4b71Sopenharmony_ci| -a | 查看更多信息。 | N/A | 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci## 使用指南 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci参数缺省时默认打印部分任务信息。 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci## 使用实例 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci举例:输入task 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci## 输出说明 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci**示例** 查询任务部分信息 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci``` 38e41f4b71Sopenharmony_ciOHOS # task 39e41f4b71Sopenharmony_ci allCpu(%): 3.54 sys, 196.46 idle 40e41f4b71Sopenharmony_ci PID PPID PGID UID Status VirtualMem ShareMem PhysicalMem CPUUSE10s PName 41e41f4b71Sopenharmony_ci 1 -1 1 0 Pending 0x33b000 0xbb000 0x4dc8b 0.0 init 42e41f4b71Sopenharmony_ci 2 -1 2 0 Pending 0x193318e 0 0x193318e 1.11 KProcess 43e41f4b71Sopenharmony_ci 3 1 3 7 Pending 0x730000 0x1a2000 0x1d34f6 0.0 foundation 44e41f4b71Sopenharmony_ci 4 1 4 8 Pending 0x35e000 0xb8000 0x56777 0.0 bundle_daemon 45e41f4b71Sopenharmony_ci 5 1 5 1 Pending 0xdfa000 0x2e7000 0x1487ce 0.0 appspawn 46e41f4b71Sopenharmony_ci 6 1 6 0 Pending 0x688000 0x137000 0x11c518 0.0 media_server 47e41f4b71Sopenharmony_ci 7 1 7 0 Pending 0x9d2000 0x103000 0xa1ddf 0.89 wms_server 48e41f4b71Sopenharmony_ci 8 1 1 1000 Running 0x2bf000 0x8f000 0x2a8c6 0.0 shell 49e41f4b71Sopenharmony_ci 9 5 5 101 Pending 0x11ea000 0x2f9000 0x20429d 0.97 com.example.launcher 50e41f4b71Sopenharmony_ci 11 1 11 0 Pending 0x4d4000 0x112000 0xe0ad7 0.0 deviceauth_service 51e41f4b71Sopenharmony_ci 12 1 12 0 Pending 0x34f000 0xbd000 0x519ee 0.0 sensor_service 52e41f4b71Sopenharmony_ci 13 1 13 2 Pending 0x34e000 0xb3000 0x523d9 0.0 ai_server 53e41f4b71Sopenharmony_ci 14 1 14 0 Pending 0x61f000 0x13b000 0x16841c 0.50 softbus_server 54e41f4b71Sopenharmony_ci TID PID Affi CPU Status StackSize WaterLine CPUUSE10s MEMUSE TaskName 55e41f4b71Sopenharmony_ci 23 1 0x3 -1 Pending 0x3000 0xe44 0.0 0 init 56e41f4b71Sopenharmony_ci 1 2 0x1 -1 Pending 0x4000 0x2c4 0.37 0 Swt_Task 57e41f4b71Sopenharmony_ci 2 2 0x3 -1 Pending 0x4000 0x204 0.0 0 system_wq 58e41f4b71Sopenharmony_ci 3 2 0x2 -1 Pending 0x4000 0x514 0.65 0 Swt_Task 59e41f4b71Sopenharmony_ci 4 2 0x3 -1 Pending 0x1000 0x36c 0.0 0 ResourcesTask 60e41f4b71Sopenharmony_ci 7 2 0x3 -1 Pending 0x4e20 0xa5c 0.0 0 PlatformWorkerThread 61e41f4b71Sopenharmony_ci``` 62e41f4b71Sopenharmony_ci 63e41f4b71Sopenharmony_ci**表2** 输出说明 64e41f4b71Sopenharmony_ci 65e41f4b71Sopenharmony_ci| 输出 | 说明 | 66e41f4b71Sopenharmony_ci| -------- | -------- | 67e41f4b71Sopenharmony_ci| PID | 进程ID。 | 68e41f4b71Sopenharmony_ci| PPID | 父进程ID。 | 69e41f4b71Sopenharmony_ci| PGID | 进程组ID。 | 70e41f4b71Sopenharmony_ci| UID | 用户ID。 | 71e41f4b71Sopenharmony_ci| Status | 任务当前的状态。 | 72e41f4b71Sopenharmony_ci| CPUUSE10s | 10秒内CPU使用率。 | 73e41f4b71Sopenharmony_ci| PName | 进程名。 | 74e41f4b71Sopenharmony_ci| TID | 任务ID。 | 75e41f4b71Sopenharmony_ci| StackSize | 任务堆栈的大小。 | 76e41f4b71Sopenharmony_ci| WaterLine | 栈使用的峰值。 | 77e41f4b71Sopenharmony_ci| MEMUSE | 内存使用量。 | 78e41f4b71Sopenharmony_ci| TaskName | 任务名。 | 79