From mboxrd@z Thu Jan 1 00:00:00 1970 From: Janosch Frank Subject: Re: [PATCH v2 0/5] Improve KVM per VM monitoring Date: Tue, 24 May 2016 10:17:41 +0200 Message-ID: <57440E25.7050401@linux.vnet.ibm.com> References: <1463570785-6766-1-git-send-email-frankja@linux.vnet.ibm.com> <74970e5d-1266-206d-c1df-8c2ed08266c5@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: dan.carpenter@oracle.com, frankja@linux.vnet.ibm.com To: Paolo Bonzini , kvm@vger.kernel.org Return-path: Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:55551 "EHLO e06smtp13.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754766AbcEXIRx (ORCPT ); Tue, 24 May 2016 04:17:53 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 May 2016 09:17:46 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 896312190067 for ; Tue, 24 May 2016 09:17:16 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u4O8Hgvj9830814 for ; Tue, 24 May 2016 08:17:42 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u4O8Hf8I013342 for ; Tue, 24 May 2016 02:17:42 -0600 In-Reply-To: <74970e5d-1266-206d-c1df-8c2ed08266c5@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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=:: restrict statistics to pid > > -f:: > --fields=:: > fields to display (regex) > > -h:: > --help:: > > show help message > > SEE ALSO > -------- > perf(1), trace-cmd(1) > > AUTHOR > ------ > Stefan Hajnoczi >