u64 b, e,a;
b = get_cycles();
........
e = get_cycles();
a = e - b 

if (a >= 50000000 * 20)
    pr_info("free cost %llus\n", (e - b) / 50000000);

https://www.ibm.com/developerworks/cn/linux/1307_liuming_linuxtime1/index.html

获取cpu Id可以用函数

smp_processor_id()

 

相关文章:

  • 2021-12-27
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-12-27
  • 2021-12-06
  • 2022-01-18
猜你喜欢
  • 2022-12-23
  • 2021-12-05
  • 2021-12-15
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2021-12-24
相关资源
相似解决方案