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