diff options
Diffstat (limited to 'scripts/pybootchartgui/pybootchartgui/parsing.py')
-rw-r--r-- | scripts/pybootchartgui/pybootchartgui/parsing.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/pybootchartgui/pybootchartgui/parsing.py b/scripts/pybootchartgui/pybootchartgui/parsing.py index 1cb4466e6d..d423b9f77c 100644 --- a/scripts/pybootchartgui/pybootchartgui/parsing.py +++ b/scripts/pybootchartgui/pybootchartgui/parsing.py | |||
@@ -38,6 +38,8 @@ class Trace: | |||
38 | self.processes = {} | 38 | self.processes = {} |
39 | self.start = {} | 39 | self.start = {} |
40 | self.end = {} | 40 | self.end = {} |
41 | self.min = None | ||
42 | self.max = None | ||
41 | self.headers = None | 43 | self.headers = None |
42 | self.disk_stats = None | 44 | self.disk_stats = None |
43 | self.ps_stats = None | 45 | self.ps_stats = None |
@@ -55,6 +57,10 @@ class Trace: | |||
55 | if not self.valid(): | 57 | if not self.valid(): |
56 | raise ParseError("empty state: '%s' does not contain a valid bootchart" % ", ".join(paths)) | 58 | raise ParseError("empty state: '%s' does not contain a valid bootchart" % ", ".join(paths)) |
57 | 59 | ||
60 | if options.full_time: | ||
61 | self.min = min(self.start.keys()) | ||
62 | self.max = max(self.end.keys()) | ||
63 | |||
58 | return | 64 | return |
59 | 65 | ||
60 | # Turn that parsed information into something more useful | 66 | # Turn that parsed information into something more useful |
@@ -700,12 +706,12 @@ def parse_paths(writer, state, paths): | |||
700 | state = parse_file(writer, state, path) | 706 | state = parse_file(writer, state, path) |
701 | return state | 707 | return state |
702 | 708 | ||
703 | def split_res(res, n): | 709 | def split_res(res, options): |
704 | """ Split the res into n pieces """ | 710 | """ Split the res into n pieces """ |
705 | res_list = [] | 711 | res_list = [] |
706 | if n > 1: | 712 | if options.num > 1: |
707 | s_list = sorted(res.start.keys()) | 713 | s_list = sorted(res.start.keys()) |
708 | frag_size = len(s_list) / float(n) | 714 | frag_size = len(s_list) / float(options.num) |
709 | # Need the top value | 715 | # Need the top value |
710 | if frag_size > int(frag_size): | 716 | if frag_size > int(frag_size): |
711 | frag_size = int(frag_size + 1) | 717 | frag_size = int(frag_size + 1) |
@@ -716,6 +722,9 @@ def split_res(res, n): | |||
716 | end = frag_size | 722 | end = frag_size |
717 | while start < end: | 723 | while start < end: |
718 | state = Trace(None, [], None) | 724 | state = Trace(None, [], None) |
725 | if options.full_time: | ||
726 | state.min = min(res.start.keys()) | ||
727 | state.max = max(res.end.keys()) | ||
719 | for i in range(start, end): | 728 | for i in range(start, end): |
720 | # Add this line for reference | 729 | # Add this line for reference |
721 | #state.add_process(pn + ":" + task, start, end) | 730 | #state.add_process(pn + ":" + task, start, end) |