简体   繁体   English

测量内核2.4.37中的时间流逝

[英]Measuring time lapses in kernel 2.4.37

My purpose is quite simple: to measure the time elapsed: 我的目的很简单:测量经过的时间:

unsigned long start, end;

int init_module (void) {
 start = jiffies;
  printk("Hello Modules\n");
  end = jiffies;
  printk("Measuring time lapses: %lu\n", (end - start) * 1000 /HZ);
  return 0;
}

But this method does not work because printk is too short, can any one give me some suggestions? 但是这种方法不起作用,因为printk太短了,有人可以给我一些建议吗? Any other options? 还有其他选择吗? Both C and assembly are ok. C和汇编都可以。 And I'm required to work under kernel 2.4.37. 并且我需要在内核2.4.37下工作。

Check out printk times. 查看printk时间。 This shall enable you to see the time between the calls or show time relative to a particular message. 这将使您能够查看两次呼叫之间的时间或显示相对于特定消息的时间。 This is one of the instrumentation tool for kernel. 这是内核的检测工具之一。

Provided below the related links and link for patch: 在下面提供了相关链接和补丁链接:
http://elinux.org/Printk_Times http://elinux.org/Printk_Times
http://elinux.org/images/d/d0/Instrumented_printk.patch http://elinux.org/images/d/d0/Instrumented_printk.patch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM