SocketCAN timestamps
Subsystems (3)
Hi,
I did some google work to find out how to retrieve timestamps of received messages. I have found this:
http://socket-can.996257.n3.nabble.com/PATCH-Add-timestamps-description-to-can-txt-td1430.html
It seems that this patch has never been applied to the kernel tree. Are there any reasons (besides being forgotten) for this?
Stefan
Marc Kleine-Budde
maintainerQuoted 7 lines · Stefan Tatschner
I did some google work to find out how to retrieve timestamps of received messages. I have found this:
http://socket-can.996257.n3.nabble.com/PATCH-Add-timestamps-description-to-can-txt-td1430.html
It seems that this patch has never been applied to the kernel tree. Are there any reasons (besides being forgotten) for this?
Maybe it was the time when mainlining the first bits and pieces to linux kernel. Can you port this patch against a current linux kernel?
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
PATCH 1/1 can-doc: Add hint about getting timestamps
This patch adds a hint about how to get timestamps of received CAN frames with ioctl(2). This hint has been applied to the former SocketCAN Documentation, but it got lost during mainlining the first bits and pieces to linux kernel.
--- Documentation/networking/can.txt | 9 +++++++++ 1 file changed, 9 insertions(+)
Documentation/networking/can.txt +9 -0
@@ -372,6 +372,15 @@ solution for a couple of reasons: nbytes = sendto(s, &frame, sizeof(struct can_frame), 0, (struct sockaddr*)&addr, sizeof(addr)); + An accurate timestamp can be obtained with an ioctl(2) call after reading + a message from the socket: + + struct timeval tv; + ioctl(s, SIOCGSTAMP, &tv); + + The timestamp has a resolution of one microsecond and is set automatically + at the reception of a CAN frame. + Remark about CAN FD (flexible data rate) support: Generally the handling of CAN FD is very similar to the formerly described
Signature · 1 line
2.6.2
Re: [PATCH] can-doc: Add hint about getting timestamps
Quoted 6 lines · Stefan Tatschner
This patch adds a hint about how to get timestamps of received CAN frames with ioctl(2). This hint has been applied to the former SocketCAN Documentation, but it got lost during mainlining the first bits and pieces to linux kernel.
Signed-off-by Stefan Tatschner <[email protected]>
Any comments on this patch?
Stefan
Re: [PATCH] can-doc: Add hint about getting timestamps
In reply to Stefan TatschnerQuoted 4 lines · On Tue, 24 Nov 2015 15:06:29 +0100 Stefan Tatschner <[email protected]>…
This patch adds a hint about how to get timestamps of received CAN frames with ioctl(2). This hint has been applied to the former SocketCAN Documentation, but it got lost during mainlining the first bits and pieces to linux kernel.
Applied to the docs tree, thanks.
jon