标签:
vxworks系统分析工具spywindviewit |
A. 关于辅助时钟
Spy需要一个独立于系统时钟的辅助时钟来为其任务统计提供计时。该辅助时钟的中断频率不能低于100ticks/sec。对于PowerPC860系统而言,VxWorks本身提供了辅助时钟驱动程序的源代码:
[Tornado]\target\src\drv\timer\ppc860Timer.c,该源码使用CPM
Timer2作为时钟源。如果在系统设计中CPM
Timer2并没有其它用途,那么对于辅助时钟驱动程序可不加修改而直接引用。
B. 配置VxWorks
使用Tornado的图形化工具配置VxWorks。将以下两项包含进去:
development tool components --> spy hardware --> peripherals
--> clocks --> AUX clock
如果通过手工修改配置文件,则需增加以下宏定义,并生成新的project:
#define INCLUDE_SPY #define INCLUDE_AUX_CLK
在调试阶段,为了使调试工具(如Shell)能找到Spy,还需要修改symbol表的配置,加入以下项目:
development tool components --> symbol table components -->
symbol table initialization components --> select symbol table
initialization --> built-in symbol table
C. Spy的使用 可试验在Shell中直接调用Spy工具。使用方法有两种:
a. spy(freq, ticksPerSec)
该函数会启动一个task:spyTask()来执行统计和报告,每freq秒报告一次。ticksPerSec是辅助时钟每秒中断次数。
b. spyClkStart(intsPerSec) 和 spyReport()
先调用spyClkStart来启动辅助时钟,intsPerSec是辅助时钟每秒中断次数。然后可不定时地调用spyReport观看
统计结果,包括自上次调用spyClkStart以来的统计数据和自上次调用spyReport以来的统计数据。
spy将统计结果输出到target system console或target
shell。也可以在host端的调试工具Shell和 Virtual Console
Window里观察其输出。统计结果中包含了各Task、中断服务例程、Kernel和Idle所分别占用的时间百分比和ticks数。以上
详见Tornado Online Manuals。
WindView使用指南
A. 配置VxWorks 1. include "development tool components ->
Windview components"; 2. include "development tool components ->
WDB agent components -> WDB agent services -> WDB target
server file system"; 若要使View
Graph的Timeline刻度为时间坐标(seconds),而不是缺省的 sequence
numbers坐标,还需如下配置(需BSP和硬件支持): 3. include "hardware
-> peripherals -> clocks -> high resolution timestamping";
4. change "development tool components -> Windview components
-> select timestamping" from "sequential timestamping" to
"system-defined timestamping";
B. 配置Target Server 1. Tools -> Target Server ->
Configure... 2. 在对话框Configure Target Servers中选择TSFS: Target
Server Properties -> Target Server File System 3. 配置如下:
check "Enable File System"; enter the root path(用于存放Log File);
select "Read / Write" option(若不使用WindView,TSFS的访问权限
应设为"Read Only");
C. 配置WindView
D. 使用WindView 1. Tools -> WindView -> Launch... 2.
在对话框Launch WindView中选择Target: TargetServerName@Hostname 3.
对话框WindView Control TargetServerName@Hostname: 按钮GO:
开始采集数据; 按钮STOP: 停止采集数据;
按钮UPLOAD:上传所采集的数据。 4. 另两种使用WindView的方法: a.
通过Triggering控制WindView的数据采集; b. 在WindSh或Source
Code中调用WindView API: wvOn() and wvOff()。
后一篇:80386的寄存器