--- /dev/null
+#!/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()
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:
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
def run_stats(self):
self.run(stats=True)
+ def run_latencytop(self):
+ self.run(latencytop=True)
+
def run_log(self):
self.run(log=True)
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()
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,
iocmd.run_stats()
+def runlatencytop():
+ # create command
+ iocmd = IoAnalysis()
+ # execute command
+ iocmd.run_latencytop()
+
+
def runlog():
# create command
iocmd = IoAnalysis()