int netif_rx(struct sk_buff *skb)
{
struct timeval stamp;
if (skb->stamp.tv_sec == 0)
do_gettimeofday(&skb->stamp);
}
我想获取内核开始执行上述函数的时间,最后我想将它存储在缓冲区skbuf中。如果我像上面那样编码,那么是否可以将调度时间存储在缓冲区中?请有人帮助我吗?我的问题 - 如果我调用 sched_clock();那么它会给出系统的调度时间,但最终如何将其存储在缓冲区中呢?是否可以使用结构指针来存储调度时钟的值?
最佳答案
I want to get the time when which the kernel starts executing the above function and finally I want to store it in a buffer skbuf.
int getsocketschedtime(stuct skbuf *sb)
{
struct timeval tv;
gettimeofday(&tv, NULL);
sb->tstamp.off_sec = tv.tv_sec;
sb->tstamp.off_usec = tv.tv_usec;
// ... do smth useful
}
关于c - 如何理解数组中的this指针?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22983087/