<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/kvm, branch linux-5.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.10.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.10.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-08-11T11:06:45Z</updated>
<entry>
<title>tools/kvm_stat: fix display of error when multiple processes are found</title>
<updated>2022-08-11T11:06:45Z</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://universe.0xinfinity.dev/distro/kernel/commit/?id=a56e1ccdb7bb455d0b23a7b4de0016153d513aae'/>
<id>urn:sha1:a56e1ccdb7bb455d0b23a7b4de0016153d513aae</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>tools/kvm_stat: Add restart delay</title>
<updated>2021-04-16T09:43:20Z</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://universe.0xinfinity.dev/distro/kernel/commit/?id=e4a0956574c741ca183084b9cd8f3bccec8dbd56'/>
<id>urn:sha1:e4a0956574c741ca183084b9cd8f3bccec8dbd56</id>
<content type='text'>
[ Upstream commit 75f94ecbd0dfd2ac4e671f165f5ae864b7301422 ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&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://universe.0xinfinity.dev/distro/kernel/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://universe.0xinfinity.dev/distro/kernel/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://universe.0xinfinity.dev/distro/kernel/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://universe.0xinfinity.dev/distro/kernel/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://universe.0xinfinity.dev/distro/kernel/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://universe.0xinfinity.dev/distro/kernel/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>
<entry>
<title>tools/kvm_stat: switch to argparse</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:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0e6618fba8c98223e17d57d68b7b834e1eb89612'/>
<id>urn:sha1:0e6618fba8c98223e17d57d68b7b834e1eb89612</id>
<content type='text'>
optparse is deprecated for a while, hence switching over to argparse
(which also works with python2).
As a consequence, help output has some subtle changes, the most
significant one being that the options are all listed explicitly
instead of a universal '[options]' indicator. Also, some of the error
messages are phrased slightly different.
While at it, squashed a number of minor PEP8 issues.

Signed-off-by: Stefan Raspl &lt;raspl@linux.ibm.com&gt;
Message-Id: &lt;20200306114250.57585-3-raspl@linux.ibm.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/kvm_stat: rework command line sequence and message texts</title>
<updated>2020-03-23T19:44:19Z</updated>
<author>
<name>Stefan Raspl</name>
<email>raspl@de.ibm.com</email>
</author>
<published>2020-03-06T11:42:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=eecda7a95646a4590ea02545d15d73cdcdf8beb1'/>
<id>urn:sha1:eecda7a95646a4590ea02545d15d73cdcdf8beb1</id>
<content type='text'>
Make sure command line arguments are sorted alphabetically
everywhere, and adjusted existing texts for interactive command 's' to
become consistent with the long form --set-delay.
Throwing in some PEP8 fixes (all cosmetics) for good measure.

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