I've been thinking about ways to start logging CAN frames earlier in the boot process. On our devices, it can take up to 10 secs for userspace applications to be ready, i.e. 10 seconds of lost frames.
To solve this problem, I'd like to experiment with customizing socketcan and initramfs such that the CAN module is
1) loaded as early as possible
2) initiated with a really big RX buffer (several megabytes I guess) to ensure that it doesn't overflow while the rest of the kernel loads
3) preferrably the rx buffer memory can get released once userspace is active and we've flushed the buffer
Has anyone experimented with this? How soon do you think we could start tracking?
For #1 to work, there must not be any SocketCAN dependencies that are slow to load. But all we need is ifconfig or ip, so I guess this is doable...? For #2, do we have to recompile the module? I have looked through the docs and haven't seen anything about altering the module initialization behavior, such as how much memory is claimed for the buffers.