task_struct中的start_time是相对什么时候
task_struct中的start_time是相对什么时候来说的呢,我用的是2.6的内核,里面start_time是一个结构体,我曾经打印过进程的start_time->tv_sec,获得的是很小的数字,可以肯定的是不是从1970年1月1号开始的时间滴答数。
在task_struct里的start_time是: struct timespec start_time;
在<linux/time.h>里是这样定义的:
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
我用Jiffies/HZ去减start_time->tv_sec想获得一个进程运行的总时间,但是返回的却是个负数,有一段时间之后才能变为正的。
<SCRIPT type=text/javascript><!-- google_ad_client = "pub-3152530285624674"; google_ad_width = 468; google_ad_height = 15; google_ad_format = "468x15_0ads_al"; google_ad_channel =""; //--></SCRIPT><SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript> </SCRIPT><SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript> </SCRIPT>