~sforshee/+git/ubuntu-bionic:lp1734130

Last commit made on 2018-04-06
Get this branch:
git clone -b lp1734130 https://git.launchpad.net/~sforshee/+git/ubuntu-bionic
Only Seth Forshee can upload to this branch. If you are Seth Forshee please log in for upload directions.

Branch merges

Branch information

Name:
lp1734130
Repository:
lp:~sforshee/+git/ubuntu-bionic

Recent commits

95b7a5d... by Seth Forshee

UBUNTU: [Config] do_tools_host=true for amd64

BugLink: http://bugs.launchpad.net/bugs/1734130

Signed-off-by: Seth Forshee <email address hidden>

15899af... by Seth Forshee

UBUNTU: [Packaging] Add linux-tools-host package for VM host tools

BugLink: http://bugs.launchpad.net/bugs/1734130

IBM has requested that we package the kvm_stat tool from the
kernel source tree. This is a python script and thus is not
kernel-version specific. Because of this, and in order to avoid
adding a python dependency, this tool is not added to any
existing tools package.

Instead, create a new linux-tools-host package to contain tools
useful on VM hosts which will currently only contain kvm_stat.
Don't build this package unless specified in the architecture
rules file; it should only be built in the master kernel and in
a single architecture for any given series.

Signed-off-by: Seth Forshee <email address hidden>

ee5fe3c... by Cole Robinson

tools/kvm_stat: Remove unused function

BugLink: http://bugs.launchpad.net/bugs/1734130

Unused since added in 18e8f4100

Signed-off-by: Cole Robinson <email address hidden>
Reviewed-and-tested-by: Stefan Raspl <email address hidden>
Signed-off-by: Radim Krčmář <email address hidden>
(cherry picked from commit 1f97e01a385703c18ceb853c894ea09736161233 linux-next)
Signed-off-by: Seth Forshee <email address hidden>

a95b9ae... by Cole Robinson

tools/kvm_stat: Don't use deprecated file()

BugLink: http://bugs.launchpad.net/bugs/1734130

$ python3 tools/kvm/kvm_stat/kvm_stat
Traceback (most recent call last):
  File "tools/kvm/kvm_stat/kvm_stat", line 1668, in <module>
    main()
  File "tools/kvm/kvm_stat/kvm_stat", line 1639, in main
    assign_globals()
  File "tools/kvm/kvm_stat/kvm_stat", line 1618, in assign_globals
    for line in file('/proc/mounts'):
NameError: name 'file' is not defined

open() is the python3 way, and works on python2.6+

Signed-off-by: Cole Robinson <email address hidden>
Reviewed-and-tested-by: Stefan Raspl <email address hidden>
Signed-off-by: Radim Krčmář <email address hidden>
(cherry picked from commit 0866c31bf32fbd05dd25b6ed4976fa9134773227 linux-next)
Signed-off-by: Seth Forshee <email address hidden>

f042640... by Cole Robinson

tools/kvm_stat: Fix python3 syntax

BugLink: http://bugs.launchpad.net/bugs/1734130

$ python3 tools/kvm/kvm_stat/kvm_stat
  File "tools/kvm/kvm_stat/kvm_stat", line 1137
    def sortkey((_k, v)):
                ^
SyntaxError: invalid syntax

Fix it in a way that's compatible with python2 and python3

Signed-off-by: Cole Robinson <email address hidden>
Tested-by: Stefan Raspl <email address hidden>
Signed-off-by: Radim Krčmář <email address hidden>
(cherry picked from commit 6ade1ae84c9236cbb58de4b17f770f2791106676 linux-next)
Signed-off-by: Seth Forshee <email address hidden>

73ae452... by Stefan Raspl <email address hidden>

tools/kvm_stat: print 'Total' line for multiple events only

BugLink: http://bugs.launchpad.net/bugs/1734130

The 'Total' line looks a bit weird when we have a single event only. This
can happen e.g. due to filters. Therefore suppress when there's only a
single event in the output.

Signed-off-by: Stefan Raspl <email address hidden>
Signed-off-by: Paolo Bonzini <email address hidden>
(cherry picked from commit 6789af030a462708f937137e05eb12ea009fb348)
Signed-off-by: Seth Forshee <email address hidden>

3fd7af3... by Stefan Raspl <email address hidden>

tools/kvm_stat: group child events indented after parent

BugLink: http://bugs.launchpad.net/bugs/1734130

We keep the current logic that sorts all events (parent and child), but
re-shuffle the events afterwards, grouping the children after the
respective parent. Note that the percentage column for child events
gives the percentage of the parent's total.
Since we rework the logic anyway, we modify the total average
calculation to use the raw numbers instead of the (rounded) averages.
Note that this can result in differing numbers (between total average
and the sum of the individual averages) due to rounding errors.

Signed-off-by: Stefan Raspl <email address hidden>
Signed-off-by: Paolo Bonzini <email address hidden>
(cherry picked from commit df72ecfc790fa01de1c41f836ff51d12f9c40318)
Signed-off-by: Seth Forshee <email address hidden>

125923c... by Stefan Raspl <email address hidden>

tools/kvm_stat: separate drilldown and fields filtering

BugLink: http://bugs.launchpad.net/bugs/1734130

Drilldown (i.e. toggle display of child trace events) was implemented by
overriding the fields filter. This resulted in inconsistencies: E.g. when
drilldown was not active, adding a filter that also matches child trace
events would not only filter fields according to the filter, but also add
in the child trace events matching the filter. E.g. on x86, setting
'kvm_userspace_exit' as the fields filter after startup would result in
display of kvm_userspace_exit(DCR), although that wasn't previously
present - not exactly what one would expect from a filter.
This patch addresses the issue by keeping drilldown and fields filter
separate. While at it, we also fix a PEP8 issue by adding a blank line
at one place (since we're in the area...).
We implement this by adding a framework that also allows to define a
taxonomy among the debugfs events to identify child trace events. I.e.
drilldown using 'x' can now also work with debugfs. A respective parent-
child relationship is only known for S390 at the moment, but could be
added adjusting other platforms' ARCH.dbg_is_child() methods
accordingly.

Signed-off-by: Stefan Raspl <email address hidden>
Signed-off-by: Paolo Bonzini <email address hidden>
(cherry picked from commit 18e8f4100ef14f924514fbd91eb67bd5fa5396b7)
Signed-off-by: Seth Forshee <email address hidden>

ae9a772... by Stefan Raspl <email address hidden>

tools/kvm_stat: eliminate extra guest/pid selection dialog

BugLink: http://bugs.launchpad.net/bugs/1734130

We can do with a single dialog that takes both, pids and guest names.
Note that we keep both interactive commands, 'p' and 'g' for now, to
avoid confusion among users used to a specific key.

While at it, we improve on some minor glitches regarding curses usage,
e.g. cursor still visible when not supposed to be.

Signed-off-by: Stefan Raspl <email address hidden>
Signed-off-by: Paolo Bonzini <email address hidden>
(cherry picked from commit 516f1190a1e0cce12128a6446e6438745c8de62a)
Signed-off-by: Seth Forshee <email address hidden>

6493a1f... by Stefan Raspl <email address hidden>

tools/kvm_stat: mark private methods as such

BugLink: http://bugs.launchpad.net/bugs/1734130

Helps quite a bit reading the code when it's obvious when a method is
intended for internal use only.

Signed-off-by: Stefan Raspl <email address hidden>
Signed-off-by: Paolo Bonzini <email address hidden>
(cherry picked from commit c0e8c21eae616ed8703c1b4b01046a1578ee875c)
Signed-off-by: Seth Forshee <email address hidden>