Beispiel #1
0
    def run(self, args):
        """Process the trace"""
        self.current_sec = 0
        self.start_ns = 0
        self.end_ns = 0

        progressbar_setup(self, args)
        for event in self.traces.events:
            progressbar_update(self, args)
            if self.start_ns == 0:
                self.start_ns = event.timestamp
            if self.trace_start_ts == 0:
                self.trace_start_ts = event.timestamp
            self.end_ns = event.timestamp
            self.check_refresh(args, event)
            self.trace_end_ts = event.timestamp

            if event.name == "sched_switch":
                self.state.sched.switch(event)
            elif (event.name[0:4] == "sys_"
                  or event.name[0:14] == "syscall_entry_"):
                self.state.syscall.entry(event)
            elif (event.name == "exit_syscall"
                  or event.name[0:13] == "syscall_exit_"):
                self.state.syscall.exit(event, 1)
        progressbar_finish(self, args)
        if args.refresh == 0:
            # stats for the whole trace
            self.output(args, self.trace_start_ts, self.trace_end_ts, final=1)
        else:
            # stats only for the last segment
            self.output(args, self.start_ns, self.trace_end_ts, final=1)
    def run(self, args):
        """Process the trace"""
        self.current_sec = 0
        self.start_ns = 0
        self.end_ns = 0

        progressbar_setup(self, args)
        for event in self.traces.events:
            progressbar_update(self, args)
            if self.start_ns == 0:
                self.start_ns = event.timestamp
            if self.trace_start_ts == 0:
                self.trace_start_ts = event.timestamp
            self.end_ns = event.timestamp
            self.check_refresh(args, event)
            self.trace_end_ts = event.timestamp

            if event.name == "sched_switch":
                self.state.sched.switch(event)
            elif event.name == "mm_page_alloc":
                self.state.mem.page_alloc(event)
            elif event.name == "mm_page_free":
                self.state.mem.page_free(event)
        progressbar_finish(self, args)
        if args.refresh == 0:
            # stats for the whole trace
            self.output(args, self.trace_start_ts, self.trace_end_ts, final=1)
        else:
            # stats only for the last segment
            self.output(args, self.start_ns, self.trace_end_ts, final=1)
Beispiel #3
0
    def run(self, args):
        """Process the trace"""
        self.current_sec = 0
        self.start_ns = 0
        self.end_ns = 0

        progressbar_setup(self, args)

        if not args.begin:
            started = 1
        else:
            started = 0
        for event in self.traces.events:
            progressbar_update(self, args)
            if args.begin and started == 0 and event.timestamp >= args.begin:
                started = 1
                self.trace_start_ts = event.timestamp
                self.reset_total(event.timestamp)
            if args.end and event.timestamp > args.end:
                break
            self.process_event(event, started)
        progressbar_finish(self, args)
        if args.refresh == 0:
            # stats for the whole trace
            self.output(args, self.trace_start_ts, self.trace_end_ts, final=1)
        else:
            # stats only for the last segment
            self.output(args, self.start_ns, self.trace_end_ts, final=1)
    def run(self, args):
        """Process the trace"""
        self.current_sec = 0
        self.start_ns = 0
        self.end_ns = 0

        progressbar_setup(self, args)
        for event in self.traces.events:
            progressbar_update(self, args)
            if self.start_ns == 0:
                self.start_ns = event.timestamp
            if self.trace_start_ts == 0:
                self.trace_start_ts = event.timestamp
            self.end_ns = event.timestamp
            self.check_refresh(args, event)
            self.trace_end_ts = event.timestamp

            if event.name == "sched_switch":
                self.state.sched.switch(event)
            elif (event.name[0:4] == "sys_" or event.name[0:14] ==
                    "syscall_entry_"):
                self.state.syscall.entry(event)
            elif (event.name == "exit_syscall" or event.name[0:13] ==
                    "syscall_exit_"):
                self.state.syscall.exit(event, 1)
        progressbar_finish(self, args)
        if args.refresh == 0:
            # stats for the whole trace
            self.output(args, self.trace_start_ts, self.trace_end_ts, final=1)
        else:
            # stats only for the last segment
            self.output(args, self.start_ns, self.trace_end_ts, final=1)
Beispiel #5
0
    def run(self, args):
        """Process the trace"""
        self.current_sec = 0
        self.start_ns = 0
        self.end_ns = 0

        progressbar_setup(self, args)

        if not args.begin:
            started = 1
        else:
            started = 0
        for event in self.traces.events:
            progressbar_update(self, args)
            if args.begin and started == 0 and event.timestamp >= args.begin:
                started = 1
                self.trace_start_ts = event.timestamp
                self.reset_total(event.timestamp)
            if args.end and event.timestamp > args.end:
                break
            self.process_event(event, started)
        progressbar_finish(self, args)
        if args.refresh == 0:
            # stats for the whole trace
            self.output(args, self.trace_start_ts, self.trace_end_ts, final=1)
        else:
            # stats only for the last segment
            self.output(args, self.start_ns, self.trace_end_ts, final=1)
    def run(self, args):
        """Process the trace"""
        self.current_sec = 0
        self.start_ns = 0
        self.end_ns = 0

        progressbar_setup(self, args)
        for event in self.traces.events:
            progressbar_update(self, args)
            if self.start_ns == 0:
                self.start_ns = event.timestamp
            if self.trace_start_ts == 0:
                self.trace_start_ts = event.timestamp
            self.end_ns = event.timestamp
            self.check_refresh(args, event)
            self.trace_end_ts = event.timestamp

            if event.name == "sched_switch":
                self.state.sched.switch(event)
            elif event.name == "mm_page_alloc":
                self.state.mem.page_alloc(event)
            elif event.name == "mm_page_free":
                self.state.mem.page_free(event)
        progressbar_finish(self, args)
        if args.refresh == 0:
            # stats for the whole trace
            self.output(args, self.trace_start_ts, self.trace_end_ts, final=1)
        else:
            # stats only for the last segment
            self.output(args, self.start_ns, self.trace_end_ts, final=1)
Beispiel #7
0
    def run(self, args):
        """Process the trace"""
        self.current_sec = 0
        self.start_ns = 0
        self.end_ns = 0

        progressbar_setup(self, args)

        for event in self.traces.events:
            progressbar_update(self, args)
            if self.start_ns == 0:
                self.start_ns = event.timestamp
            if self.trace_start_ts == 0:
                self.trace_start_ts = event.timestamp
            self.end_ns = event.timestamp
            self.check_refresh(args, event)
            self.trace_end_ts = event.timestamp

            if event.name == "sched_switch":
                self.state.sched.switch(event)
            elif event.name == "sched_migrate_task":
                self.state.sched.migrate_task(event)
            elif event.name == "sched_process_fork":
                self.state.sched.process_fork(event)
            elif event.name == "sched_process_exec":
                self.state.sched.process_exec(event)
            elif (event.name[0:4] == "sys_" or event.name[0:14]
                  == "syscall_entry_") and (args.global_syscalls
                                            or args.tid_syscalls or args.fds):
                self.state.syscall.entry(event)
            elif (event.name == "exit_syscall" or event.name[0:13]
                  == "syscall_exit_") and (args.global_syscalls
                                           or args.tid_syscalls or args.fds):
                self.state.syscall.exit(event, 1)
            elif event.name == "block_rq_complete":
                self.state.block.complete(event)
            elif event.name == "block_rq_issue":
                self.state.block.issue(event)
            elif event.name == "netif_receive_skb":
                self.state.net.recv(event)
            elif event.name == "net_dev_xmit":
                self.state.net.send(event)
            elif event.name == "lttng_statedump_process_state":
                self.state.statedump.process_state(event)
            elif event.name == "lttng_statedump_file_descriptor":
                self.state.statedump.file_descriptor(event)
            elif event.name == "self.state.mm_page_alloc":
                self.state.mm.page_alloc(event)
            elif event.name == "self.state.mm_page_free":
                self.state.mm.page_free(event)
        progressbar_finish(self, args)
        if args.refresh == 0:
            # stats for the whole trace
            self.compute_stats()
            self.output(args, self.trace_start_ts, self.trace_end_ts, final=1)
        else:
            # stats only for the last segment
            self.compute_stats()
            self.output(args, self.start_ns, self.trace_end_ts, final=1)
Beispiel #8
0
    def run(self, args):
        progressbar_setup(self, args)
        for event in self.traces.events:
            progressbar_update(self, args)
            self.process_event(event)

        progressbar_finish(self, args)

        self.output()
    def run(self, args):
        progressbar_setup(self, args)
        for event in self.traces.events:
            progressbar_update(self, args)
            self.process_event(event)

        progressbar_finish(self, args)

        self.output()
Beispiel #10
0
    def run(self):
        progressbar_setup(self, args)
        for event in self.handle.events:
            progressbar_update(self, args)
            self.process_event_metadata(event)

        self.stream = self.writer.create_stream(self.stream_class)

        for event in self.traces.events:
            progressbar_update(self, args)
            self.process_event(event)

        progressbar_finish(self, args)

        self.stream.flush()
Beispiel #11
0
    def run(self, args):
        """Process the trace"""
        self.current_sec = 0
        self.start_ns = 0
        self.end_ns = 0

        progressbar_setup(self, args)
        for event in self.traces.events:
            progressbar_update(self, args)
            if self.start_ns == 0:
                self.start_ns = event.timestamp
            if self.trace_start_ts == 0:
                self.trace_start_ts = event.timestamp
            self.end_ns = event.timestamp
            self.check_refresh(args, event)
            self.trace_end_ts = event.timestamp

            if event.name == "sched_switch":
                self.state.sched.switch(event)
            elif event.name == "irq_handler_entry":
                self.state.irq.hard_entry(event)
            elif event.name == "irq_handler_exit":
                self.state.irq.hard_exit(event, args)
            elif event.name == "softirq_entry":
                self.state.irq.soft_entry(event)
            elif event.name == "softirq_exit":
                self.state.irq.soft_exit(event, args)
            elif event.name == "softirq_raise":
                self.state.irq.soft_raise(event)
        if args.refresh == 0:
            # stats for the whole trace
            self.output(args, self.trace_start_ts, self.trace_end_ts, final=1)
        else:
            # stats only for the last segment
            self.output(args, self.start_ns, self.trace_end_ts, final=1)
        progressbar_finish(self, args)
Beispiel #12
0
    def run(self, args):
        """Process the trace"""
        self.current_sec = 0
        self.start_ns = 0
        self.end_ns = 0

        progressbar_setup(self, args)
        for event in self.traces.events:
            progressbar_update(self, args)
            if self.start_ns == 0:
                self.start_ns = event.timestamp
            if self.trace_start_ts == 0:
                self.trace_start_ts = event.timestamp
            self.end_ns = event.timestamp
            self.check_refresh(args, event)
            self.trace_end_ts = event.timestamp

            if event.name == "sched_switch":
                self.state.sched.switch(event)
            elif event.name == "irq_handler_entry":
                self.state.irq.hard_entry(event)
            elif event.name == "irq_handler_exit":
                self.state.irq.hard_exit(event, args)
            elif event.name == "softirq_entry":
                self.state.irq.soft_entry(event)
            elif event.name == "softirq_exit":
                self.state.irq.soft_exit(event, args)
            elif event.name == "softirq_raise":
                self.state.irq.soft_raise(event)
        if args.refresh == 0:
            # stats for the whole trace
            self.output(args, self.trace_start_ts, self.trace_end_ts, final=1)
        else:
            # stats only for the last segment
            self.output(args, self.start_ns, self.trace_end_ts, final=1)
        progressbar_finish(self, args)
    def run(self, args):
        """Process the trace"""
        self.current_sec = 0
        self.start_ns = 0
        self.end_ns = 0

        progressbar_setup(self, args)

        for event in self.traces.events:
            progressbar_update(self, args)
            if self.start_ns == 0:
                self.start_ns = event.timestamp
            if self.trace_start_ts == 0:
                self.trace_start_ts = event.timestamp
            self.end_ns = event.timestamp
            self.check_refresh(args, event)
            self.trace_end_ts = event.timestamp

            if event.name == "sched_switch":
                self.state.sched.switch(event)
            elif event.name == "sched_migrate_task":
                self.state.sched.migrate_task(event)
            elif event.name == "sched_process_fork":
                self.state.sched.process_fork(event)
            elif event.name == "sched_process_exec":
                self.state.sched.process_exec(event)
            elif (event.name[0:4] == "sys_" or event.name[0:14] ==
                  "syscall_entry_") and (args.global_syscalls or
                                         args.tid_syscalls or
                                         args.fds):
                self.state.syscall.entry(event)
            elif (event.name == "exit_syscall" or event.name[0:13] ==
                  "syscall_exit_") and (args.global_syscalls or
                                        args.tid_syscalls or
                                        args.fds):
                self.state.syscall.exit(event, 1)
            elif event.name == "block_rq_complete":
                self.state.block.complete(event)
            elif event.name == "block_rq_issue":
                self.state.block.issue(event)
            elif event.name == "netif_receive_skb":
                self.state.net.recv(event)
            elif event.name == "net_dev_xmit":
                self.state.net.send(event)
            elif event.name == "lttng_statedump_process_state":
                self.state.statedump.process_state(event)
            elif event.name == "lttng_statedump_file_descriptor":
                self.state.statedump.file_descriptor(event)
            elif event.name == "self.state.mm_page_alloc":
                self.state.mm.page_alloc(event)
            elif event.name == "self.state.mm_page_free":
                self.state.mm.page_free(event)
        progressbar_finish(self, args)
        if args.refresh == 0:
            # stats for the whole trace
            self.compute_stats()
            self.output(args, self.trace_start_ts, self.trace_end_ts, final=1)
        else:
            # stats only for the last segment
            self.compute_stats()
            self.output(args, self.start_ns, self.trace_end_ts,
                        final=1)