split iolatencytop and iolatencystats
authorJulien Desfossez <jdesfossez@efficios.com>
Tue, 3 Feb 2015 19:35:13 +0000 (14:35 -0500)
committerJulien Desfossez <jdesfossez@efficios.com>
Tue, 3 Feb 2015 20:20:20 +0000 (15:20 -0500)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
lttng-iolatencytop [new file with mode: 0755]
lttnganalysescli/lttnganalysescli/io.py

diff --git a/lttng-iolatencytop b/lttng-iolatencytop
new file mode 100755 (executable)
index 0000000..1b7c0d5
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env python3
+#
+# The MIT License (MIT)
+#
+# Copyright (C) 2015 - Julien Desfossez <jdesfosez@efficios.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import sys
+
+sys.path += ['linuxautomaton', 'lttnganalyses', 'lttnganalysescli']
+
+import lttnganalysescli.io
+
+
+if __name__ == '__main__':
+    lttnganalysescli.io.runlatencytop()
index fe900d8b18ec444c115c9bd4d191bafd8df2c235..76efedee9d7865417dffdb6051f63b74bd7da979 100644 (file)
@@ -45,10 +45,11 @@ class IoAnalysis(Command):
         self._arg_extra = self._args.extra
         self._arg_usage = self._args.usage
         self._arg_stats = self._args.latencystats
+        self._arg_latencytop = self._args.latencytop
         self._arg_freq = self._args.latencyfreq
         self._arg_freq_resolution = self._args.freq_resolution
 
-    def _default_args(self, stats, log, freq, usage):
+    def _default_args(self, stats, log, freq, usage, latencytop):
         if stats:
             self._arg_stats = True
         if log:
@@ -57,14 +58,17 @@ class IoAnalysis(Command):
             self._arg_freq = True
         if usage:
             self._arg_usage = True
+        if latencytop:
+            self._arg_latencytop = True
 
-    def run(self, stats=False, log=False, freq=False, usage=False):
+    def run(self, stats=False, log=False, freq=False, usage=False,
+            latencytop=False):
         # parse arguments first
         self._parse_args()
         # validate, transform and save specific arguments
         self._validate_transform_args()
         # handle the default args for different executables
-        self._default_args(stats, log, freq, usage)
+        self._default_args(stats, log, freq, usage, latencytop)
         # open the trace
         self._open_trace()
         # create the appropriate analysis/analyses
@@ -82,6 +86,9 @@ class IoAnalysis(Command):
     def run_stats(self):
         self.run(stats=True)
 
+    def run_latencytop(self):
+        self.run(latencytop=True)
+
     def run_log(self):
         self.run(log=True)
 
@@ -721,6 +728,7 @@ class IoAnalysis(Command):
         self.syscalls_stats = self.compute_syscalls_latency_stats(end_ns)
         if self._arg_stats:
             self.iostats_output()
+        if self._arg_latencytop:
             self.iolatency_syscalls_top_output()
         if self._arg_freq:
             self.iolatency_syscalls_output()
@@ -747,6 +755,8 @@ class IoAnalysis(Command):
                         help='Show the I/O usage')
         ap.add_argument('--latencystats', action="store_true",
                         help='Show the I/O latency statistics')
+        ap.add_argument('--latencytop', action="store_true",
+                        help='Show the I/O latency top')
         ap.add_argument('--latencyfreq', action="store_true",
                         help='Show the I/O latency frequency distribution')
         ap.add_argument('--freq-resolution', type=int, default=20,
@@ -766,6 +776,13 @@ def runstats():
     iocmd.run_stats()
 
 
+def runlatencytop():
+    # create command
+    iocmd = IoAnalysis()
+    # execute command
+    iocmd.run_latencytop()
+
+
 def runlog():
     # create command
     iocmd = IoAnalysis()
This page took 0.039188 seconds and 5 git commands to generate.