[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 40/49] scripts/kvm/kvm_stat: Add optparse description
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 40/49] scripts/kvm/kvm_stat: Add optparse description |
Date: |
Tue, 26 Jan 2016 14:47:12 +0100 |
From: Janosch Frank <address@hidden>
Added a description text that explains what the script does and which
requirements have to be met to let it run.
The help formatter class is needed as the default optparse formatter
makes the text unreadable.
Signed-off-by: Janosch Frank <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
scripts/kvm/kvm_stat | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index 25631a4..d43e8f3 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -705,7 +705,34 @@ def log(stats):
line += 1
def get_options():
- optparser = optparse.OptionParser()
+ description_text = """
+This script displays various statistics about VMs running under KVM.
+The statistics are gathered from the KVM debugfs entries and / or the
+currently available perf traces.
+
+The monitoring takes additional cpu cycles and might affect the VM's
+performance.
+
+Requirements:
+- Access to:
+ /sys/kernel/debug/kvm
+ /sys/kernel/debug/trace/events/*
+ /proc/pid/task
+- /proc/sys/kernel/perf_event_paranoid < 1 if user has no
+ CAP_SYS_ADMIN and perf events are used.
+- CAP_SYS_RESOURCE if the hard limit is not high enough to allow
+ the large number of files that are possibly opened.
+"""
+
+ class PlainHelpFormatter(optparse.IndentedHelpFormatter):
+ def format_description(self, description):
+ if description:
+ return description + "\n"
+ else:
+ return ""
+
+ optparser = optparse.OptionParser(description=description_text,
+ formatter=PlainHelpFormatter())
optparser.add_option('-1', '--once', '--batch',
action='store_true',
default=False,
--
1.8.3.1
- [Qemu-devel] [PULL 29/49] scripts/kvm/kvm_stat: Cleanup of Groups class, (continued)
- [Qemu-devel] [PULL 29/49] scripts/kvm/kvm_stat: Cleanup of Groups class, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 28/49] scripts/kvm/kvm_stat: Cleanup of Stats class, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 36/49] scripts/kvm/kvm_stat: Read event values as u64, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 31/49] scripts/kvm/kvm_stat: Group arch specific data, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 34/49] scripts/kvm/kvm_stat: Fix output formatting, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 33/49] scripts/kvm/kvm_stat: Make tui function a class, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 37/49] scripts/kvm/kvm_stat: Fix rlimit for unprivileged users, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 38/49] scripts/kvm/kvm_stat: Fixup filtering, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 32/49] scripts/kvm/kvm_stat: Remove unneeded X86_EXIT_REASONS, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 35/49] scripts/kvm/kvm_stat: Cleanup and pre-init perf_event_attr, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 40/49] scripts/kvm/kvm_stat: Add optparse description,
Paolo Bonzini <=
- [Qemu-devel] [PULL 41/49] cpus: use broadcast on qemu_pause_cond, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 39/49] scripts/kvm/kvm_stat: Add interactive filtering, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 43/49] nbd: add missed aio_context_acquire in nbd_export_new, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 42/49] memory: exit when hugepage allocation fails if mem-prealloc, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 45/49] scripts/dump-guest-memory.py: Make methods functions, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 46/49] scripts/dump-guest-memory.py: Improve python 3 compatibility, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 47/49] scripts/dump-guest-memory.py: Cleanup functions, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 44/49] scripts/dump-guest-memory.py: Move constants to the top, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 48/49] scripts/dump-guest-memory.py: Introduce multi-arch support, Paolo Bonzini, 2016/01/26
- [Qemu-devel] [PULL 49/49] scripts/dump-guest-memory.py: Fix module docstring, Paolo Bonzini, 2016/01/26