Probevue - AIX 6 新的程序员工具
2008-09-06 08:21:57 来源:WEB开发网2) 系统调用入口/出口探针(或 syscall)
语法: @@syscall:PID:SystemCallName:[entry/exit]
示例:读取系统调用所有进程的出口的探针
@@syscall:*:read:exit
3) 间隔探针(以指定的时间间隔触发)
语法: @@interval:*:clock:milliseconds
示例:每 500 毫秒(墙上时钟时间)触发一次的探针
@@interval:*:clock:500
在将来的版本中将包含更多的 Tuple。
第一个示例 probevue 脚本
以下是一个非常简单的脚本,此脚本实际上工作并执行一些有意义的工作。#!/usr/bin/probevue <-- autorun
@@BEGIN
{
int count, total; <-- declare the variables (later probevue
versions will not need this)
}
@@syscall:*:read:entry <-- System call: any process ID, read() function,
at start of the function
{
count++; <-- increment the counters
total++;
}
@@interval:*:clock:1000 <-- once per second (1000 ticks per second)
{
printf("Number of reads = %dn", count);
count=0;
}
@@END <-- After you type Control-C
{
printf("nTotal reads = %dn",total);
}
以下是一些示例输出:# ./count.e
Number of reads = 0
Number of reads = 1
Number of reads = 0
Number of reads = 0
Number of reads = 2
Number of reads = 0
Number of reads = 5
Number of reads = 269
Number of reads = 0
Number of reads = 0
^C
Total reads = 277
更多精彩
赞助商链接