Create a library for the kernel consumer Kconsumerd functionnalities has been extracted to a library to allow external tools to implement the kernel consumer functions. Kconsumerd is now a daemon using the library, everything works as before for this particular case. Signed-off-by: Julien Desfossez <julien.desfossez@polymtl.ca> Signed-off-by: David Goulet <david.goulet@polymtl.ca>
Core modification and listing kernel event support File descriptor sent to the kconsumerd are now sent one at a time. The problem was that there is a maximum packet size once the control buffer is used with recvmsg/sendmsg. This upper bound can be read and set at : /proc/sys/net/core/optmem_max. Also, the kconsumerd execlp is set to verbose at this time for debugging purpose. Introduce --list-events to list all kernel events with the -k option added. NOT supported for user-space at this point. Signed-off-by: David Goulet <david.goulet@polymtl.ca>
Don't quit when all FD hang up We now wait for the STOP command to exit the polling thread. When we receive this command and all FD has hung up (all data is consumed) then we can exit cleanly. We also close every fd as soon as they report an error. Signed-off-by: Julien Desfossez <julien.desfossez@polymtl.ca>
Fix handling of multiple FDs This patch fixes the (normal) case where we handle more than one reading fd. Previous versions were only tested with one FD, as of now we can consume multiple fd (metadata and data for example). Signed-off-by: Julien Desfossez <julien.desfossez@polymtl.ca>
Fatal error causes kconsumerd to exit In each thread, if a fatal error occurs, all threads are killed and kconsumerd exits thus preventing half working daemon. The session daemon gets notified because kconsumerd disconnects from the error socket. Signed-off-by: Julien Desfossez <julien.desfossez@polymtl.ca>
Initial import of kconsumerd and libkernelctl Import the new kernel consumer along with the kernel tracing control library. kernel-ioctl.h is taken from the lttng-modules tree. Missing: - Send back error to session daemon on splice error - kconsumerd clean tear down on error for both threads Signed-off-by: David Goulet <david.goulet@polymtl.ca>