个人做电商网站icp免费下载app软件安装
个人做电商网站icp,免费下载app软件安装,聊城汽车网站建设,公司网站建设完成通知如果您的系统调用只应报告统计信息,则可以使用内核中已有的上下文切换计数代码.struct rusage {...long ru_nvcsw; /* voluntary context switches */long ru_nivcsw; /* involuntary context switches */};您可以通过运行来尝试#xff1a;$/usr/bin/time -v /bin/ls -R....V…如果您的系统调用只应报告统计信息,则可以使用内核中已有的上下文切换计数代码.struct rusage {...long ru_nvcsw; /* voluntary context switches */long ru_nivcsw; /* involuntary context switches */};您可以通过运行来尝试$/usr/bin/time -v /bin/ls -R....Voluntary context switches: 1669Involuntary context switches: 207其中“/ bin / ls -R”是任何程序.通过在内核源代码中搜索“struct rusage”,您可以在kernel / sys.c中找到更新rusage结构的this accumulate_thread_rusage.它从struct task_struct * t读取;字段t- nvcsw;和t- nivcsw;1477 static void accumulate_thread_rusage(struct task_struct *t,struct rusage *r)1478 {1479 r-ru_nvcsw t-nvcsw; // here1480 r-ru_nivcsw t-nivcsw;1481 r-ru_minflt t-min_flt;1482 r-ru_majflt t-maj_flt;然后你应该在kernel文件夹中搜索nvcsw和nivcsw来查找内核如何更新它们.4124 if (likely(prev ! next)) { // if we are switching between different tasks4125 sched_info_switch(prev,next);4126 perf_event_task_sched_out(prev,next);41274128 rq-nr_switches;4129 rq-curr next;4130 *switch_count; // increment nvcsw or nivcsw via pointer41314132 context_switch(rq,prev,next); /* unlocks the rq */指针switch_count是同一文件的line 4091或line 4111.
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/88937.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!