奖励网站代码,设计一套企业网站设计报价,电子硬件工程师培训机构,黄岩城乡住房和建设局网站能够当所述线程中的一个被切换上下文(即#xff0c;暂停)#xff0c;以检测可以找到#xff1f;至于你的问题是否可能 - 它认为这是可能的。至少SystemTap(https://sourceware.org/systemtap/)可以做到这一点。probe scheduler.ctxswitch{if (target_pid ! 0 next…能够当所述线程中的一个被切换上下文(即暂停)以检测可以找到至于你的问题是否可能 - 它认为这是可能的。至少SystemTap(https://sourceware.org/systemtap/)可以做到这一点。probe scheduler.ctxswitch{if (target_pid ! 0 next_pid ! target_pid prev_pid ! target_pid)nextif (target_name ! prev_task_name ! target_name next_task_name ! target_name)nextprintf(%-16s%5d %5d %5d:%5d:%s %5d:%5d:%s %-16s\n,prev_task_name,task_cpu(prev_task),gettimeofday_ns(),prev_pid,prev_priority,state_calc(prevtsk_state),next_pid,next_priority,state_calc(nexttsk_state),next_task_name)}据我知道的SystemTap编译STP文件把那么在Linux内核并显示您的信息。我不知道如何在用户空间和C程序中获取这些信息。但它似乎也有可能(http://netsplit.com/tracing-on-linux)其他跟踪事件可用于用户空间我们并不需要 写内核模块可以挂接到他们但显然我们 只能读取数据这样因此这将是巨大的如果你能发现它稍后回答自己题。