]> git.sur5r.net Git - i3/i3/commit - i3-dump-log/main.c
shm-logging: implement i3-dump-log -f (follow)
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 12 Aug 2012 22:57:57 +0000 (00:57 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 12 Aug 2012 23:06:09 +0000 (01:06 +0200)
commite68a8dd86c34db800a2b5643c94b292ad191a708
treea5765a522ad7542ff47522b95e9d0caf5f8d7545
parent070a18e598aefdf961d2442595de648a8b082b3d
shm-logging: implement i3-dump-log -f (follow)

This changes the SHM log format, it doesn’t use 0-bytes to separate
entries anymore. Instead of using lots of printf() calls in i3-dump-log,
we now do precisely one big write().

So, to be clear: i3-dump-log and i3 both need to be upgraded.
Mismatching versions will lead to garbage output (no crashes of i3, just
garbage output).

The -f flag uses an inter-process pthread_cond_t in the shared memory
header to broadcast the arrival of new messages to all i3-dump-log
processes. This internally uses futexes and thus doesn’t even mean a
kernel call in most cases. inter-process pthread_cond_ts require NPTL
(the Native Posix Thread Library, introduce in Linux 2.6).
i3-dump-log/main.c
include/shmlog.h
src/i3.mk
src/log.c