From 7d9418a4222137094a88e61ad485a173a2f8caa6 Mon Sep 17 00:00:00 2001 From: Kiita Date: Thu, 16 Dec 2021 20:18:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BC=98=E5=8C=96toybox=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E6=89=8B=E5=86=8C=E4=BD=BF=E7=94=A8=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yansira Change-Id: Iff37833a8a8064ccdeead9dcd7703c2092816fb9 --- .../kernel-small-debug-shell-cmd-dmesg.md | 6 +- .../kernel-small-debug-shell-cmd-hwi.md | 6 +- .../kernel-small-debug-shell-cmd-oom.md | 30 ++++--- .../kernel-small-debug-shell-cmd-sem.md | 82 +++++++++++++++++-- .../kernel-small-debug-shell-cmd-watch.md | 5 +- .../kernel-small-debug-shell-file-chmod.md | 3 +- .../kernel-small-debug-shell-file-du.md | 3 +- .../kernel-small-debug-shell-file-ls.md | 8 +- .../kernel-small-debug-shell-file-mkdir.md | 5 +- ...kernel-small-debug-shell-file-partition.md | 5 +- .../kernel-small-debug-shell-file-umount.md | 11 +-- .../kernel-small-debug-shell-net-ifconfig.md | 6 +- .../kernel-small-debug-shell-net-ipdebug.md | 6 +- .../kernel-small-debug-shell-net-netstat.md | 26 ++---- 14 files changed, 131 insertions(+), 71 deletions(-) diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-dmesg.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-dmesg.md index 285837cbed1..c802fa02490 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-dmesg.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-dmesg.md @@ -9,7 +9,7 @@ ## 命令功能 -dmesg命令用于控制内核dmesg缓存区。 +dmesg命令用于显示系统启动过程和运行过程中的信息。 ## 命令格式 @@ -29,6 +29,7 @@ dmesg命令用于控制内核dmesg缓存区。 **表 1** 参数说明 + -

参数

参数说明

@@ -81,14 +82,13 @@ dmesg命令用于控制内核dmesg缓存区。

> fileA

将缓存区内容写入文件。

+

将缓存区内容重定向写入文件。

N/A

- ## 使用指南 - 该命令依赖于LOSCFG\_SHELL\_DMESG,使用时通过menuconfig在配置项中开启"Enable Shell dmesg": diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-hwi.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-hwi.md index d80b73dd650..7685b4607f6 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-hwi.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-hwi.md @@ -22,7 +22,7 @@ hwi ## 使用指南 - 输入hwi即显示当前中断号、中断次数及注册中断名称。 -- 若开关LOSCFG\_CPUP\_INCLUDE\_IRQ打开,则还会显示各个中断的处理时间(cycles)、CPU占用率以及中断类型。 +- 若开关LOSCFG\_CPUP\_INCLUDE\_IRQ打开,则还会显示各个中断的处理时间ATime、CPU占用率以及中断类型。 ## 使用实例 @@ -131,9 +131,9 @@ OHOS # hwi

注册中断名称。

-

CYCLECOST

+

ATime

-

中断的处理时间(cycles)。

+

中断的处理时间。

CPUUSE

diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-oom.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-oom.md index dc61c380e00..aa9e5580a4c 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-oom.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-oom.md @@ -1,16 +1,17 @@ # oom -- [命令功能](#section366714216619) -- [命令格式](#section8833164614615) -- [参数说明](#section12809111019453) -- [使用指南](#section15935131220717) -- [输出说明](#section12742311179) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 查看和设置低内存阈值以及pagecache内存回收阈值。 -## 命令格式 +## 命令格式 - oom @@ -23,7 +24,7 @@ - oom -h | --help -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -67,16 +68,23 @@ -## 使用指南 +## 使用指南 - 参数缺省时,显示oom功能当前配置信息。 >![](../public_sys-resources/icon-note.gif) **说明:** >当系统内存不足时,会打印出内存不足的提示信息。 + +## 使用实例 + +举例: + +- oom + - oom -i 100 -## 输出说明 +## 输出说明 **示例 1** oom缺省打印配置信息 @@ -160,7 +168,7 @@ OHOS:/$ oom -i 100

[oom] candidate victim process init pid: 1, actual phy mem byte: 82602

-

打印当前各个进程的内存使用情况,init进程实际使用82602byte,其中共享内存按照比例算的。

+

打印当前各个进程的内存使用情况,init进程实际占用物理内存82602byte。

[oom] candidate victim process UserProcess12 pid: 12, actual phy mem byte: 25951558

diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-sem.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-sem.md index 3b8d57161af..7cdc67935cb 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-sem.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-sem.md @@ -30,9 +30,9 @@ sem \[_ID__ / fulldata_\]

ID

-

信号ID号。

+

信号量ID。

-

[0, 0xFFFFFFFF]

+

[0, 1023]或[0x0, 0x3FF]

fulldata

@@ -56,11 +56,12 @@ sem \[_ID__ / fulldata_\] ## 使用实例 -举例:输入 sem fulldata +- 输入sem +- 配置LOSCFG\_DEBUG\_SEMAPHORE标志,输入 sem fulldata ## 输出说明 -**示例** 查询所有在用的信号量信息 +**示例1** 查询所有在用的信号量信息 ```shell OHOS # sem @@ -118,6 +119,75 @@ OHOS # sem >![](../public_sys-resources/icon-note.gif) **说明:** ->● sem命令的ID参数输入形式以十进制形式表示或十六进制形式表示皆可。 ->● sem命令的ID参数在\[0, 1023\]范围内时,返回对应ID的信号量的状态(如果对应ID的信号量未被使用则进行提示);其他取值时返回参数错误的提示。 +>sem命令的ID参数在\[0, 1023\](十六进制[0x0, 0x3FF])范围内时,返回对应ID的信号量的状态(如果对应ID的信号量未被使用则进行提示);若此范围外的其他取值时,则返回参数错误的提示。 +**示例2** 查询所有在用的信号量信息 + +```shell +OHOS # sem fulldata +Used Semaphore List: + + SemID Count OriginalCount Creater(TaskEntry) LastAccessTime + ------ ------ ------------- ------------------ -------------- + 0xb 0x0 0x0 0x404978fc 0xa1 + 0xc 0x0 0x0 0x404978fc 0xa1 + 0xd 0x0 0x0 0x404978fc 0x12c + 0x10 0x0 0x0 0x404978fc 0x195 + 0xf 0x0 0x0 0x404978fc 0x195 + 0x11 0x0 0x0 0x4041a998 0x1d5 + 0x15 0x0 0x0 0x404978fc 0x273 + 0x14 0x0 0x0 0x404978fc 0x273 + 0x18 0x0 0x0 0x404978fc 0x352 + 0x17 0x0 0x0 0x404978fc 0x352 + 0x16 0x0 0x0 0x404978fc 0x352 + 0x1d 0x1 0x1 0x404978fc 0x385 + 0x1e 0x1 0x1 0x404978fc 0x388 + 0x1f 0x1 0x1 0x404978fc 0x38d + 0x20 0x1 0x1 0x404978fc 0x38f + 0x21 0x1 0x1 0x404978fc 0x392 + 0x3d 0x1 0x1 0x404978fc 0x395 + 0x3b 0x1 0x1 0x404978fc 0x395 + 0x3c 0x1 0x1 0x404978fc 0x395 + 0x39 0x1 0x1 0x404978fc 0x395 + 0x3a 0x1 0x1 0x404978fc 0x395 + 0x33 0x1 0x1 0x404978fc 0x395 + 0x35 0x1 0x1 0x404978fc 0x395 + 0x34 0x1 0x1 0x404978fc 0x395 + 0x38 0x1 0x1 0x404978fc 0x395 +``` + +**表3** 输出说明 + + + + + + + + + + + + + + + + + + + + + +

输出

+

说明

+

SemID

+

信号量ID。

+

Count

+

信号量使用数。

+

OriginalCount

+

信号量原始计数。

+

Creater

+

信号量的创建线程的入口函数地址。

+

LastAccessTime

+

上次访问时间。

+
diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-watch.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-watch.md index 7a7bb9c4560..662e669f20b 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-watch.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-watch.md @@ -91,7 +91,7 @@ watch运行过程中可以执行**watch --over**结束本次watch命令。 ## 输出说明 -**示例** watch task 结果 +**示例** 每隔2秒运行一次task命令,一共运行6次 ```shell OHOS # watch -n 2 -c 6 task @@ -135,6 +135,3 @@ OHOS # 18 2 0x3 -1 Pending 0x2710 0x3ac 0.0 0 GPIO_IRQ_TSK_0_4 ``` ->![](../public_sys-resources/icon-note.gif) **说明:** ->示例中,总共有6次task命令打印,每次间隔2秒,示例1为最后一次打印详情。 - diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chmod.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chmod.md index 8dec87d6b6e..32cb5c66f3e 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chmod.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chmod.md @@ -30,7 +30,7 @@ chmod \[_mode_\] \[_filename_\]

mode

-

文件或文件夹权限,用8进制表示对应User、Group、及Other(拥有者、群组、其他组)的权限。

+

文件或文件夹权限,用8进制表示对应User、Group、及Others(拥有者、群组、其他组)的权限。

[0,777]

@@ -66,4 +66,3 @@ OHOS:/dev$ chmod 777 hello-harmony.txt OHOS:/dev$ ll hello-harmony.txt -rwxrwxrwx 0 0 0 0 1970-01-01 00:00 hello-harmony.txt ``` - diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-du.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-du.md index 1ba75a22e23..4d78408f9e8 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-du.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-du.md @@ -44,7 +44,7 @@ du \[_-kKmh_\] \[_file..._\]

-K

-

显示占用的块,每块512bytes(posix)。

+

显示占用的块,每块512bytes(posix标准)。

N/A

@@ -73,6 +73,7 @@ du \[_-kKmh_\] \[_file..._\] + ## 使用指南 - 不支持统计目录的大小,只支持统计文件的大小。 diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-ls.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-ls.md index 5dee2d60e82..04559e7769b 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-ls.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-ls.md @@ -53,7 +53,7 @@ ls \[_-ACHLSZacdfhiklmnopqrstux1_\] \[_--color_\[_=auto_\]\] \[_directory..._\]

-c

-

使用ctime作为文件的时间戳。"ls -lc"

+

使用ctime作为文件的时间戳,必须和-l参数一块使用。

N/A

@@ -276,9 +276,9 @@ ls \[_-ACHLSZacdfhiklmnopqrstux1_\] \[_--color_\[_=auto_\]\] \[_directory..._\] ## 使用指南 - ls命令显示当前目录的内容。 -- ll可以显示文件的大小。 -- proc下ll无法统计文件大小,显示为0。 -- dev、proc、无法统计文件时间信息。 +- ll命令可以显示文件的大小。 +- /proc目录下ll命令无法统计文件大小,显示为0。 +- /dev目录和/proc目录无法统计文件时间信息。 > ![](../public_sys-resources/icon-notice.gif) **须知:** > diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md index 1b8df8029da..163f32d0bf1 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md @@ -65,12 +65,9 @@ mkdir \[_-vp_\] \[_-m mode_\] \[_dirname..._\] - ## 使用指南 -- mkdir后加所需要创建的目录名会在当前目录下创建目录。 -- mkdir后加路径,再加上需要创建的目录名,即在指定目录下创建目录。 -- mkdir后加参数,提供目录权限定制,目录逐级创建等功能。 +无。 > ![](../public_sys-resources/icon-notice.gif) **须知:** > diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-partition.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-partition.md index 0717a670b86..4aa4e71036d 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-partition.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-partition.md @@ -30,21 +30,20 @@ partition \[_nand / spinor_\]

nand

-

显示nand flash分区信息。

+

显示NAND Flash分区信息。

N/A

spinor

-

显示spinor flash分区信息。

+

显示SPI NOR Flash分区信息。

N/A

- ## 使用指南 - partition命令用来查看flash分区信息。 diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-umount.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-umount.md index 46beb6e133a..11e05b0f8cc 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-umount.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-umount.md @@ -45,14 +45,14 @@ umount \[_-a \[-t TYPE\]_\] \[_dir_\]

-t

-

同-a选项一起使用,限制-a,只卸载-t所指定的文件系统类型。

+

同-a选项一起使用,限制-a的卸载范围,只卸载-t所指定的文件系统类型的挂载目录。

N/A

dir

-

需要卸载文件系统对应的目录。

+

需要卸载的文件系统对应的目录。

系统已挂载的文件系统的目录。

@@ -60,6 +60,7 @@ umount \[_-a \[-t TYPE\]_\] \[_dir_\] + ## 使用指南 umount后加上需要卸载的指定文件系统的目录,即将指定文件系统卸载。 @@ -69,7 +70,7 @@ umount后加上需要卸载的指定文件系统的目录,即将指定文件 举例: - umount ./nfs -- umount -a -t nfs ./nfs +- umount -a -t nfs ## 输出说明 @@ -82,9 +83,9 @@ OHOS:/$ umount ./nfs/ umount ok ``` -**示例 2** umount指定文件类型 +**示例 2** 卸载所有已挂载的nfs类型的目录 ```shell -OHOS:/$ umount -a -t nfs ./nfs/ +OHOS:/$ umount -a -t nfs umount ok ``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md index 75aa986e55d..317d10c145e 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md @@ -28,7 +28,6 @@ option: - \[_up|down_\] - ## 参数说明 **表 1** 参数说明 @@ -102,14 +101,14 @@ option:

add

-

设置ipv6的地址,比如2001:a:b:c:d:e:f:d,需指定网卡名和inet6。

+

设置ipv6的地址,比如2001:a:b:c:d:e:f:d,需指定网卡名和"inet6"选项。

N/A

del

-

删除ipv6的地址,需指定网卡名和inet6。

+

删除ipv6的地址,需指定网卡名和加"inet6"选项,详见示例。

N/A

@@ -317,4 +316,3 @@ lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1 eth0 ip:192.168.1.10 netmask:255.255.255.0 gateway:192.168.1.1 HWaddr 66:2f:e5:bd:24:e6 MTU:1500 Running Default Link UP ``` - diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ipdebug.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ipdebug.md index e34e37d124e..f6e793e570b 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ipdebug.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ipdebug.md @@ -2,7 +2,7 @@ - [命令功能](#section10191115553720) - [命令格式](#section124061758123713) -- [使用指南](#section171837113810) +- [使用示例](#section171837113810) - [输出说明](#section561416467104) ## 命令功能 @@ -11,9 +11,9 @@ ipdebug是控制台命令,是一个调试ipv6信息非常有用的工具,它 ## 命令格式 -ipdebug +无。 -## 使用指南 +## 使用示例 举例:输入命令ipdebug。 diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-netstat.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-netstat.md index 10806a95104..c97a3db9627 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-netstat.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-netstat.md @@ -1,33 +1,23 @@ # netstat -- [命令功能](#section13469162113816) -- [命令格式](#section795712373812) -- [参数说明](#section17629431193817) -- [使用指南](#section5277153519380) -- [使用实例](#section108141437163820) -- [输出说明](#section1357015107117) +- [命令功能](#section01) +- [命令格式](#section02) +- [使用实例](#section03) +- [输出说明](#section04) -## 命令功能 +## 命令功能 netstat是控制台命令,是一个监测TCP/IP网络的非常有用的工具,它可以显示实际的网络连接以及每一个网络接口设备的状态信息。netstat用于显示与TCP、UDP协议相关的统计数据,一般用于检验本设备(单板)各端口的网络连接情况。 -## 命令格式 - -netstat - -## 参数说明 - -无。 - -## 使用指南 +## 命令格式 无。 -## 使用实例 +## 使用实例 举例:输入netstat -## 输出说明 +## 输出说明 **示例** netstat 打印信息 -- Gitee