linux/tools
Stefan Raspl 3754afe7cf tools/kvm_stat: Add command line switch '-L' to log to file
To integrate with logrotate, we have a signal handler that will re-open
the logfile.
Assuming we have a systemd unit file with
     ExecStart=kvm_stat -dtc -s 10 -L /var/log/kvm_stat.csv
     ExecReload=/bin/kill -HUP $MAINPID
and a logrotate config featuring
     postrotate
        /bin/systemctl reload kvm_stat.service
     endscript
Then the overall flow will look like this:
(1) systemd starts kvm_stat, logging to A.
(2) At some point, logrotate runs, moving A to B.
    kvm_stat continues to write to B at this point.
(3) After rotating, logrotate restarts the kvm_stat unit via systemctl.
(4) The kvm_stat unit sends a SIGHUP to kvm_stat, finally making it
    switch over to writing to A again.
Note that in order to keep the structure of the cvs output in tact, we
make sure to, in contrast to the standard log format, only write the
header once at the beginning of a file. This implies that the header is
suppressed when appending to an existing file. Unlike with the standard
format, where we append to an existing file by starting out with a
header.

Signed-off-by: Stefan Raspl <raspl@de.ibm.com>
Message-Id: <20200402085705.61155-3-raspl@linux.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-04-21 09:13:12 -04:00
..
accounting tools/accounting/getdelays.c: fix netlink attribute length 2020-04-02 09:35:25 -07:00
arch ARM: 2020-04-02 15:13:15 -07:00
bootconfig bootconfig: Add append value operator support 2020-02-21 09:59:39 -05:00
bpf bpftool: Add struct_ops support 2020-03-20 15:51:35 +01:00
build bpftool: Only build bpftool-prog-profile if supported by clang 2020-03-13 00:08:33 +01:00
cgroup iocost: Fix iocost_monitor.py due to helper type mismatch 2020-01-17 11:54:35 -08:00
debugging
edid tools/edid: Move EDID data sets from Documentation/ 2020-02-19 04:10:32 -07:00
firewire
firmware
gpio
hv Tools: hv: Reopen the devices if read() or write() returns errors 2020-01-26 22:10:10 -05:00
iio
include Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-03-31 17:29:33 -07:00
io_uring
kvm/kvm_stat tools/kvm_stat: Add command line switch '-L' to log to file 2020-04-21 09:13:12 -04:00
laptop
leds
lib Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-03-31 17:29:33 -07:00
memory-model
nfsd
objtool Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2020-03-30 16:17:15 -07:00
pci
pcmcia
perf Merge branch 'x86-misc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2020-03-31 11:30:45 -07:00
power platform-drivers-x86 for v5.7-1 2020-03-31 16:43:40 -07:00
scripts Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-03-25 18:58:11 -07:00
spi spi: spidev_test: Remove the whole "include" directory when make clean 2020-02-13 13:17:59 +00:00
testing selftests: kvm: Add testcase for creating max number of memslots 2020-04-15 12:08:47 -04:00
thermal/tmon
time
usb
virtio
vm tools/vm/slabinfo: fix sanity checks enabling 2020-01-31 10:30:38 -08:00
wmi
Makefile tools: bootconfig: Add bootconfig command 2020-01-13 13:19:39 -05:00