• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# cpup<a name="EN-US_TOPIC_0000001133846470"></a>
2
3-   [Command Function](#section1842161614217)
4-   [Syntax](#section5629527427)
5-   [Parameters](#section133651361023)
6-   [Usage](#section156611948521)
7-   [Example](#section68501605319)
8-   [Output](#section19871522144219)
9
10## Command Function<a name="section1842161614217"></a>
11
12This command is used to query the CPU usage \(CPU percent\) of the system.
13
14## Syntax<a name="section5629527427"></a>
15
16cpup \[_mode_\] \[_taskID_\]
17
18## Parameters<a name="section133651361023"></a>
19
20**Table  1**  Parameter description
21
22<a name="table3774mcpsimp"></a>
23<table><thead align="left"><tr id="row3780mcpsimp"><th class="cellrowborder" valign="top" width="16%" id="mcps1.2.4.1.1"><p id="p3782mcpsimp"><a name="p3782mcpsimp"></a><a name="p3782mcpsimp"></a>Parameter</p>
24</th>
25<th class="cellrowborder" valign="top" width="56.99999999999999%" id="mcps1.2.4.1.2"><p id="p3784mcpsimp"><a name="p3784mcpsimp"></a><a name="p3784mcpsimp"></a>Description</p>
26</th>
27<th class="cellrowborder" valign="top" width="27%" id="mcps1.2.4.1.3"><p id="p3786mcpsimp"><a name="p3786mcpsimp"></a><a name="p3786mcpsimp"></a>Value Range</p>
28</th>
29</tr>
30</thead>
31<tbody><tr id="row3787mcpsimp"><td class="cellrowborder" valign="top" width="16%" headers="mcps1.2.4.1.1 "><p id="p3789mcpsimp"><a name="p3789mcpsimp"></a><a name="p3789mcpsimp"></a>mode</p>
32</td>
33<td class="cellrowborder" valign="top" width="56.99999999999999%" headers="mcps1.2.4.1.2 "><a name="ul1530071303413"></a><a name="ul1530071303413"></a><ul id="ul1530071303413"><li>Default: displays the CPU usage of the system within the last 10 seconds.</li><li><strong id="b13709113084810"><a name="b13709113084810"></a><a name="b13709113084810"></a>0</strong>: displays the CPU usage within the last 10 seconds.</li><li><strong id="b10788133319480"><a name="b10788133319480"></a><a name="b10788133319480"></a>1</strong>: displays the CPU usage of the system within the last 1 second.</li><li>Other value: displays the total CPU usage since the system is started.</li></ul>
34</td>
35<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p3794mcpsimp"><a name="p3794mcpsimp"></a><a name="p3794mcpsimp"></a>[0,0xFFFFFFFF]</p>
36</td>
37</tr>
38<tr id="row3795mcpsimp"><td class="cellrowborder" valign="top" width="16%" headers="mcps1.2.4.1.1 "><p id="p3797mcpsimp"><a name="p3797mcpsimp"></a><a name="p3797mcpsimp"></a>taskID</p>
39</td>
40<td class="cellrowborder" valign="top" width="56.99999999999999%" headers="mcps1.2.4.1.2 "><p id="p3799mcpsimp"><a name="p3799mcpsimp"></a><a name="p3799mcpsimp"></a>Task ID</p>
41</td>
42<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p3802mcpsimp"><a name="p3802mcpsimp"></a><a name="p3802mcpsimp"></a>[0,0xFFFFFFFF]</p>
43</td>
44</tr>
45</tbody>
46</table>
47
48## Usage<a name="section156611948521"></a>
49
50-   If the parameters are not specified, the CPU usage within the last 10 seconds is displayed.
51-   If only the  **mode**  parameter is specified, the CPU usage within the specified period is displayed.
52-   If both the  **mode**  and  **taskID**  parameters are specified, the CPU usage of the specified task within the given period is displayed.
53
54## Example<a name="section68501605319"></a>
55
56Run  **cpup 1 5**.
57
58## Output<a name="section19871522144219"></a>
59
60**Figure  1**  CPU usage<a name="fig1251224812504"></a>
61![](figure/cpu-usage.png "cpu-usage")
62
63