Add a circular buffer for client logging messages
Due to the peculiarities of the system call interception process, the logging framework in the client can only rely on using direct calls to the write()
system call using syscall_no_intercept()
to avoid reentrancy. Unfortunately, this causes a huge slowdown since write()
is synchronous in nature. To avoid this, a circular buffer could be introduced to temporarily store formatted messages. Such buffer would be emptied by an additional dedicated thread spawned for such a purpose. The point of the circular buffer would be to overwrite old messages if capacity is exceeded.