From: Stefan Raspl <raspl@linux.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Cc: rkrcmar@redhat.com
Subject: Re: [PATCH 0/7] tools/kvm_stat: add logfile support
Date: Tue, 24 Mar 2020 09:26:14 +0100 [thread overview]
Message-ID: <7c8b614a-a7a1-d33e-8762-b06d4b2fd45b@linux.ibm.com> (raw)
In-Reply-To: <5c350f55-64be-43fc-237d-7f71b4e9afdc@redhat.com>
On 2020-03-23 11:12, Paolo Bonzini wrote:
> On 23/03/20 10:58, Stefan Raspl wrote:
>> Thx!
>> As for SIGHUP: The problem that I see with logrotate and likewise approaches is
>> how the heading is being handled: If it is reprinted every x lines (like the
>> original logging format in kvmstat does), then it messes up any chance of
>> loading the output in external tools for further processing.
>> If the heading is printed once only, then it will get pushed out of the log
>> files at some time - which is fatal, since '-f <fields>' allows to specify
>> custom fields, so one cannot reconstruct what the fields were.
>
> For CSV output, can't you print the heading immediately after SIGHUP
> reopens the files? (Maybe I am missing something and this is a stupid
> suggestion, I don't know).
(Same for me LOL)
To be able to make use of the logfiles, we'd need to have the heading appear at
the top of each of the files.
Couldn't find much info on how logrotate works internally, but from what I
gathered, it seems it moves out the current logfile e.g. /var/log/kvm.log to
become /var/log/kvm.log.1, and sends a SIGHUP to kvm_stat so that it re-opens
/var/log/kvm.log - which would then start out with a header again.
That should work, but can you confirm that this is what you're suggesting?
If so: Keep the current semantics for the original logging mode, where we have
the heading printed every 20 lines? I would assume so, as that format is better
suited for console logs, but just in case you wanted that changed...
Ciao,
Stefan
next prev parent reply other threads:[~2020-03-24 8:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 11:42 [PATCH 0/7] tools/kvm_stat: add logfile support Stefan Raspl
2020-03-06 11:42 ` [PATCH 1/7] tools/kvm_stat: rework command line sequence and message texts Stefan Raspl
2020-03-06 11:42 ` [PATCH 2/7] tools/kvm_stat: switch to argparse Stefan Raspl
2020-03-06 11:42 ` [PATCH 3/7] tools/kvm_stat: add command line switch '-s' to set update interval Stefan Raspl
2020-03-06 11:42 ` [PATCH 4/7] tools/kvm_stat: add command line switch '-c' to log in csv format Stefan Raspl
2020-03-06 11:42 ` [PATCH 5/7] tools/kvm_stat: add rotating log support Stefan Raspl
2020-03-06 11:42 ` [PATCH 6/7] tools/kvm_stat: add command line switch '-T' Stefan Raspl
2020-03-06 11:42 ` [PATCH 7/7] tools/kvm_stat: add sample systemd unit file Stefan Raspl
2020-03-29 11:22 ` Stefan Raspl
2020-03-19 11:21 ` [PATCH 0/7] tools/kvm_stat: add logfile support Stefan Raspl
2020-03-19 11:54 ` Paolo Bonzini
2020-03-23 9:58 ` Stefan Raspl
2020-03-23 10:12 ` Paolo Bonzini
2020-03-24 8:26 ` Stefan Raspl [this message]
2020-03-24 10:32 ` Paolo Bonzini
2020-03-29 11:22 ` Stefan Raspl
2020-03-30 10:43 ` Paolo Bonzini
2020-03-30 12:24 ` Stefan Raspl
2020-03-30 12:35 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7c8b614a-a7a1-d33e-8762-b06d4b2fd45b@linux.ibm.com \
--to=raspl@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox