Skip to content

tools/kvm_stat: add logfile support

Stefan Raspl kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7tools/kvm_stat: rework command line sequence and message textstools/kvm/kvm_stat/kvm_stat tools/kvm/kvm_stat/kvm_stat.txt+25 -240 replies
2/7tools/kvm_stat: switch to argparsetools/kvm/kvm_stat/kvm_stat+62 -800 replies
3/7tools/kvm_stat: add command line switch '-s' to set update intervaltools/kvm/kvm_stat/kvm_stat tools/kvm/kvm_stat/kvm_stat.txt+38 -120 replies
4/7tools/kvm_stat: add command line switch '-c' to log in csv formattools/kvm/kvm_stat/kvm_stat tools/kvm/kvm_stat/kvm_stat.txt+53 -140 replies
5/7tools/kvm_stat: add rotating log supporttools/kvm/kvm_stat/kvm_stat tools/kvm/kvm_stat/kvm_stat.txt+126 -60 replies
6/7tools/kvm_stat: add command line switch '-T'tools/kvm/kvm_stat/kvm_stat tools/kvm/kvm_stat/kvm_stat.txt+78 -10 replies
7/7tools/kvm_stat: add sample systemd unit filetools/kvm/kvm_stat/kvm_stat.service+15 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] tools/kvm_stat: add logfile support

This patch series provides a couple of new options to make logging to files feasible.
Specifically, we add command line switches to specify an arbitrary time interval for logging, and to toggle between a .csv and the previous file format. Furthermore, we allow logging to files, where we utilize a rotating set of 6 logfiles, each with its own header for easy post- processing, especially when using .csv format.
Since specifying logfile size limits might be a non-trivial exercise, we're throwing in yet another command line option that allows to specify the minimum timeframe that should be covered by logs. Finally, there's a minimal systemd unit file to deploy kvm_stat-based logging in Linux distributions.
Note that the decision to write our own logfiles rather than to log to e.g. systemd journal is a conscious one: It is effectively impossible to write csv records into the systemd journal, the header will either disappear after a while or has to be repeated from time to time, which defeats the purpose of having a .csv format that can be easily post- processed, etc.
See individual patch description for further details.

Stefan Raspl (7):
tools/kvm_stat: rework command line sequence and message texts tools/kvm_stat: switch to argparse
tools/kvm_stat: add command line switch '-s' to set update interval tools/kvm_stat: add command line switch '-c' to log in csv format tools/kvm_stat: add rotating log support
tools/kvm_stat: add command line switch '-T' tools/kvm_stat: add sample systemd unit file

 tools/kvm/kvm_stat/kvm_stat         | 434 +++++++++++++++++++++-------
 tools/kvm/kvm_stat/kvm_stat.service |  15 +
 tools/kvm/kvm_stat/kvm_stat.txt     |  59 ++--
 3 files changed, 384 insertions(+), 124 deletions(-)
 create mode 100644 tools/kvm/kvm_stat/kvm_stat.service
Signature · 1 line
2.17.1