* SocketCAN timestamps @ 2015-11-24 13:07 Stefan Tatschner 2015-11-24 13:42 ` Marc Kleine-Budde 0 siblings, 1 reply; 5+ messages in thread From: Stefan Tatschner @ 2015-11-24 13:07 UTC (permalink / raw) To: linux-can 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SocketCAN timestamps 2015-11-24 13:07 SocketCAN timestamps Stefan Tatschner @ 2015-11-24 13:42 ` Marc Kleine-Budde 2015-11-24 14:06 ` [PATCH] can-doc: Add hint about getting timestamps Stefan Tatschner 0 siblings, 1 reply; 5+ messages in thread From: Marc Kleine-Budde @ 2015-11-24 13:42 UTC (permalink / raw) To: Stefan Tatschner, linux-can [-- Attachment #1: Type: text/plain, Size: 822 bytes --] On 11/24/2015 02:07 PM, Stefan Tatschner wrote: > 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 -- 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 | [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 455 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] can-doc: Add hint about getting timestamps 2015-11-24 13:42 ` Marc Kleine-Budde @ 2015-11-24 14:06 ` Stefan Tatschner 2015-12-08 10:07 ` Stefan Tatschner 2015-12-10 18:29 ` Jonathan Corbet 0 siblings, 2 replies; 5+ messages in thread From: Stefan Tatschner @ 2015-11-24 14:06 UTC (permalink / raw) To: Oliver Hartkopp, Marc Kleine-Budde Cc: Jonathan Corbet, linux-can, 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 <rumpelsepp@sevenbyte.org> --- Documentation/networking/can.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt index 05fd83b..6ab619f 100644 --- a/Documentation/networking/can.txt +++ b/Documentation/networking/can.txt @@ -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 -- 2.6.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] can-doc: Add hint about getting timestamps 2015-11-24 14:06 ` [PATCH] can-doc: Add hint about getting timestamps Stefan Tatschner @ 2015-12-08 10:07 ` Stefan Tatschner 2015-12-10 18:29 ` Jonathan Corbet 1 sibling, 0 replies; 5+ messages in thread From: Stefan Tatschner @ 2015-12-08 10:07 UTC (permalink / raw) To: Oliver Hartkopp, Marc Kleine-Budde; +Cc: Jonathan Corbet, linux-can On 24.11.2015 15:06, Stefan Tatschner wrote: > 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 <rumpelsepp@sevenbyte.org> Any comments on this patch? Stefan ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] can-doc: Add hint about getting timestamps 2015-11-24 14:06 ` [PATCH] can-doc: Add hint about getting timestamps Stefan Tatschner 2015-12-08 10:07 ` Stefan Tatschner @ 2015-12-10 18:29 ` Jonathan Corbet 1 sibling, 0 replies; 5+ messages in thread From: Jonathan Corbet @ 2015-12-10 18:29 UTC (permalink / raw) To: Stefan Tatschner; +Cc: Oliver Hartkopp, Marc Kleine-Budde, linux-can On Tue, 24 Nov 2015 15:06:29 +0100 Stefan Tatschner <rumpelsepp@sevenbyte.org> wrote: > 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-12-10 18:29 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-11-24 13:07 SocketCAN timestamps Stefan Tatschner 2015-11-24 13:42 ` Marc Kleine-Budde 2015-11-24 14:06 ` [PATCH] can-doc: Add hint about getting timestamps Stefan Tatschner 2015-12-08 10:07 ` Stefan Tatschner 2015-12-10 18:29 ` Jonathan Corbet
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).