1 Star 0 Fork 5.3K

ztczll / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sem.md 5.42 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

sem

Command Function

This command is used to query information about kernel semaphores.

Syntax

sem [ID_ / fulldata_]

Parameter Description

Table 1 Parameters

Parameter

Description

Value Range

ID

Indicates the semaphore ID.

[0, 0xFFFFFFFF]

fulldata

Queries information about all the semaphores in use. The information to be printed includes SemID, Count, OriginalCount, Creater(TaskEntry), and LastAccessTime.

N/A

Usage

  • If the parameters are not specified, this command displays the number of used semaphores and the total number of semaphores.

  • If the ID parameter is specified, semaphores of the specified ID are displayed.

  • The fulldata parameter depends on LOSCFG_DEBUG_SEMAPHORE. Before specifying the fulldata parameter, enable the Enable Semaphore Debugging configuration item using menuconfig.

    Debug ---> Enable a Debug Version ---> Enable Debug LiteOS Kernel Resource ---> Enable Semaphore Debugging

Example

Example 1: Enter sem fulldata.

Output

Figure 1 Querying information about all semaphores in use

Table 2 Output description

Parameter

Description

SemID

Indicates the semaphore ID.

Count

Indicates the number of used semaphores.

NOTE:

  • The ID value can be in decimal or hexadecimal format.
  • When the ID value is within the range of [0, 1023], semaphore information of the specified ID is displayed. If the semaphore ID is not used, a message is displayed to inform you of this case. For other values, a message is displayed indicating that the input parameter is incorrect.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ztczll/docs.git
git@gitee.com:ztczll/docs.git
ztczll
docs
docs
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891