Skip to contentSkip to conversation

tools/kvm_stat: Exempt time-based counters

PATCH Applied Stefan Raspl 3 participants 4 messages Dec 8, 2020 – Dec 10, 2020 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/kvm_stat: Exempt time-based counters

From: Stefan Raspl <[email protected]>

The new counters halt_poll_success_ns and halt_poll_fail_ns do not count events. Instead they provide a time, and mess up our statistics. Therefore, we should exclude them.
Removal is currently implemented with an exempt list. If more counters like these appear, we can think about a more general rule like excluding all fields name "*_ns", in case that's a standing convention.

---
 tools/kvm/kvm_stat/kvm_stat | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/kvm/kvm_stat/kvm_stat +5 -1
index d199a3694be8..b0bf56c5f120 100755
@@ -742,7 +742,11 @@ class DebugfsProvider(Provider):
         The fields are all available KVM debugfs files
 
         """
-        return self.walkdir(PATH_DEBUGFS_KVM)[2]
+        exempt_list = ['halt_poll_fail_ns', 'halt_poll_success_ns']
+        fields = [field for field in self.walkdir(PATH_DEBUGFS_KVM)[2]
+                  if field not in exempt_list]
+
+        return fields
 
     def update_fields(self, fields_filter):
         """Refresh fields, applying fields_filter"""
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 5 lines · Stefan Raspl

From: Stefan Raspl<[email protected]>

The new counters halt_poll_success_ns and halt_poll_fail_ns do not count events. Instead they provide a time, and mess up our statistics. Therefore, we should exclude them.

What is the issue exactly? Do they mess up the formatting?

Paolo

Quoted 7 lines

Removal is currently implemented with an exempt list. If more counters like these appear, we can think about a more general rule like excluding all fields name "*_ns", in case that's a standing convention.

---

#2 lore raw
Quoted 8 lines · Paolo Bonzini
Quoted 5 lines · Stefan Raspl

From: Stefan Raspl<[email protected]>

The new counters halt_poll_success_ns and halt_poll_fail_ns do not count events. Instead they provide a time, and mess up our statistics. Therefore, we should exclude them.

What is the issue exactly?  Do they mess up the formatting?

they mess up the percentage (they are 99% almost all the time)

Quoted 11 lines

Paolo

Quoted 7 lines

Removal is currently implemented with an exempt list. If more counters like these appear, we can think about a more general rule like excluding all fields name "*_ns", in case that's a standing convention.

---

maintainer Applied
#3 lore raw
In reply to Stefan Raspl
Quoted 23 lines · Stefan Raspl

From: Stefan Raspl <[email protected]>

The new counters halt_poll_success_ns and halt_poll_fail_ns do not count events. Instead they provide a time, and mess up our statistics. Therefore, we should exclude them.
Removal is currently implemented with an exempt list. If more counters like these appear, we can think about a more general rule like excluding all fields name "*_ns", in case that's a standing convention.

---
  tools/kvm/kvm_stat/kvm_stat | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
tools/kvm/kvm_stat/kvm_stat +0 -0
index d199a3694be8..b0bf56c5f120 100755
@@ -742,7 +742,11 @@ class DebugfsProvider(Provider):
          The fields are all available KVM debugfs files
 

tools/kvm/kvm_stat/kvm_stat class DebugfsProvider(Provider): · line 752

Quoted 10 lines
tools/kvm/kvm_stat/kvm_stat +5 -1
          """
-        return self.walkdir(PATH_DEBUGFS_KVM)[2]
+        exempt_list = ['halt_poll_fail_ns', 'halt_poll_success_ns']
+        fields = [field for field in self.walkdir(PATH_DEBUGFS_KVM)[2]
+                  if field not in exempt_list]
+
+        return fields
 
      def update_fields(self, fields_filter):
          """Refresh fields, applying fields_filter"""

Queued, thanks.

Paolo