public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.vnet.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Cc: dan.carpenter@oracle.com, frankja@linux.vnet.ibm.com
Subject: Re: [PATCH v2 0/5] Improve KVM per VM monitoring
Date: Tue, 24 May 2016 10:17:41 +0200	[thread overview]
Message-ID: <57440E25.7050401@linux.vnet.ibm.com> (raw)
In-Reply-To: <74970e5d-1266-206d-c1df-8c2ed08266c5@redhat.com>

On 05/23/2016 04:07 PM, Paolo Bonzini wrote:
> On 18/05/2016 13:26, Janosch Frank wrote:
>> This patchset introduces KVM per VM exit statistics monitoring via
>> debugfs, as well as moves a tool to display VM statistics from qemu to
>> tools/.
>>
>> The new debugfs per VM statistics are an alternative to the already
>> available VM tracepoints. They are easier to read and have low
>> overhead.
>>
>> The kvm_stat python script is moved to the kernel, as we can make sure
>> here that the right version of the script is used with the right
>> kernel version. This is not given for qemu, as it supports a wide
>> range of linux kernel versions.
> 
> The patches look good, but you are not moving over the documentation.
> 
> I started looking at asciidoc, but perf's documentation Makefiles seem
> to be overkill for our purposes.  (My prototype conversion of the docs
> to asciidoc after my signature).
> 
> Perhaps pod2man could be an alternative (using QEMU's texi2pod to
> build the kvm_stat.pod input)?

The script already outputs a help text, which could be extended to the
man's text. I.e. I left it out on purpose.

Anyway, creating the manpage from asciidoc sources is a matter of having
the right packages and simply calling:
a2x --doctype manpage --format manpage file.txt

Works flawlessly with your example and is much more readable than the
texi source. I would give it a try and add it to the first patch if you
do not have any concerns?

The makefile would come down to (feel free to improve, I rarely write
makefiles):

include ../../scripts/Makefile.include
include ../../scripts/utilities.mak
BINDIR=usr/bin
MANDIR=usr/share/man/man1
ASCIIDOC=asciidoc
asciidoc_path := $(call get-executable,$(ASCIIDOC))

check-asciidoc:
ifeq ($(asciidoc_path),)
	$(error "You need to install asciidoc for man pages")
endif

man: check-asciidoc
	a2x --doctype manpage --format manpage kvm_stat.txt

install-man: man
	install -d -m 755 $(INSTALL_ROOT)/$(MANDIR)
	install -m 644 kvm_stat.1 $(INSTALL_ROOT)/$(MANDIR)

install:
	mkdir -p $(INSTALL_ROOT)/$(BINDIR)
	install -m 755 -p "kvm_stat" "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)"

> 
> Paolo
> 
> 
> kvm_stat(1)
> ===========
> 
> NAME
> ----
> kvm_stat - Report KVM kernel module event counters
> 
> SYNOPSIS
> --------
> [verse]
> 'kvm_stat' [OPTION]...
> 
> DESCRIPTION
> -----------
> kvm_stat prints counts of KVM kernel module trace events.  These events signify
> state transitions such as guest mode entry and exit.
> 
> This tool is useful for observing guest behavior from the host perspective.
> Often conclusions about performance or buggy behavior can be drawn from the
> output.
> 
> The set of KVM kernel module trace events may be specific to the kernel version
> or architecture.  It is best to check the KVM kernel module source code for the
> meaning of events.
> 
> Note that trace events are counted globally across all running guests.
Let's not forget this for the pid monitoring patch:

Events can be fetched globally for all guests or for single guests only.

> 
> OPTIONS
> -------
> -1::
> --once::
> --batch::
> 	run in batch mode for one second
> 
> -l::
> --log::
> 	run in logging mode (like vmstat)
> 
> -t::
> --tracepoints::
> 	retrieve statistics from tracepoints
> 
> -d::
> --debugfs::
> 	retrieve statistics from debugfs
Let's not forget this for the pid monitoring patch:

-p<pid>::
--pid=<pid>::
	restrict statistics to pid

> 
> -f<fields>::
> --fields=<fields>::
> 	fields to display (regex)
> 
> -h::
> --help::
> 
>   show help message
> 
> SEE ALSO
> --------
> perf(1), trace-cmd(1)
> 
> AUTHOR
> ------
> Stefan Hajnoczi <stefanha@redhat.com>
> 


  reply	other threads:[~2016-05-24  8:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18 11:26 [PATCH v2 0/5] Improve KVM per VM monitoring Janosch Frank
2016-05-18 11:26 ` [PATCH v2 1/5] tools: Add kvm_stat vm monitor script Janosch Frank
2016-05-18 11:26 ` [PATCH v2 2/5] MAINTAINERS: Add kvm tools Janosch Frank
2016-05-18 11:26 ` [PATCH v2 3/5] KVM: Create debugfs dir and stat files for each VM Janosch Frank
2016-05-18 11:26 ` [PATCH v2 4/5] tools: kvm_stat: Introduce pid monitoring Janosch Frank
2016-05-18 11:26 ` [PATCH v2 5/5] tools: kvm_stat: Add documentation Janosch Frank
2016-05-23 14:07 ` [PATCH v2 0/5] Improve KVM per VM monitoring Paolo Bonzini
2016-05-24  8:17   ` Janosch Frank [this message]
2016-05-24  8:50     ` Paolo Bonzini
2016-05-24  8:57       ` Janosch Frank
2016-05-24 10:09         ` 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=57440E25.7050401@linux.vnet.ibm.com \
    --to=frankja@linux.vnet.ibm.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@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