vxworks下如何查看任务的内存使用

lhchn 2010-10-27 12:32:33
rt
请问命令是什么?谢谢
...全文
1735 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
dogskin 2010-10-27
  • 打赏
  • 举报
回复
checkStack
井中月_QCJ 2010-10-27
  • 打赏
  • 举报
回复
不一样吧!看注释。
checkStack()
checkStack() – print a summary of each task’s stack usage
void checkStack
(
int taskNameOrId /* task name or task ID; 0 = summarize all */
)
This command displays a summary of stack usage for a specified task, or for all tasks if no
argument is given. The summary includes the total stack size (SIZE), the current number
of stack bytes used (CUR), the maximum number of stack bytes used (HIGH), and the
number of bytes never used at the top of the stack (MARGIN = SIZE - HIGH). For
example:
-> checkStack tShell
NAME ENTRY TID SIZE CUR HIGH MARGIN
------------ ------------ -------- ----- ----- ----- ------
tShell _shell 23e1c78 9208 832 3632 5576
The maximum stack usage is determined by scanning down from the top of the stack for
the first byte whose value is not 0xee. In VxWorks, when a task is spawned, all bytes of a
task’s stack are initialized to 0xee.
DEFICIENCIES It is possible for a task to write beyond the end of its stack, but not write into the last part
of its stack. This will not be detected by checkStack().
RETURNS N/A
SEE ALSO usrLib, taskSpawn(), VxWorks Programmer’s Guide: Target Shell, windsh, Tornado User’s
Guide: Shell
lhchn 2010-10-27
  • 打赏
  • 举报
回复
请问是stack: base 0x20efcac end 0x20ed59c size 9532 high 1452 margin 8080里面的size吗?
这个获取的和checkStack获取的信息是一样的吧?
井中月_QCJ 2010-10-27
  • 打赏
  • 举报
回复
taskShow tShell, 1


taskShow()


The following example shows the TCB contents for the shell task:

taskShow() – display task information from TCBs
STATUS taskShow
(
int tid, /* task ID */
int level /* 0 = summary, 1 = details, 2 = all tasks */
)
This routine displays the contents of a task control block (TCB) for a specified task. If leve
is 1, it also displays task options and registers. If level is 2, it displays all tasks.
The TCB display contains the following fields:
Field Meaning
NAME Task name
ENTRY Symbol name or address where task began execution
TID Task ID
PRI Priority
STATUS Task status, as formatted by taskStatusString()
PC Program counter

NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY
---------- --------- -------- --- --------- -------- -------- ------ -----
tShell _shell 20efcac 1 READY 201dc90 20ef980 0 0
stack: base 0x20efcac end 0x20ed59c size 9532 high 1452 margin 8080
options: 0x1e
VX_UNBREAKABLE VX_DEALLOC_STACK VX_FP_TASK VX_STDIO
D0 = 0 D4 = 0 A0 = 0 A4 = 0
D1 = 0 D5 = 0 A1 = 0 A5 = 203a084 SR = 3000
D2 = 0 D6 = 0 A2 = 0 A6 = 20ef9a0 PC = 2038614
D3 = 0 D7 = 0 A3 = 0 A7 = 20ef980

2,180

社区成员

发帖
与我相关
我的任务
社区描述
xworks是美国 Wind River System 公司( 以下简称风河公司 ,即 WRS 公司)推出的一个实时操作系统。
社区管理员
  • VxWorks开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧