For details, see [Description of begetctl Commands](#table14737791480).
For details about begetctl, see [begetctl Commands](#table14737791480).
- bootchart plug-in
- bootchart plug-in
The bootchart plug-in is an open source tool used to evaluate system performance during Linux startup. It automatically collects information such as the CPU usage, disk throughput, and process status, and displays the evaluation result in graphics to facilitate system startup optimization.
The bootchart plug-in is an open source tool used to evaluate system performance during Linux startup. It automatically collects information such as the CPU usage, disk throughput, and process status, and displays the evaluation result in graphics to facilitate system startup optimization.
### Constraints
### Constraints
bootchart is available only for the standard system, and begetctl is available for both the small system and the standard system.
bootchart is available only for the standard system, and begetctl is available for both the small system and the standard system.
## How to Develop
## Development Guidelines
### Parameters
### Parameters
**Table 1** Description of begetctl commands
**Table 1** Description of begetctl commands<aname="table14737791480"></a>
| Command| Format and Example| Description|
| Command| Format and Example| Description|
| :---------- | :---------- |:--------|
| :---------- | :---------- |:--------|
| init group test [stage] | init group test | For details about **stage**, see **ServiceStatus**.|
| init group test [stage] | init group test | For details about **stage**, see **ServiceStatus**.|
| param ls [-r] [name] | Displays system parameters.<br>Example:<br>begetctl param ls persist.sys.usb | N/A|
| param ls [-r] [name] | Displays system parameters.<br>Example:<br>begetctl param ls persist.sys.usb | N/A|
| param get [name] | Obtains system parameter information.<br>Example:<br>begetctl param get<br>param get| N/A|
| param get [name] | Obtains system parameter information.<br>Example:<br>begetctl param get or param get| N/A|
| param set name value| Sets system parameters.<br>Example:<br>begetctl param set ohos.servicectrl.display 1<br>param set ohos.servicectrl.display 1| N/A|
| param set name value| Sets system parameters.<br>Example:<br>begetctl param set ohos.servicectrl.display 1 or param set ohos.servicectrl.display 1| N/A|
| param wait name [value] [timeout] | Waits for system parameters.<br>Example:<br>begetctl param wait persist.sys.usb.config hdc<br>param wait persist.sys.usb.config hdc| The default value of **timeout** is **30**.|
| param wait name [value] [timeout] | Waits for system parameters.<br>Example:<br>begetctl param wait persist.sys.usb.config hdc or param wait persist.sys.usb.config hdc| The default value of **timeout** is **30**.|
| param shell <i>[name]</i> | Enters the parameter shell.<br>Example:<br>begetctl param shell or param shell| N/A|
| timer_stop servicename | Stops the service timer.<br>Example:<br>begetctl timer_stop appspawn | The value of **servicename** can contain a maximum of 96 characters.|
| timer_stop servicename | Stops the service timer.<br>Example:<br>begetctl timer_stop appspawn | The value of **servicename** can contain a maximum of 96 characters.|
| timer_start servicename timeout | Starts the service timer.<br>Example:<br>begetctl timer_start appspawn | The value of **servicename** can contain a maximum of 96 characters. The default value of **timeout** is **10**.|
| timer_start servicename timeout | Starts the service timer.<br>Example:<br>begetctl timer_start appspawn | The value of **servicename** can contain a maximum of 96 characters. The default value of **timeout** is **10**.|
| service_control stop servicename | Stops a service.<br>Example:<br>begetctl service_control stop appspawn or service_control stop appspawn | N/A|
| misc_daemon --write_logo xxx.rgb | Writes the startup logo.<br>Example:<br>begetctl misc_daemon --write_logo logo.rgb<br>misc_daemon --write_logo logo.rgb| The maximum size of an RGB file is **1024*2038**. Only Hi3516D V300 is supported.|
| misc_daemon --write_logo xxx.rgb | Writes the startup logo.<br>Example:<br>begetctl misc_daemon --write_logo logo.rgb or misc_daemon --write_logo logo.rgb| The maximum size of an RGB file is **1024*2038**. Only Hi3516D V300 is supported.|
| reboot | Restarts the system.<br>Example:<br>begetctl reboot<br>reboot|N/A|
| reboot | Restarts the system.<br>Example:<br>begetctl reboot or reboot|N/A|
| reboot shutdown | Shuts down the system.<br>Example:<br>begetctl reboot shutdown<br>reboot shutdown|N/A|
| reboot shutdown | Shuts down the system.<br>Example:<br>begetctl reboot shutdown or reboot shutdown|N/A|
| modulectl list | Views the list of dynamic plug-ins.<br>Example:<br>begetctl modulectl list | N/A|
## How to Develop
## How to Develop
### Available APIs
### Available APIs
**Table 1** Description of APIs
**Table 1** Description of APIs<aname="table14737791479"></a>
| API| Description|
| API| Description|
| ---------- | ---------- |
| ---------- | ---------- |
| void PluginExecCmdByName(const char *name, const char *cmdContent) | Starts the plug-in by name.|
| void PluginExecCmdByName(const char *name, const char *cmdContent) | Starts a plug-in by name.|
| void PluginExecCmdByCmdIndex(int index, const char *cmdContent) | Starts the plug-in by index.|
| void PluginExecCmdByCmdIndex(int index, const char *cmdContent) | Starts a plug-in by index.|
| int PluginExecCmd(const char *name, int argc, const char **argv) | Starts the plug-in by command.|
| int PluginExecCmd(const char *name, int argc, const char **argv) | Starts a plug-in by command.|
| int AddCmdExecutor(const char *cmdName, CmdExecutor execCmd) | Adds the plug-in installation command.|
| int AddCmdExecutor(const char *cmdName, CmdExecutor execCmd) | Adds the plug-in installation command.|
### How to Develop
### How to Develop
...
@@ -148,16 +150,16 @@ bootchart is available only for the standard system, and begetctl is available f
...
@@ -148,16 +150,16 @@ bootchart is available only for the standard system, and begetctl is available f
3. Restart the system.
3. Restart the system.
4. Run the **begetctl bootchart stop** command.
4. Run the **begetctl bootchart stop** command.
5. Run the **begetctl bootchart disable** command.
5. Run the **begetctl bootchart disable** command.
6. Export the following files from the **/data/bootchart** directory and save them to the **bootchart** folder:<br>
6. Export the following files from the **/data/bootchart** directory and save them to the **bootchart** folder:
header<br>
header<br>
proc_diskstats.log<br>
proc_diskstats.log<br>
proc_ps.log<br>
proc_ps.log<br>
proc_stat.log<br>
proc_stat.log<br>
7. Run the <strong>tar -zcvf bootchart.tgz *</strong> command to compress the <strong>bootchart.tgz</strong> file (available only for Linux) and copy the compressed file to the <strong>linux:bootchart-master</strong> directory.
7. Run the **tar -zcvf bootchart.tgz *** command to compress the **bootchart.tgz** file (available only for Linux) and copy the compressed file to the **linux:bootchart-master** directory.
8. Run the following command in the <strong>bootchart-master</strong> directory:
8. Run the following command in the **bootchart-master** directory:
```
```
python3 pybootchartgui.py -f pdf bootchart.tgz
python3 pybootchartgui.py -f pdf bootchart.tgz
```
```
Expected Result
Expected Result
<br>A **bootchart.pdf** file is generated in the **bootchart-master** directory.
A **bootchart.pdf** file is generated in the **bootchart-master** directory.