On 26.08.2011 14:25, "Müller, René" wrote:

> Hi Oliver,
> 
> I have a solution for my problem, but I must admit this is maybe not the 
> cleanest. I did no more tests in the user space (time is running away), 
> instead I cloned the CAN_RAW socket to an CAN_RCB (raw circular buffer) 
> socket and implemented an circular buffer for can frames inside it (including 
> timestamps).
> 
> By this way, I combine a low memory usage (no need to enlarge the overloaded 
> socket rx buffer) with a low cpu usage (buffering in kernel context). When 
> recvmsg() is called by a user space application, I copy the whole buffer and 
> reduce the system calls to 1.
> 
> This only works with one very important prerequisite: before calling recvmsg 
> I have to set a "nothing passes" can filter on the socket. This prevents a 
> write access to my buffer while I read it, so I don't lose a frame from the 
> last 30s. This is enough for my use case, because I have to dump only 30s and 
> I don't need the can data while writing the buffered data to a file.
> 
> If it has any use for you, I can send the patch for a 2.6.35.7 kernel to the 
> list.


Hi René,

looks *really* hackish %-)

Btw. if it helps to solve your problem ...

As i'm running a very recent Debian here which should have the latest glibc,
i'll try to make some tests with recvmmsg() with candump - at least our
discussion made me courious about this new syscall.

I'll send some measurements once i can compare both of them.

Best regards,
Oliver
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to