Skip to content

Commit

Permalink
tools/kvm_stat: fix missing field update after filter change
Browse files Browse the repository at this point in the history
When updating the fields filter, tracepoint events of fields previously
not visible were not enabled, as TracepointProvider.update_fields()
updated the member variable directly instead of using the setter, which
triggers the event enable/disable.
To reproduce, run 'kvm_stat -f kvm_exit', press 'c' to remove the
filter, and notice that no add'l fields that do not match the regex
'kvm_exit' will appear.
This issue was introduced by commit c469117 ("tools/kvm_stat:
simplify initializers").

Signed-off-by: Stefan Raspl <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
Stefan-Raspl authored and bonzini committed Dec 14, 2017
1 parent faa0665 commit 67c162b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/kvm/kvm_stat/kvm_stat
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ class TracepointProvider(Provider):

def update_fields(self, fields_filter):
"""Refresh fields, applying fields_filter"""
self._fields = [field for field in self.get_available_fields()
if self.is_field_wanted(fields_filter, field)]
self.fields = [field for field in self.get_available_fields()
if self.is_field_wanted(fields_filter, field)]

@staticmethod
def get_online_cpus():
Expand Down

0 comments on commit 67c162b

Please sign in to comment.