<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/tools/kvm, branch v5.15.162</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.162</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.162'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-08-11T11:07:51Z</updated>
<entry>
<title>tools/kvm_stat: fix display of error when multiple processes are found</title>
<updated>2022-08-11T11:07:51Z</updated>
<author>
<name>Dmitry Klochkov</name>
<email>kdmitry556@gmail.com</email>
</author>
<published>2022-06-14T12:11:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bc2cee443c7401a15227bb7f9e7e0a967563cfd2'/>
<id>urn:sha1:bc2cee443c7401a15227bb7f9e7e0a967563cfd2</id>
<content type='text'>
[ Upstream commit 933b5f9f98da29af646b51b36a0753692908ef64 ]

Instead of printing an error message, kvm_stat script fails when we
restrict statistics to a guest by its name and there are multiple guests
with such name:

  # kvm_stat -g my_vm
  Traceback (most recent call last):
    File "/usr/bin/kvm_stat", line 1819, in &lt;module&gt;
      main()
    File "/usr/bin/kvm_stat", line 1779, in main
      options = get_options()
    File "/usr/bin/kvm_stat", line 1718, in get_options
      options = argparser.parse_args()
    File "/usr/lib64/python3.10/argparse.py", line 1825, in parse_args
      args, argv = self.parse_known_args(args, namespace)
    File "/usr/lib64/python3.10/argparse.py", line 1858, in parse_known_args
      namespace, args = self._parse_known_args(args, namespace)
    File "/usr/lib64/python3.10/argparse.py", line 2067, in _parse_known_args
      start_index = consume_optional(start_index)
    File "/usr/lib64/python3.10/argparse.py", line 2007, in consume_optional
      take_action(action, args, option_string)
    File "/usr/lib64/python3.10/argparse.py", line 1935, in take_action
      action(self, namespace, argument_values, option_string)
    File "/usr/bin/kvm_stat", line 1649, in __call__
      ' to specify the desired pid'.format(" ".join(pids)))
  TypeError: sequence item 0: expected str instance, int found

To avoid this, it's needed to convert pids int values to strings before
pass them to join().

Signed-off-by: Dmitry Klochkov &lt;kdmitry556@gmail.com&gt;
Message-Id: &lt;20220614121141.160689-1-kdmitry556@gmail.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>KVM: kvm_stat: do not show halt_wait_ns</title>
<updated>2021-10-18T18:07:18Z</updated>
<author>
<name>Christian Borntraeger</name>
<email>borntraeger@de.ibm.com</email>
</author>
<published>2021-10-06T12:17:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=01c7d2672a84dbdfa8050d073c3ea466437578fd'/>
<id>urn:sha1:01c7d2672a84dbdfa8050d073c3ea466437578fd</id>
<content type='text'>
Similar to commit 111d0bda8eeb ("tools/kvm_stat: Exempt time-based
counters"), we should not show timer values in kvm_stat. Remove the new
halt_wait_ns.

Fixes: 87bcc5fa092f ("KVM: stats: Add halt_wait_ns stats for all architectures")
Cc: Jing Zhang &lt;jingzhangos@google.com&gt;
Cc: Stefan Raspl &lt;raspl@de.ibm.com&gt;
Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Reviewed-by: Stefan Raspl &lt;raspl@linux.ibm.com&gt;
Message-Id: &lt;20211006121724.4154-1-borntraeger@de.ibm.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/kvm_stat: Fix documentation typo</title>
<updated>2021-05-07T10:06:22Z</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@linux.ibm.com</email>
</author>
<published>2021-05-06T14:03:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b26990987ffce0525abbd84b36595869cfdbbfe6'/>
<id>urn:sha1:b26990987ffce0525abbd84b36595869cfdbbfe6</id>
<content type='text'>
Makes the dash in front of option '-z' disappear in the generated
man-page.

Signed-off-by: Stefan Raspl &lt;raspl@linux.ibm.com&gt;
Message-Id: &lt;20210506140352.4178789-1-raspl@linux.ibm.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/kvm_stat: Add restart delay</title>
<updated>2021-03-30T17:07:09Z</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@linux.ibm.com</email>
</author>
<published>2021-03-25T12:29:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=75f94ecbd0dfd2ac4e671f165f5ae864b7301422'/>
<id>urn:sha1:75f94ecbd0dfd2ac4e671f165f5ae864b7301422</id>
<content type='text'>
If this service is enabled and the system rebooted, Systemd's initial
attempt to start this unit file may fail in case the kvm module is not
loaded. Since we did not specify a delay for the retries, Systemd
restarts with a minimum delay a number of times before giving up and
disabling the service. Which means a subsequent kvm module load will
have kvm running without monitoring.
Adding a delay to fix this.

Signed-off-by: Stefan Raspl &lt;raspl@linux.ibm.com&gt;
Message-Id: &lt;20210325122949.1433271-1-raspl@linux.ibm.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/kvm_stat: Exempt time-based counters</title>
<updated>2020-12-12T00:18:51Z</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@de.ibm.com</email>
</author>
<published>2020-12-08T21:08:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=111d0bda8eeb4b54e0c63897b071effbf9fd9251'/>
<id>urn:sha1:111d0bda8eeb4b54e0c63897b071effbf9fd9251</id>
<content type='text'>
The new counters halt_poll_success_ns and halt_poll_fail_ns do not count
events. Instead they provide a time, and mess up our statistics. Therefore,
we should exclude them.
Removal is currently implemented with an exempt list. If more counters like
these appear, we can think about a more general rule like excluding all
fields name "*_ns", in case that's a standing convention.

Signed-off-by: Stefan Raspl &lt;raspl@linux.ibm.com&gt;
Tested-and-reported-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Message-Id: &lt;20201208210829.101324-1-raspl@linux.ibm.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/kvm_stat: add sample systemd unit file</title>
<updated>2020-04-21T13:13:12Z</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@de.ibm.com</email>
</author>
<published>2020-04-02T08:57:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=997b7e98990cd44243651827e4efa366d9885907'/>
<id>urn:sha1:997b7e98990cd44243651827e4efa366d9885907</id>
<content type='text'>
Add a sample unit file as a basis for systemd integration of kvm_stat
logs.

Signed-off-by: Stefan Raspl &lt;raspl@de.ibm.com&gt;
Message-Id: &lt;20200402085705.61155-4-raspl@linux.ibm.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/kvm_stat: Add command line switch '-L' to log to file</title>
<updated>2020-04-21T13:13:12Z</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@de.ibm.com</email>
</author>
<published>2020-04-02T08:57:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3754afe7cf7cc3693a9c9ff795e9bd97175ca639'/>
<id>urn:sha1:3754afe7cf7cc3693a9c9ff795e9bd97175ca639</id>
<content type='text'>
To integrate with logrotate, we have a signal handler that will re-open
the logfile.
Assuming we have a systemd unit file with
     ExecStart=kvm_stat -dtc -s 10 -L /var/log/kvm_stat.csv
     ExecReload=/bin/kill -HUP $MAINPID
and a logrotate config featuring
     postrotate
        /bin/systemctl reload kvm_stat.service
     endscript
Then the overall flow will look like this:
(1) systemd starts kvm_stat, logging to A.
(2) At some point, logrotate runs, moving A to B.
    kvm_stat continues to write to B at this point.
(3) After rotating, logrotate restarts the kvm_stat unit via systemctl.
(4) The kvm_stat unit sends a SIGHUP to kvm_stat, finally making it
    switch over to writing to A again.
Note that in order to keep the structure of the cvs output in tact, we
make sure to, in contrast to the standard log format, only write the
header once at the beginning of a file. This implies that the header is
suppressed when appending to an existing file. Unlike with the standard
format, where we append to an existing file by starting out with a
header.

Signed-off-by: Stefan Raspl &lt;raspl@de.ibm.com&gt;
Message-Id: &lt;20200402085705.61155-3-raspl@linux.ibm.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/kvm_stat: add command line switch '-z' to skip zero records</title>
<updated>2020-04-21T13:13:11Z</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@de.ibm.com</email>
</author>
<published>2020-04-02T08:57:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=da1fda288943c37de8e1513b98f6dda40c8cd421'/>
<id>urn:sha1:da1fda288943c37de8e1513b98f6dda40c8cd421</id>
<content type='text'>
When running in logging mode, skip records with all zeros (=empty records)
to preserve space when logging to files.

Signed-off-by: Stefan Raspl &lt;raspl@de.ibm.com&gt;
Message-Id: &lt;20200402085705.61155-2-raspl@linux.ibm.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/kvm_stat: add command line switch '-c' to log in csv format</title>
<updated>2020-03-23T19:44:21Z</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@de.ibm.com</email>
</author>
<published>2020-03-06T11:42:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0c794dcefbbc6b128f74b4c46c3ef49321d88735'/>
<id>urn:sha1:0c794dcefbbc6b128f74b4c46c3ef49321d88735</id>
<content type='text'>
Add an alternative format that can be more easily used for further
processing later on.
Note that we add a timestamp in the first column for both, the regular
and the new csv format.

Signed-off-by: Stefan Raspl &lt;raspl@linux.ibm.com&gt;
Message-Id: &lt;20200306114250.57585-5-raspl@linux.ibm.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/kvm_stat: add command line switch '-s' to set update interval</title>
<updated>2020-03-23T19:44:20Z</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@de.ibm.com</email>
</author>
<published>2020-03-06T11:42:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3cbb394d9fb68dcd20415dce2c42b695475e9684'/>
<id>urn:sha1:3cbb394d9fb68dcd20415dce2c42b695475e9684</id>
<content type='text'>
This now controls both, the refresh rate of the interactive mode as well
as the logging mode. Which, as a consequence, means that the default of
logging mode is now 3s, too (use command line switch '-s' to adjust to
your liking).

Signed-off-by: Stefan Raspl &lt;raspl@linux.ibm.com&gt;
Message-Id: &lt;20200306114250.57585-4-raspl@linux.ibm.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
</feed>
