Reputation: 28659
As can be seen in the socket man page, one can use SO_TIMESTAMP
with setsockopt
to
measure the amount of time it takes the Linux kernel to hand a received network packet off to user space.
There is a good description of this functionality here: Measuring latency in the Linux network stack between kernel and user space.
Is there any way to get a reading of the tsc
rather than a timeval
at the time the kernel received a packet?
Upvotes: 3
Views: 1292
Reputation: 33592
No.
The most you can reasonably ask for is a struct timespec
in the CLOCK_MONOTONIC
timebase. I don't think it exists, but it would not be too difficult to add.
Upvotes: 1