summaryrefslogtreecommitdiffstats
path: root/scripts/pybootchartgui/pybootchartgui/parsing.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/pybootchartgui/pybootchartgui/parsing.py')
-rw-r--r--scripts/pybootchartgui/pybootchartgui/parsing.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/pybootchartgui/pybootchartgui/parsing.py b/scripts/pybootchartgui/pybootchartgui/parsing.py
index ed61825d23..daee5932cf 100644
--- a/scripts/pybootchartgui/pybootchartgui/parsing.py
+++ b/scripts/pybootchartgui/pybootchartgui/parsing.py
@@ -50,7 +50,7 @@ class Trace:
50 self.parent_map = None 50 self.parent_map = None
51 self.mem_stats = None 51 self.mem_stats = None
52 52
53 parse_paths (writer, self, paths, options.mintime) 53 parse_paths (writer, self, paths)
54 if not self.valid(): 54 if not self.valid():
55 raise ParseError("empty state: '%s' does not contain a valid bootchart" % ", ".join(paths)) 55 raise ParseError("empty state: '%s' does not contain a valid bootchart" % ", ".join(paths))
56 56
@@ -630,7 +630,7 @@ def get_num_cpus(headers):
630 return 1 630 return 1
631 return max (int(mat.group(1)), 1) 631 return max (int(mat.group(1)), 1)
632 632
633def _do_parse(writer, state, filename, file, mintime): 633def _do_parse(writer, state, filename, file):
634 writer.info("parsing '%s'" % filename) 634 writer.info("parsing '%s'" % filename)
635 t1 = clock() 635 t1 = clock()
636 paths = filename.split("/") 636 paths = filename.split("/")
@@ -643,7 +643,7 @@ def _do_parse(writer, state, filename, file, mintime):
643 start = int(float(line.split()[-1])) 643 start = int(float(line.split()[-1]))
644 elif line.startswith("Ended:"): 644 elif line.startswith("Ended:"):
645 end = int(float(line.split()[-1])) 645 end = int(float(line.split()[-1]))
646 if start and end and (end - start) >= mintime: 646 if start and end:
647 k = pn + ":" + task 647 k = pn + ":" + task
648 state.processes[pn + ":" + task] = [start, end] 648 state.processes[pn + ":" + task] = [start, end]
649 if start not in state.start: 649 if start not in state.start:
@@ -658,14 +658,14 @@ def _do_parse(writer, state, filename, file, mintime):
658 writer.info(" %s seconds" % str(t2-t1)) 658 writer.info(" %s seconds" % str(t2-t1))
659 return state 659 return state
660 660
661def parse_file(writer, state, filename, mintime): 661def parse_file(writer, state, filename):
662 if state.filename is None: 662 if state.filename is None:
663 state.filename = filename 663 state.filename = filename
664 basename = os.path.basename(filename) 664 basename = os.path.basename(filename)
665 with open(filename, "rb") as file: 665 with open(filename, "rb") as file:
666 return _do_parse(writer, state, filename, file, mintime) 666 return _do_parse(writer, state, filename, file)
667 667
668def parse_paths(writer, state, paths, mintime): 668def parse_paths(writer, state, paths):
669 for path in paths: 669 for path in paths:
670 if state.filename is None: 670 if state.filename is None:
671 state.filename = path 671 state.filename = path
@@ -676,7 +676,7 @@ def parse_paths(writer, state, paths, mintime):
676 #state.filename = path 676 #state.filename = path
677 if os.path.isdir(path): 677 if os.path.isdir(path):
678 files = sorted([os.path.join(path, f) for f in os.listdir(path)]) 678 files = sorted([os.path.join(path, f) for f in os.listdir(path)])
679 state = parse_paths(writer, state, files, mintime) 679 state = parse_paths(writer, state, files)
680 elif extension in [".tar", ".tgz", ".gz"]: 680 elif extension in [".tar", ".tgz", ".gz"]:
681 if extension == ".gz": 681 if extension == ".gz":
682 root, extension = os.path.splitext(root) 682 root, extension = os.path.splitext(root)
@@ -695,7 +695,7 @@ def parse_paths(writer, state, paths, mintime):
695 if tf != None: 695 if tf != None:
696 tf.close() 696 tf.close()
697 else: 697 else:
698 state = parse_file(writer, state, path, mintime) 698 state = parse_file(writer, state, path)
699 return state 699 return state
700 700
701def split_res(res, n): 701def split_res(res, n):