内核模块中计算执行时间

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

猜你喜欢

转载自www.cnblogs.com/xingmuxin/p/10037983.html