I'm trying to measure the lateny between kernel and userspace, by triggering periodic timer every 1 second, and notifying userspace of the event (using ioctl , and wake_up_interruptible.
For this I created a kernel module which is using hrtimer, and userspace test which is waiting for events. the kernel module is using
in kernel: getnstimeofday(),
and to get the time, and the userspace is using:
in userspace: clock_gettime().
But the amazing thing is that I see that the results timing from userspace and kernel is not synchronized !
1st event:
userspace: 8866[sec] 896197992[nsec] ; kernel: 1388251190[sec] 442706727[nsec]
2nd event:
userspace: 8867[sec] 896151470[nsec] ; kernel: 1388251191[sec] 442690693[nsec]
As you can see kernel and userspace clock is not synchronized, so I can't really measure latency between kernel and userspace events, Right ?
Thank you for any idea, Ran