Exemple #1
0
 def test_detect_tracer_entry(self):
     a = AnalysisRunner(None)
     self.assertTrue(a.is_tracer_entry(TRACER_ENTRY))
Exemple #2
0
 def test_detect_tracer_class(self):
     a = AnalysisRunner(None)
     self.assertTrue(a.is_tracer_class(TRACER_CLASS))
Exemple #3
0

if __name__ == '__main__':
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument('file', nargs='?', default='debug.log')
    parser.add_argument('-c',
                        '--class',
                        action='append',
                        dest='classes',
                        help='tracer class selector (default: all)')
    parser.add_argument('-l',
                        '--list-classes',
                        action='store_true',
                        help='show tracer classes')
    args = parser.parse_args()

    analyzer = None
    if args.list_classes:
        analyzer = ListClasses()
    else:
        analyzer = stats = Stats(args.classes)

    with Parser(args.file) as log:
        runner = AnalysisRunner(log)
        runner.add_analyzer(analyzer)
        runner.run()

    if not args.list_classes:
        stats.report()
            ev_file_name = '%s/ev_%d_%s.dat' % (self.outdir, ix, name)
            os.unlink(ev_file_name)


if __name__ == '__main__':
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument('file', nargs='?', default='debug.log')
    parser.add_argument('outdir', nargs='?', default='tsplot')
    parser.add_argument('-g',
                        '--ghost-pads',
                        action='store_true',
                        help='also plot data for ghost-pads')
    parser.add_argument('-s',
                        '--size',
                        action='store',
                        default='1600x600',
                        help='graph size as WxH')
    args = parser.parse_args()

    os.makedirs(args.outdir, exist_ok=True)
    size = [int(s) for s in args.size.split('x')]

    with Parser(args.file) as log:
        tsplot = TsPlot(args.outdir, args.ghost_pads, size)
        runner = AnalysisRunner(log)
        runner.add_analyzer(tsplot)
        runner.run()

        tsplot.report()
    return "{:02d}:{:02d}:{:010.7f}".format(h, m, s)


def is_time_field(f):
    # TODO: need proper units
    return f.endswith("/time") or f.endswith("-dts") or f.endswith("-pts") or f.endswith("-duration")


if __name__ == "__main__":
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument("file", nargs="?", default="debug.log")
    parser.add_argument("-c", "--class", action="append", dest="classes", help="tracer class selector (default: all)")
    parser.add_argument("-l", "--list-classes", action="store_true", help="show tracer classes")
    args = parser.parse_args()

    analyzer = None
    if args.list_classes:
        analyzer = ListClasses()
    else:
        analyzer = stats = Stats(args.classes)

    with Parser(args.file) as log:
        runner = AnalysisRunner(log)
        runner.add_analyzer(analyzer)
        runner.run()

    if not args.list_classes:
        stats.report()
            name = self.pad_names[ix]
            buf_file_name = '%s/buf_%d_%s.dat' % (self.outdir, ix, name)
            os.unlink(buf_file_name)
        for ix, pad_file in self.ev_files.items():
            name = self.pad_names[ix]
            ev_file_name = '%s/ev_%d_%s.dat' % (self.outdir, ix, name)
            os.unlink(ev_file_name)


if __name__ == '__main__':
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument('file', nargs='?', default='debug.log')
    parser.add_argument('outdir', nargs='?', default='tsplot')
    parser.add_argument('-g', '--ghost-pads', action='store_true',
                        help='also plot data for ghost-pads')
    parser.add_argument('-s', '--size', action='store', default='1600x600',
                        help='graph size as WxH')
    args = parser.parse_args()

    os.makedirs(args.outdir, exist_ok=True)
    size = [int(s) for s in args.size.split('x')]

    with Parser(args.file) as log:
        tsplot = TsPlot(args.outdir, args.ghost_pads, size)
        runner = AnalysisRunner(log)
        runner.add_analyzer(tsplot)
        runner.run()

        tsplot.report()