why?why?
脚本:
#!/usr/sbin/dtrace -s
unsigned long long x;
unsigned long long y;
dtrace:::BEGIN
{
cpustart[cpu] = 0;
x = 0;
y = 0;
}
/* Flag this thread as idle */
sysinfo:unix:idle_enter:idlethread
{
idle[cpu] = 1;
cpustart[cpu] = timestamp;
}
/* Save the elapsed time of a thread */
sched::n-cpu
/idle[cpu]/
{
/* save elapsed */
this->elapsed = (timestamp - cpustart[cpu]);
x = x + this->elapsed;
y=100 - (x *100 )/ 24000000000;
idle[cpu] = 0;
}
/* Print report */
profile:::tick-1sec
{
printf("%Y,\n", walltimestamp);
printf("%16llu\n",y);
x = 0;
}
profile:::tick-20sec
{
exit(0);
}
在一个64位,24个cpu的服务器上运行,得到如下结果:
root@E25K-2-DB # dtrace -qs used.d
2008 Aug 29 16:09:39,
71
2008 Aug 29 16:09:40,
8
2008 Aug 29 16:09:41,
18446744073709551589
2008 Aug 29 16:09:42,
18446744073709551592
2008 Aug 29 16:09:43,
18446744073709551567
2008 Aug 29 16:09:44,
18446744073709551563
2008 Aug 29 16:09:45,
18446744073709551593
2008 Aug 29 16:09:46,
18446744073709551545
2008 Aug 29 16:09:47,
18446744073709551530
2008 Aug 29 16:09:48,
18446744073709551565
2008 Aug 29 16:09:49,
18446744073709551483
2008 Aug 29 16:09:50,
18446744073709551567
2008 Aug 29 16:09:51,
18446744073709551516
2008 Aug 29 16:09:52,
18446744073709551525
2008 Aug 29 16:09:53,
18446744073709551555
2008 Aug 29 16:09:54,
18446744073709551529
2008 Aug 29 16:09:55,
18446744073709551485
2008 Aug 29 16:09:56,
18446744073709551576
2008 Aug 29 16:09:57,
18446744073709551482
2008 Aug 29 16:09:58,
18446744073709551542
为什么在第3秒后的输出,造成这种结果呢?
相关推荐
Why Functional Programming?
经典文章:为什么需要functional programming语言。
why_bump_android_minsdk, 你为什么要打你的Android 应用 minsdk?.zip
why_bump_android_minsdk, 你为什么要打你的Android 应用 minsdk? 你应该总是为 Android 应用的minSdk版本 bumping 。 新的API级别( Android中的操作系统版本) 带有更多的修复和特性,你可以使用。 但如果你需要这样的话,这个文件应该有帮助。你得到的内容:功能:Andr
Why!?
Why!?
Why is learning and memory dysfunction in Type 2 diabetes limited to older adults?
Why is learning and memory dysfunction in Type 2 diabetes limited to older adults? REVIEW ARTICLE Why is learning and memory dysfunction in Type 2 diabetes limited to older adults? Christopher M. Ryan* Michelle Geckle Western Psychiatric Institute & Clinic, Department of Psychiatry, University of Pittsburgh School of Medicine, Pittsburgh, PA, USA *Correspondence to: Christopher M. Ryan, Western Psychiatric Institute & Clinic, 3811 O'Hara Street, Pittsburgh, PA 15213, USA. E-mail: ryancm@m
2013春人教版七年级下英语unit_5_Why_do_you_like_pandas_?Section_A
2013春人教版七年级下英语unit_5_Why_do_you_like_pandas_?Section_A


其他技术讨论专区

