mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-17 12:14:43 +00:00
tools/kvm_stat: fix trace setup glitch on field updates in TracepointProvider
Updating the fields of the TracepointProvider does not propagate changes to the tracepoints. This shows when a pid filter is enabled, whereby subsequent extensions of the fields of the Tracepoint provider (e.g. by toggling drilldown) will not modify the tracepoints as required. To reproduce, select a specific process via interactive command 'p', and enable drilldown via 'x' - none of the fields with the braces will appear although they should. The fix will always leave all available fields in the TracepointProvider enabled. Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com> Based-on-text-by: Janosch Frank <frankja@linux.vnet.ibm.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
This commit is contained in:
parent
e0ba38765c
commit
a183606937
1 changed files with 3 additions and 2 deletions
|
|
@ -550,6 +550,7 @@ class TracepointProvider(object):
|
||||||
def setup_traces(self):
|
def setup_traces(self):
|
||||||
"""Creates all event and group objects needed to be able to retrieve
|
"""Creates all event and group objects needed to be able to retrieve
|
||||||
data."""
|
data."""
|
||||||
|
fields = self.get_available_fields()
|
||||||
if self._pid > 0:
|
if self._pid > 0:
|
||||||
# Fetch list of all threads of the monitored pid, as qemu
|
# Fetch list of all threads of the monitored pid, as qemu
|
||||||
# starts a thread for each vcpu.
|
# starts a thread for each vcpu.
|
||||||
|
|
@ -560,7 +561,7 @@ class TracepointProvider(object):
|
||||||
|
|
||||||
# The constant is needed as a buffer for python libs, std
|
# The constant is needed as a buffer for python libs, std
|
||||||
# streams and other files that the script opens.
|
# streams and other files that the script opens.
|
||||||
newlim = len(groupids) * len(self._fields) + 50
|
newlim = len(groupids) * len(fields) + 50
|
||||||
try:
|
try:
|
||||||
softlim_, hardlim = resource.getrlimit(resource.RLIMIT_NOFILE)
|
softlim_, hardlim = resource.getrlimit(resource.RLIMIT_NOFILE)
|
||||||
|
|
||||||
|
|
@ -576,7 +577,7 @@ class TracepointProvider(object):
|
||||||
|
|
||||||
for groupid in groupids:
|
for groupid in groupids:
|
||||||
group = Group()
|
group = Group()
|
||||||
for name in self._fields:
|
for name in fields:
|
||||||
tracepoint = name
|
tracepoint = name
|
||||||
tracefilter = None
|
tracefilter = None
|
||||||
match = re.match(r'(.*)\((.*)\)', name)
|
match = re.match(r'(.*)\((.*)\)', name)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue