Blame SOURCES/kvm-tools-kvm_stat-fix-trace-setup-glitch-on-field-updat.patch

4a2fec
From d4525d7460d6d129d3a6e4b94a125afb6a06e6ca Mon Sep 17 00:00:00 2001
4a2fec
From: David Hildenbrand <david@redhat.com>
4a2fec
Date: Tue, 17 Oct 2017 19:15:31 +0200
4a2fec
Subject: [PATCH 26/69] tools/kvm_stat: fix trace setup glitch on field updates
4a2fec
 in TracepointProvider
4a2fec
MIME-Version: 1.0
4a2fec
Content-Type: text/plain; charset=UTF-8
4a2fec
Content-Transfer-Encoding: 8bit
4a2fec
4a2fec
RH-Author: David Hildenbrand <david@redhat.com>
4a2fec
Message-id: <20171017191605.2378-6-david@redhat.com>
4a2fec
Patchwork-id: 77316
4a2fec
O-Subject: [RHEL-7.5 qemu-kvm-rhev PATCH 05/39] tools/kvm_stat: fix trace setup glitch on field updates in TracepointProvider
4a2fec
Bugzilla: 1497137
4a2fec
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
4a2fec
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
4a2fec
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
4a2fec
RH-Acked-by: Thomas Huth <thuth@redhat.com>
4a2fec
4a2fec
Upstream-status: linux.git a183606937489ab5ada2215aa8211374a6b26bd3
4a2fec
4a2fec
commit a183606937489ab5ada2215aa8211374a6b26bd3
4a2fec
Author: Stefan Raspl <raspl@linux.vnet.ibm.com>
4a2fec
Date:   Fri Mar 10 13:40:04 2017 +0100
4a2fec
4a2fec
    tools/kvm_stat: fix trace setup glitch on field updates in TracepointProvider
4a2fec
4a2fec
    Updating the fields of the TracepointProvider does not propagate changes to the
4a2fec
    tracepoints. This shows when a pid filter is enabled, whereby subsequent
4a2fec
    extensions of the fields of the Tracepoint provider (e.g. by toggling
4a2fec
    drilldown) will not modify the tracepoints as required.
4a2fec
    To reproduce, select a specific process via interactive command 'p', and
4a2fec
    enable drilldown via 'x' - none of the fields with the braces will appear
4a2fec
    although they should.
4a2fec
    The fix will always leave all available fields in the TracepointProvider
4a2fec
    enabled.
4a2fec
4a2fec
    Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
4a2fec
    Based-on-text-by: Janosch Frank <frankja@linux.vnet.ibm.com>
4a2fec
    Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
4a2fec
4a2fec
Signed-off-by: David Hildenbrand <david@redhat.com>
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 scripts/kvm/kvm_stat | 5 +++--
4a2fec
 1 file changed, 3 insertions(+), 2 deletions(-)
4a2fec
4a2fec
diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
4a2fec
index 231186a..6207843 100755
4a2fec
--- a/scripts/kvm/kvm_stat
4a2fec
+++ b/scripts/kvm/kvm_stat
4a2fec
@@ -550,6 +550,7 @@ class TracepointProvider(object):
4a2fec
     def setup_traces(self):
4a2fec
         """Creates all event and group objects needed to be able to retrieve
4a2fec
         data."""
4a2fec
+        fields = self.get_available_fields()
4a2fec
         if self._pid > 0:
4a2fec
             # Fetch list of all threads of the monitored pid, as qemu
4a2fec
             # starts a thread for each vcpu.
4a2fec
@@ -560,7 +561,7 @@ class TracepointProvider(object):
4a2fec
 
4a2fec
         # The constant is needed as a buffer for python libs, std
4a2fec
         # streams and other files that the script opens.
4a2fec
-        newlim = len(groupids) * len(self._fields) + 50
4a2fec
+        newlim = len(groupids) * len(fields) + 50
4a2fec
         try:
4a2fec
             softlim_, hardlim = resource.getrlimit(resource.RLIMIT_NOFILE)
4a2fec
 
4a2fec
@@ -576,7 +577,7 @@ class TracepointProvider(object):
4a2fec
 
4a2fec
         for groupid in groupids:
4a2fec
             group = Group()
4a2fec
-            for name in self._fields:
4a2fec
+            for name in fields:
4a2fec
                 tracepoint = name
4a2fec
                 tracefilter = None
4a2fec
                 match = re.match(r'(.*)\((.*)\)', name)
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec