Commit 1eb4b195 authored by Josef Weidendorfer's avatar Josef Weidendorfer
Browse files

Call graph: be more robust against bogus input

If input data specified that a call between functions had 0 cost,
it still was possible that this call arc was drawn, resulting
in strange visulizations (huge random costs shown). We need to
stop drawing the call graph in these cases.
parent bfc26ad5
......@@ -1073,7 +1073,7 @@ void GraphExporter::buildGraph(TraceFunction* f, int depth, bool toCallees,
// from here with full incl. cost because of previous cutoffs
if ((e.cost >= _realCallLimit) && (oldCost < _realCallLimit))
cost = e.cost;
if (cost < _realCallLimit) {
if ((cost <= 0) || (cost <= _realCallLimit)) {
if (0)
qDebug(" Edge Cutoff, limit not reached");
continue;
......@@ -1085,7 +1085,10 @@ void GraphExporter::buildGraph(TraceFunction* f, int depth, bool toCallees,
else
s = f2->inclusive()->subCost(_eventType);
SubCost v = call->subCost(_eventType);
// FIXME: Can s be 0?
// Never recurse if s or v is 0 (can happen with bogus input)
if ((v == 0) || (s== 0)) continue;
buildGraph(f2, depth+1, toCallees, factor * v / s);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment