def extents(options, xscale, trace):
start = min(trace.start.keys())
- end = max(trace.end.keys())
+ end = start
- w = int ((end - start) * sec_w_base * xscale) + 2*off_x
- h = proc_h * len(trace.processes) + header_h + 2 * off_y
+ processes = 0
+ for proc in trace.processes:
+ if not options.app_options.show_all and \
+ trace.processes[proc][1] - trace.processes[proc][0] < options.app_options.mintime:
+ continue
+
+ if trace.processes[proc][1] > end:
+ end = trace.processes[proc][1]
+ processes += 1
+
+ w = int ((end - start) * sec_w_base * xscale) + 2 * off_x
+ h = proc_h * processes + header_h + 2 * off_y
return (w, h)
offset = min(trace.start.keys())
for s in sorted(trace.start.keys()):
for val in sorted(trace.start[s]):
+ if not options.app_options.show_all and \
+ trace.processes[val][1] - s < options.app_options.mintime:
+ continue
task = val.split(":")[1]
#print val
#print trace.processes[val][1]
# parser.add_option("--show-pid", action="store_true", dest="show_pid", default=False,
# help="show process ids in the bootchart as 'processname [pid]'")
parser.add_option("--show-all", action="store_true", dest="show_all", default=False,
- help="show all process information in the bootchart as '/process/path/exe [pid] [args]'")
+ help="show all processes in the chart")
# parser.add_option("--crop-after", dest="crop_after", metavar="PROCESS", default=None,
# help="crop chart when idle after PROCESS is started")
# parser.add_option("--annotate", action="append", dest="annotate", metavar="PROCESS", default=None,
self.parent_map = None
self.mem_stats = None
- parse_paths (writer, self, paths, options.mintime)
+ parse_paths (writer, self, paths)
if not self.valid():
raise ParseError("empty state: '%s' does not contain a valid bootchart" % ", ".join(paths))
return 1
return max (int(mat.group(1)), 1)
-def _do_parse(writer, state, filename, file, mintime):
+def _do_parse(writer, state, filename, file):
writer.info("parsing '%s'" % filename)
t1 = clock()
paths = filename.split("/")
start = int(float(line.split()[-1]))
elif line.startswith("Ended:"):
end = int(float(line.split()[-1]))
- if start and end and (end - start) >= mintime:
+ if start and end:
k = pn + ":" + task
state.processes[pn + ":" + task] = [start, end]
if start not in state.start:
writer.info(" %s seconds" % str(t2-t1))
return state
-def parse_file(writer, state, filename, mintime):
+def parse_file(writer, state, filename):
if state.filename is None:
state.filename = filename
basename = os.path.basename(filename)
with open(filename, "rb") as file:
- return _do_parse(writer, state, filename, file, mintime)
+ return _do_parse(writer, state, filename, file)
-def parse_paths(writer, state, paths, mintime):
+def parse_paths(writer, state, paths):
for path in paths:
if state.filename is None:
state.filename = path
#state.filename = path
if os.path.isdir(path):
files = sorted([os.path.join(path, f) for f in os.listdir(path)])
- state = parse_paths(writer, state, files, mintime)
+ state = parse_paths(writer, state, files)
elif extension in [".tar", ".tgz", ".gz"]:
if extension == ".gz":
root, extension = os.path.splitext(root)
if tf != None:
tf.close()
else:
- state = parse_file(writer, state, path, mintime)
+ state = parse_file(writer, state, path)
return state
def split_res(res, n):