Skip to content
Snippets Groups Projects
  1. Oct 18, 2021
  2. May 07, 2021
  3. Mar 30, 2021
    • Stefan Raspl's avatar
      tools/kvm_stat: Add restart delay · 75f94ecb
      Stefan Raspl authored
      
      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: default avatarStefan Raspl <raspl@linux.ibm.com>
      Message-Id: <20210325122949.1433271-1-raspl@linux.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      75f94ecb
  4. Dec 12, 2020
  5. Apr 21, 2020
    • Stefan Raspl's avatar
      tools/kvm_stat: add sample systemd unit file · 997b7e98
      Stefan Raspl authored
      
      Add a sample unit file as a basis for systemd integration of kvm_stat
      logs.
      
      Signed-off-by: default avatarStefan Raspl <raspl@de.ibm.com>
      Message-Id: <20200402085705.61155-4-raspl@linux.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      997b7e98
    • Stefan Raspl's avatar
      tools/kvm_stat: Add command line switch '-L' to log to file · 3754afe7
      Stefan Raspl authored
      
      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: default avatarStefan Raspl <raspl@de.ibm.com>
      Message-Id: <20200402085705.61155-3-raspl@linux.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      3754afe7
    • Stefan Raspl's avatar
      tools/kvm_stat: add command line switch '-z' to skip zero records · da1fda28
      Stefan Raspl authored
      
      When running in logging mode, skip records with all zeros (=empty records)
      to preserve space when logging to files.
      
      Signed-off-by: default avatarStefan Raspl <raspl@de.ibm.com>
      Message-Id: <20200402085705.61155-2-raspl@linux.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      da1fda28
  6. Mar 23, 2020
  7. Jan 23, 2020
  8. Jun 19, 2019
  9. May 24, 2019
    • Stefan Raspl's avatar
      tools/kvm_stat: fix fields filter for child events · 883d25e7
      Stefan Raspl authored
      
      The fields filter would not work with child fields, as the respective
      parents would not be included. No parents displayed == no childs displayed.
      To reproduce, run on s390 (would work on other platforms, too, but would
      require a different filter name):
      - Run 'kvm_stat -d'
      - Press 'f'
      - Enter 'instruct'
      Notice that events like instruction_diag_44 or instruction_diag_500 are not
      displayed - the output remains empty.
      With this patch, we will filter by matching events and their parents.
      However, consider the following example where we filter by
      instruction_diag_44:
      
        kvm statistics - summary
                         regex filter: instruction_diag_44
         Event                                         Total %Total CurAvg/s
         exit_instruction                                276  100.0       12
           instruction_diag_44                           256   92.8       11
         Total                                           276              12
      
      Note that the parent ('exit_instruction') displays the total events, but
      the childs listed do not match its total (256 instead of 276). This is
      intended (since we're filtering all but one child), but might be confusing
      on first sight.
      
      Signed-off-by: default avatarStefan Raspl <raspl@linux.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      883d25e7
  10. Nov 27, 2018
  11. Oct 01, 2018
  12. Aug 30, 2018
  13. Mar 28, 2018
  14. Feb 24, 2018
  15. Dec 21, 2017
  16. Dec 14, 2017
Loading