|
|
|
@ -440,7 +440,7 @@ void TraceCost::addCost(TraceSubMapping* sm, const char* s)
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
_dirty = false; // don't recurse !
|
|
|
|
|
qDebug("%s\n now %s", fullName().ascii(),
|
|
|
|
|
tqDebug("%s\n now %s", fullName().ascii(),
|
|
|
|
|
TraceCost::costString(0).ascii());
|
|
|
|
|
_dirty = true; // because of invalidate()
|
|
|
|
|
#endif
|
|
|
|
@ -492,7 +492,7 @@ void TraceCost::addCost(TraceSubMapping* sm, FixString & s)
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
_dirty = false; // don't recurse !
|
|
|
|
|
qDebug("%s\n now %s", fullName().ascii(),
|
|
|
|
|
tqDebug("%s\n now %s", fullName().ascii(),
|
|
|
|
|
TraceCost::costString(0).ascii());
|
|
|
|
|
_dirty = true; // because of invalidate()
|
|
|
|
|
#endif
|
|
|
|
@ -548,7 +548,7 @@ void TraceCost::maxCost(TraceSubMapping* sm, FixString & s)
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
_dirty = false; // don't recurse !
|
|
|
|
|
qDebug("%s\n now %s", fullName().ascii(),
|
|
|
|
|
tqDebug("%s\n now %s", fullName().ascii(),
|
|
|
|
|
TraceCost::costString(0).ascii());
|
|
|
|
|
_dirty = true; // because of invalidate()
|
|
|
|
|
#endif
|
|
|
|
@ -582,7 +582,7 @@ void TraceCost::addCost(TraceCost* item)
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
_dirty = false; // don't recurse !
|
|
|
|
|
qDebug("%s added cost item\n %s\n now %s",
|
|
|
|
|
tqDebug("%s added cost item\n %s\n now %s",
|
|
|
|
|
fullName().ascii(), item->fullName().ascii(),
|
|
|
|
|
TraceCost::costString(0).ascii());
|
|
|
|
|
_dirty = true; // because of invalidate()
|
|
|
|
@ -616,7 +616,7 @@ void TraceCost::maxCost(TraceCost* item)
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
_dirty = false; // don't recurse !
|
|
|
|
|
qDebug("%s added cost item\n %s\n now %s",
|
|
|
|
|
tqDebug("%s added cost item\n %s\n now %s",
|
|
|
|
|
fullName().ascii(), item->fullName().ascii(),
|
|
|
|
|
TraceCost::costString(0).ascii());
|
|
|
|
|
_dirty = true; // because of invalidate()
|
|
|
|
@ -834,12 +834,12 @@ bool TraceCostType::parseFormula()
|
|
|
|
|
{
|
|
|
|
|
if (_parsed) return true;
|
|
|
|
|
if (_inParsing) {
|
|
|
|
|
qDebug("TraceCostType::parseFormula: Recursion detected.");
|
|
|
|
|
tqDebug("TraceCostType::parseFormula: Recursion detected.");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!_mapping) {
|
|
|
|
|
qDebug("TraceCostType::parseFormula: No mapping set!");
|
|
|
|
|
tqDebug("TraceCostType::parseFormula: No mapping set!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -861,13 +861,13 @@ bool TraceCostType::parseFormula()
|
|
|
|
|
pos += rx.matchedLength();
|
|
|
|
|
if (rx.cap(0).isEmpty()) break;
|
|
|
|
|
|
|
|
|
|
//qDebug("parseFormula: matched '%s','%s','%s'",
|
|
|
|
|
//tqDebug("parseFormula: matched '%s','%s','%s'",
|
|
|
|
|
// rx.cap(1).ascii(), rx.cap(2).ascii(), rx.cap(3).ascii());
|
|
|
|
|
|
|
|
|
|
costName = rx.cap(3);
|
|
|
|
|
costType = _mapping->type(costName);
|
|
|
|
|
if (!costType) {
|
|
|
|
|
// qDebug("Cost type '%s': In formula cost '%s' unknown.",
|
|
|
|
|
// tqDebug("Cost type '%s': In formula cost '%s' unknown.",
|
|
|
|
|
// _name.ascii(), costName.ascii());
|
|
|
|
|
|
|
|
|
|
_inParsing = false;
|
|
|
|
@ -1146,7 +1146,7 @@ int TraceCostMapping::add(TraceCostType* ct)
|
|
|
|
|
|
|
|
|
|
if (ct->isReal()) {
|
|
|
|
|
if (_realCount >= TraceCost::MaxRealIndex) {
|
|
|
|
|
qDebug("WARNING: Maximum for real cost types reached (on adding '%s')",
|
|
|
|
|
tqDebug("WARNING: Maximum for real cost types reached (on adding '%s')",
|
|
|
|
|
ct->name().ascii());
|
|
|
|
|
return TraceCost::InvalidIndex;
|
|
|
|
|
}
|
|
|
|
@ -1159,7 +1159,7 @@ int TraceCostMapping::add(TraceCostType* ct)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_virtualCount >= TraceCost::MaxRealIndex) {
|
|
|
|
|
qDebug("WARNING: Maximum for virtual cost types reached (on adding '%s')",
|
|
|
|
|
tqDebug("WARNING: Maximum for virtual cost types reached (on adding '%s')",
|
|
|
|
|
ct->name().ascii());
|
|
|
|
|
return TraceCost::InvalidIndex;
|
|
|
|
|
}
|
|
|
|
@ -1444,7 +1444,7 @@ void TraceListCost::addDep(TraceCost* dep)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (_deps.findRef(dep)>=0) {
|
|
|
|
|
qDebug("addDep: %s already in list!",
|
|
|
|
|
tqDebug("addDep: %s already in list!",
|
|
|
|
|
dep->fullName().ascii());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1455,7 +1455,7 @@ void TraceListCost::addDep(TraceCost* dep)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added\n %s (now %d)",
|
|
|
|
|
fullName().ascii(), dep->fullName().ascii(),
|
|
|
|
|
_deps.count());
|
|
|
|
|
#endif
|
|
|
|
@ -1481,7 +1481,7 @@ void TraceListCost::update()
|
|
|
|
|
if (!_dirty) return;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("update %s (count %d)",
|
|
|
|
|
tqDebug("update %s (count %d)",
|
|
|
|
|
fullName().ascii(), _deps.count());
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@ -1497,7 +1497,7 @@ void TraceListCost::update()
|
|
|
|
|
_dirty = false;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug(" > %s", costString(0).ascii());
|
|
|
|
|
tqDebug(" > %s", costString(0).ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1518,7 +1518,7 @@ void TraceJumpListCost::addDep(TraceJumpCost* dep)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (_deps.findRef(dep)>=0) {
|
|
|
|
|
qDebug("addDep: %s already in list!",
|
|
|
|
|
tqDebug("addDep: %s already in list!",
|
|
|
|
|
dep->fullName().ascii());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1529,7 +1529,7 @@ void TraceJumpListCost::addDep(TraceJumpCost* dep)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added\n %s (now %d)",
|
|
|
|
|
fullName().ascii(), dep->fullName().ascii(),
|
|
|
|
|
_deps.count());
|
|
|
|
|
#endif
|
|
|
|
@ -1555,7 +1555,7 @@ void TraceJumpListCost::update()
|
|
|
|
|
if (!_dirty) return;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("update %s (count %d)",
|
|
|
|
|
tqDebug("update %s (count %d)",
|
|
|
|
|
fullName().ascii(), _deps.count());
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@ -1571,7 +1571,7 @@ void TraceJumpListCost::update()
|
|
|
|
|
_dirty = false;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug(" > %s", costString(0).ascii());
|
|
|
|
|
tqDebug(" > %s", costString(0).ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1592,7 +1592,7 @@ void TraceCallListCost::addDep(TraceCallCost* dep)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (_deps.findRef(dep)>=0) {
|
|
|
|
|
qDebug("addDep: %s already in list!",
|
|
|
|
|
tqDebug("addDep: %s already in list!",
|
|
|
|
|
dep->fullName().ascii());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1603,7 +1603,7 @@ void TraceCallListCost::addDep(TraceCallCost* dep)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added\n %s (now %d)",
|
|
|
|
|
fullName().ascii(), dep->fullName().ascii(),
|
|
|
|
|
_deps.count());
|
|
|
|
|
#endif
|
|
|
|
@ -1629,7 +1629,7 @@ void TraceCallListCost::update()
|
|
|
|
|
if (!_dirty) return;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("update %s (count %d)",
|
|
|
|
|
tqDebug("update %s (count %d)",
|
|
|
|
|
fullName().ascii(), _deps.count());
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@ -1650,7 +1650,7 @@ void TraceCallListCost::update()
|
|
|
|
|
_dirty = false;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug(" > %s", costString(0).ascii());
|
|
|
|
|
tqDebug(" > %s", costString(0).ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1671,7 +1671,7 @@ void TraceInclusiveListCost::addDep(TraceInclusiveCost* dep)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (_deps.findRef(dep)>=0) {
|
|
|
|
|
qDebug("addDep: %s already in list!",
|
|
|
|
|
tqDebug("addDep: %s already in list!",
|
|
|
|
|
dep->fullName().ascii());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1682,7 +1682,7 @@ void TraceInclusiveListCost::addDep(TraceInclusiveCost* dep)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added\n %s (now %d)",
|
|
|
|
|
fullName().ascii(), dep->fullName().ascii(),
|
|
|
|
|
_deps.count());
|
|
|
|
|
#endif
|
|
|
|
@ -1707,7 +1707,7 @@ void TraceInclusiveListCost::update()
|
|
|
|
|
if (!_dirty) return;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("update %s (count %d)",
|
|
|
|
|
tqDebug("update %s (count %d)",
|
|
|
|
|
fullName().ascii(), _deps.count());
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@ -1724,7 +1724,7 @@ void TraceInclusiveListCost::update()
|
|
|
|
|
_dirty = false;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug(" > %s", costString(0).ascii());
|
|
|
|
|
tqDebug(" > %s", costString(0).ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1835,7 +1835,7 @@ void TracePartCall::update()
|
|
|
|
|
if (!_dirty) return;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("update %s", fullName().ascii());
|
|
|
|
|
tqDebug("update %s", fullName().ascii());
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Without dependent cost items, assume fixed costs,
|
|
|
|
@ -1850,7 +1850,7 @@ void TracePartCall::update()
|
|
|
|
|
_dirty = false;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug(" > %s", costString(0).ascii());
|
|
|
|
|
tqDebug(" > %s", costString(0).ascii());
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif // USE_FIXCOST
|
|
|
|
@ -1909,7 +1909,7 @@ void TracePartFunction::addPartInstr(TracePartInstr* ref)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (_partInstr.findRef(ref)>=0) {
|
|
|
|
|
qDebug("TracePartFunction::addPartInstr: %s already in list!",
|
|
|
|
|
tqDebug("TracePartFunction::addPartInstr: %s already in list!",
|
|
|
|
|
ref->name().ascii());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1919,7 +1919,7 @@ void TracePartFunction::addPartInstr(TracePartInstr* ref)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added\n %s (now %d)",
|
|
|
|
|
fullName().ascii(), ref->fullName().ascii(),
|
|
|
|
|
_partInstr.count());
|
|
|
|
|
#endif
|
|
|
|
@ -1930,7 +1930,7 @@ void TracePartFunction::addPartLine(TracePartLine* ref)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (_partLines.findRef(ref)>=0) {
|
|
|
|
|
qDebug("TracePartFunction::addPartLine: %s already in list!",
|
|
|
|
|
tqDebug("TracePartFunction::addPartLine: %s already in list!",
|
|
|
|
|
ref->name().ascii());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1940,7 +1940,7 @@ void TracePartFunction::addPartLine(TracePartLine* ref)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added\n %s (now %d)",
|
|
|
|
|
fullName().ascii(), ref->fullName().ascii(),
|
|
|
|
|
_partLines.count());
|
|
|
|
|
#endif
|
|
|
|
@ -1951,7 +1951,7 @@ void TracePartFunction::addPartCaller(TracePartCall* ref)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (_partCallers.findRef(ref)>=0) {
|
|
|
|
|
qDebug("TracePartFunction::addPartCaller: %s already in list!",
|
|
|
|
|
tqDebug("TracePartFunction::addPartCaller: %s already in list!",
|
|
|
|
|
ref->name().ascii());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1961,7 +1961,7 @@ void TracePartFunction::addPartCaller(TracePartCall* ref)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added Caller\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added Caller\n %s (now %d)",
|
|
|
|
|
fullName().ascii(), ref->fullName().ascii(),
|
|
|
|
|
_partCallers.count());
|
|
|
|
|
#endif
|
|
|
|
@ -1972,7 +1972,7 @@ void TracePartFunction::addPartCalling(TracePartCall* ref)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (_partCallings.findRef(ref)>=0) {
|
|
|
|
|
qDebug("TracePartFunction::addPartCalling: %s already in list!",
|
|
|
|
|
tqDebug("TracePartFunction::addPartCalling: %s already in list!",
|
|
|
|
|
ref->name().ascii());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1982,7 +1982,7 @@ void TracePartFunction::addPartCalling(TracePartCall* ref)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added Calling\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added Calling\n %s (now %d)",
|
|
|
|
|
fullName().ascii(), ref->fullName().ascii(),
|
|
|
|
|
_partCallings.count());
|
|
|
|
|
#endif
|
|
|
|
@ -2023,7 +2023,7 @@ void TracePartFunction::update()
|
|
|
|
|
if (!_dirty) return;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("TracePartFunction::update %s (Callers %d, Callings %d, lines %d)",
|
|
|
|
|
tqDebug("TracePartFunction::update %s (Callers %d, Callings %d, lines %d)",
|
|
|
|
|
name().ascii(), _partCallers.count(), _partCallings.count(),
|
|
|
|
|
_partLines.count());
|
|
|
|
|
#endif
|
|
|
|
@ -2116,7 +2116,7 @@ void TracePartFunction::update()
|
|
|
|
|
_dirty = false;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug(" > %s", costString(0).ascii());
|
|
|
|
|
tqDebug(" > %s", costString(0).ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2222,11 +2222,11 @@ void TraceInstrJump::update()
|
|
|
|
|
_dirty = false;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("updated %s", fullName().ascii());
|
|
|
|
|
tqDebug("updated %s", fullName().ascii());
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug(" > %s", costString(0).ascii());
|
|
|
|
|
tqDebug(" > %s", costString(0).ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2481,7 +2481,7 @@ TraceInstrCall* TraceCall::instrCall(TraceInstr* i)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("Created %s [TraceCall::instrCall]", icall->fullName().ascii());
|
|
|
|
|
tqDebug("Created %s [TraceCall::instrCall]", icall->fullName().ascii());
|
|
|
|
|
#endif
|
|
|
|
|
i->addInstrCall(icall);
|
|
|
|
|
}
|
|
|
|
@ -2503,7 +2503,7 @@ TraceLineCall* TraceCall::lineCall(TraceLine* l)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("Created %s [TraceCall::lineCall]", lcall->fullName().ascii());
|
|
|
|
|
tqDebug("Created %s [TraceCall::lineCall]", lcall->fullName().ascii());
|
|
|
|
|
#endif
|
|
|
|
|
l->addLineCall(lcall);
|
|
|
|
|
}
|
|
|
|
@ -2686,7 +2686,7 @@ void TraceInstr::addInstrCall(TraceInstrCall* instrCall)
|
|
|
|
|
if (_instrCalls.findRef(instrCall)>=0) return;
|
|
|
|
|
|
|
|
|
|
if (instrCall->instr() != this) {
|
|
|
|
|
qDebug("Can't add instruction call to another instruction!");
|
|
|
|
|
tqDebug("Can't add instruction call to another instruction!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
@ -2695,7 +2695,7 @@ void TraceInstr::addInstrCall(TraceInstrCall* instrCall)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added\n %s (now %d)",
|
|
|
|
|
fullName().ascii(),
|
|
|
|
|
instrCall->fullName().ascii(), _instrCalls.count());
|
|
|
|
|
#endif
|
|
|
|
@ -2786,7 +2786,7 @@ void TraceLine::addLineCall(TraceLineCall* lineCall)
|
|
|
|
|
if (_lineCalls.findRef(lineCall)>=0) return;
|
|
|
|
|
|
|
|
|
|
if (lineCall->line() != this) {
|
|
|
|
|
qDebug("Can't add line call to another line!");
|
|
|
|
|
tqDebug("Can't add line call to another line!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
@ -2800,7 +2800,7 @@ void TraceLine::addLineCall(TraceLineCall* lineCall)
|
|
|
|
|
(caller->name() != function->name()) ||
|
|
|
|
|
(caller->object() != function->object())) {
|
|
|
|
|
|
|
|
|
|
qDebug("ERROR: Adding line call, line %d\n of %s to\n %s ?!",
|
|
|
|
|
tqDebug("ERROR: Adding line call, line %d\n of %s to\n %s ?!",
|
|
|
|
|
lineCall->line()->lineno(),
|
|
|
|
|
caller->info().ascii(), function->info().ascii());
|
|
|
|
|
}
|
|
|
|
@ -2810,7 +2810,7 @@ void TraceLine::addLineCall(TraceLineCall* lineCall)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added\n %s (now %d)",
|
|
|
|
|
fullName().ascii(),
|
|
|
|
|
lineCall->fullName().ascii(), _lineCalls.count());
|
|
|
|
|
#endif
|
|
|
|
@ -2921,7 +2921,7 @@ TraceLine* TraceFunctionSource::line(uint lineno, bool createNew)
|
|
|
|
|
l.setLineno(lineno);
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("Created %s [TraceFunctionSource::line]",
|
|
|
|
|
tqDebug("Created %s [TraceFunctionSource::line]",
|
|
|
|
|
l.fullName().ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
@ -2980,7 +2980,7 @@ TraceLineMap* TraceFunctionSource::lineMap()
|
|
|
|
|
TracePartFunction* pf = (TracePartFunction*) pfList.first();
|
|
|
|
|
for(; pf; pf = (TracePartFunction*) pfList.next()) {
|
|
|
|
|
|
|
|
|
|
if (0) qDebug("PartFunction %s:%d",
|
|
|
|
|
if (0) tqDebug("PartFunction %s:%d",
|
|
|
|
|
pf->function()->name().ascii(), pf->part()->partNumber());
|
|
|
|
|
|
|
|
|
|
FixCost* fc = pf->firstFixCost();
|
|
|
|
@ -3038,7 +3038,7 @@ TraceLineMap* TraceFunctionSource::lineMap()
|
|
|
|
|
TracePartCall* pc = pcList.first();
|
|
|
|
|
for(; pc; pc = pcList.next()) {
|
|
|
|
|
|
|
|
|
|
if (0) qDebug("PartCall %s:%d",
|
|
|
|
|
if (0) tqDebug("PartCall %s:%d",
|
|
|
|
|
pc->call()->name().ascii(),
|
|
|
|
|
pf->part()->partNumber());
|
|
|
|
|
|
|
|
|
@ -3062,7 +3062,7 @@ TraceLineMap* TraceFunctionSource::lineMap()
|
|
|
|
|
plc = lc->partLineCall(fcc->part(), pc);
|
|
|
|
|
|
|
|
|
|
fcc->addTo(plc);
|
|
|
|
|
if (0) qDebug("Add FixCallCost %s:%d/0x%s, CallCount %s",
|
|
|
|
|
if (0) tqDebug("Add FixCallCost %s:%d/0x%s, CallCount %s",
|
|
|
|
|
fcc->functionSource()->file()->shortName().ascii(),
|
|
|
|
|
fcc->line(), fcc->addr().toString().ascii(),
|
|
|
|
|
fcc->callCount().pretty().ascii());
|
|
|
|
@ -3395,7 +3395,7 @@ TraceInstr* TraceFunction::instr(Addr addr, bool createNew)
|
|
|
|
|
i.setFunction(this);
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("Created %s [TraceFunction::instr]",
|
|
|
|
|
tqDebug("Created %s [TraceFunction::instr]",
|
|
|
|
|
i.fullName().ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
@ -3406,7 +3406,7 @@ void TraceFunction::addCaller(TraceCall* caller)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (caller->called() != this) {
|
|
|
|
|
qDebug("Can't add call to another line!\n");
|
|
|
|
|
tqDebug("Can't add call to another line!\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3417,7 +3417,7 @@ void TraceFunction::addCaller(TraceCall* caller)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added Caller\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added Caller\n %s (now %d)",
|
|
|
|
|
fullName().ascii(), caller->fullName().ascii(), _callers.count());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
@ -3439,7 +3439,7 @@ TraceCall* TraceFunction::calling(TraceFunction* called)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("Created %s [TraceFunction::calling]", calling->fullName().ascii());
|
|
|
|
|
tqDebug("Created %s [TraceFunction::calling]", calling->fullName().ascii());
|
|
|
|
|
#endif
|
|
|
|
|
called->addCaller(calling);
|
|
|
|
|
}
|
|
|
|
@ -3464,7 +3464,7 @@ TraceFunctionSource* TraceFunction::sourceFile(TraceFile* file,
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("Created SourceFile %s [TraceFunction::line]",
|
|
|
|
|
tqDebug("Created SourceFile %s [TraceFunction::line]",
|
|
|
|
|
file->name().ascii());
|
|
|
|
|
#endif
|
|
|
|
|
file->addSourceFile(sourceFile);
|
|
|
|
@ -3612,7 +3612,7 @@ void TraceFunction::update()
|
|
|
|
|
if (!_dirty) return;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("Update %s (Callers %d, sourceFiles %d, instrs %d)",
|
|
|
|
|
tqDebug("Update %s (Callers %d, sourceFiles %d, instrs %d)",
|
|
|
|
|
_name.ascii(), _callers.count(),
|
|
|
|
|
_sourceFiles.count(), _instrMap ? _instrMap->count():0);
|
|
|
|
|
#endif
|
|
|
|
@ -3683,7 +3683,7 @@ void TraceFunction::update()
|
|
|
|
|
_dirty = false;
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("> %s", costString(0).ascii());
|
|
|
|
|
tqDebug("> %s", costString(0).ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3710,7 +3710,7 @@ void TraceFunction::cycleDFS(int d, int& pNo, TraceFunction** pTop)
|
|
|
|
|
if (_cycleLow != 0) return;
|
|
|
|
|
|
|
|
|
|
if (0)
|
|
|
|
|
qDebug("%s D%02d > %s (%d)",
|
|
|
|
|
tqDebug("%s D%02d > %s (%d)",
|
|
|
|
|
TQString().fill(' ', d).ascii(), d, prettyName().ascii(), pNo+1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3744,7 +3744,7 @@ void TraceFunction::cycleDFS(int d, int& pNo, TraceFunction** pTop)
|
|
|
|
|
SubCost cutLimit = SubCost(base * Configuration::cycleCut());
|
|
|
|
|
|
|
|
|
|
if (0)
|
|
|
|
|
qDebug("%s Cum. %s, Max Caller %s, cut limit %s",
|
|
|
|
|
tqDebug("%s Cum. %s, Max Caller %s, cut limit %s",
|
|
|
|
|
TQString().fill(' ', d).ascii(),
|
|
|
|
|
inclusive()->subCost(0).pretty().ascii(),
|
|
|
|
|
base.pretty().ascii(),
|
|
|
|
@ -3757,7 +3757,7 @@ void TraceFunction::cycleDFS(int d, int& pNo, TraceFunction** pTop)
|
|
|
|
|
|
|
|
|
|
// cycle cut heuristic
|
|
|
|
|
if (calling->subCost(0) < cutLimit) {
|
|
|
|
|
if (0) qDebug("%s Cut call to %s (cum. %s)",
|
|
|
|
|
if (0) tqDebug("%s Cut call to %s (cum. %s)",
|
|
|
|
|
TQString().fill(' ', d).ascii(),
|
|
|
|
|
called->prettyName().ascii(),
|
|
|
|
|
calling->subCost(0).pretty().ascii());
|
|
|
|
@ -3777,13 +3777,13 @@ void TraceFunction::cycleDFS(int d, int& pNo, TraceFunction** pTop)
|
|
|
|
|
_cycleLow = called->_cycleLow;
|
|
|
|
|
|
|
|
|
|
if (0)
|
|
|
|
|
qDebug("%s D%02d - %s (%d)",
|
|
|
|
|
tqDebug("%s D%02d - %s (%d)",
|
|
|
|
|
TQString().fill(' ', d+1).ascii(), d+1,
|
|
|
|
|
called->prettyName().ascii(), called->_cycleLow);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (0)
|
|
|
|
|
qDebug("%s D%02d - %s (%d) [Not on stack]",
|
|
|
|
|
tqDebug("%s D%02d - %s (%d) [Not on stack]",
|
|
|
|
|
TQString().fill(' ', d+1).ascii(), d+1,
|
|
|
|
|
called->prettyName().ascii(), called->_cycleLow);
|
|
|
|
|
}
|
|
|
|
@ -3800,7 +3800,7 @@ void TraceFunction::cycleDFS(int d, int& pNo, TraceFunction** pTop)
|
|
|
|
|
// a SCC with >1 members
|
|
|
|
|
|
|
|
|
|
TraceFunctionCycle* cycle = data()->functionCycle(this);
|
|
|
|
|
if (0) qDebug("BASE CYC %d %s",
|
|
|
|
|
if (0) tqDebug("BASE CYC %d %s",
|
|
|
|
|
cycle->cycleNo(), prettyName().ascii());
|
|
|
|
|
while(*pTop) {
|
|
|
|
|
TraceFunction* top = *pTop;
|
|
|
|
@ -3810,13 +3810,13 @@ void TraceFunction::cycleDFS(int d, int& pNo, TraceFunction** pTop)
|
|
|
|
|
*pTop = top->_cycleStackDown;
|
|
|
|
|
top->_cycleStackDown = 0;
|
|
|
|
|
|
|
|
|
|
if (0) qDebug("CYC %s", top->prettyName().ascii());
|
|
|
|
|
if (0) tqDebug("CYC %s", top->prettyName().ascii());
|
|
|
|
|
if (top == this) break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (0)
|
|
|
|
|
qDebug("%s D%02d < %s (%d)",
|
|
|
|
|
tqDebug("%s D%02d < %s (%d)",
|
|
|
|
|
TQString().fill(' ', d).ascii(), d,
|
|
|
|
|
prettyName().ascii(), _cycleLow);
|
|
|
|
|
}
|
|
|
|
@ -3841,7 +3841,7 @@ TraceInstrMap* TraceFunction::instrMap()
|
|
|
|
|
TracePartFunction* pf = (TracePartFunction*) pfList.first();
|
|
|
|
|
for(; pf; pf = (TracePartFunction*) pfList.next()) {
|
|
|
|
|
|
|
|
|
|
if (0) qDebug("PartFunction %s:%d",
|
|
|
|
|
if (0) tqDebug("PartFunction %s:%d",
|
|
|
|
|
pf->function()->name().ascii(), pf->part()->partNumber());
|
|
|
|
|
|
|
|
|
|
FixCost* fc = pf->firstFixCost();
|
|
|
|
@ -3898,7 +3898,7 @@ TraceInstrMap* TraceFunction::instrMap()
|
|
|
|
|
TracePartCall* pc = pcList.first();
|
|
|
|
|
for(; pc; pc = pcList.next()) {
|
|
|
|
|
|
|
|
|
|
if (0) qDebug("PartCall %s:%d",
|
|
|
|
|
if (0) tqDebug("PartCall %s:%d",
|
|
|
|
|
pc->call()->name().ascii(),
|
|
|
|
|
pf->part()->partNumber());
|
|
|
|
|
|
|
|
|
@ -3926,7 +3926,7 @@ TraceInstrMap* TraceFunction::instrMap()
|
|
|
|
|
pic = ic->partInstrCall(fcc->part(), pc);
|
|
|
|
|
|
|
|
|
|
fcc->addTo(pic);
|
|
|
|
|
if (0) qDebug("Add FixCallCost %s:%d/0x%s, CallCount %s",
|
|
|
|
|
if (0) tqDebug("Add FixCallCost %s:%d/0x%s, CallCount %s",
|
|
|
|
|
fcc->functionSource()->file()->shortName().ascii(),
|
|
|
|
|
fcc->line(), fcc->addr().toString().ascii(),
|
|
|
|
|
fcc->callCount().pretty().ascii());
|
|
|
|
@ -4037,7 +4037,7 @@ void TraceClass::addFunction(TraceFunction* function)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (function->cls() != this) {
|
|
|
|
|
qDebug("Can't add function to a class not enclosing this function\n");
|
|
|
|
|
tqDebug("Can't add function to a class not enclosing this function\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4049,7 +4049,7 @@ void TraceClass::addFunction(TraceFunction* function)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added\n %s (now %d)",
|
|
|
|
|
fullName().ascii(),
|
|
|
|
|
function->fullName().ascii(), _functions.count());
|
|
|
|
|
#endif
|
|
|
|
@ -4084,7 +4084,7 @@ void TraceFile::addFunction(TraceFunction* function)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (function->file() != this) {
|
|
|
|
|
qDebug("Can't add function to a file not enclosing this function\n");
|
|
|
|
|
tqDebug("Can't add function to a file not enclosing this function\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4096,7 +4096,7 @@ void TraceFile::addFunction(TraceFunction* function)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added\n %s (now %d)",
|
|
|
|
|
fullName().ascii(),
|
|
|
|
|
function->fullName().ascii(), _functions.count());
|
|
|
|
|
#endif
|
|
|
|
@ -4107,7 +4107,7 @@ void TraceFile::addSourceFile(TraceFunctionSource* sourceFile)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (sourceFile->file() != this) {
|
|
|
|
|
qDebug("Can't add sourceFile to a file not having lines for it\n");
|
|
|
|
|
tqDebug("Can't add sourceFile to a file not having lines for it\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
@ -4117,7 +4117,7 @@ void TraceFile::addSourceFile(TraceFunctionSource* sourceFile)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s \n added SourceFile %s (now %d)",
|
|
|
|
|
tqDebug("%s \n added SourceFile %s (now %d)",
|
|
|
|
|
fullName().ascii(), sourceFile->fullName().ascii(),
|
|
|
|
|
_sourceFiles.count());
|
|
|
|
|
#endif
|
|
|
|
@ -4202,7 +4202,7 @@ void TraceObject::addFunction(TraceFunction* function)
|
|
|
|
|
{
|
|
|
|
|
#if TRACE_ASSERTIONS
|
|
|
|
|
if (function->object() != this) {
|
|
|
|
|
qDebug("Can't add function to an object not enclosing this function\n");
|
|
|
|
|
tqDebug("Can't add function to an object not enclosing this function\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4214,7 +4214,7 @@ void TraceObject::addFunction(TraceFunction* function)
|
|
|
|
|
invalidate();
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("%s added\n %s (now %d)",
|
|
|
|
|
tqDebug("%s added\n %s (now %d)",
|
|
|
|
|
fullName().ascii(),
|
|
|
|
|
function->fullName().ascii(), _functions.count());
|
|
|
|
|
#endif
|
|
|
|
@ -4513,7 +4513,7 @@ void TraceData::load(const TQString& base)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//qDebug("File %s: Part %d, Thread %d", (*it).ascii(), n, t);
|
|
|
|
|
//tqDebug("File %s: Part %d, Thread %d", (*it).ascii(), n, t);
|
|
|
|
|
|
|
|
|
|
if (p->partNumber()>0) n = p->partNumber();
|
|
|
|
|
if (n>maxNumber) maxNumber = n;
|
|
|
|
@ -4538,7 +4538,7 @@ TracePart* TraceData::addPart(const TQString& dir, const TQString& name)
|
|
|
|
|
{
|
|
|
|
|
TQString filename = TQString("%1/%2").arg(dir).arg(name);
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("TraceData::addPart('%s')", filename.ascii());
|
|
|
|
|
tqDebug("TraceData::addPart('%s')", filename.ascii());
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
TQFile* file = new TQFile(filename);
|
|
|
|
@ -4684,7 +4684,7 @@ TraceObject* TraceData::object(const TQString& name)
|
|
|
|
|
o.setName(name);
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("Created %s [TraceData::object]",
|
|
|
|
|
tqDebug("Created %s [TraceData::object]",
|
|
|
|
|
o.fullName().ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
@ -4701,7 +4701,7 @@ TraceFile* TraceData::file(const TQString& name)
|
|
|
|
|
f.setName(name);
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("Created %s [TraceData::file]",
|
|
|
|
|
tqDebug("Created %s [TraceData::file]",
|
|
|
|
|
f.fullName().ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
@ -4740,7 +4740,7 @@ TraceClass* TraceData::cls(const TQString& fnName, TQString& shortName)
|
|
|
|
|
c.setName(clsName);
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("Created %s [TraceData::cls]",
|
|
|
|
|
tqDebug("Created %s [TraceData::cls]",
|
|
|
|
|
c.fullName().ascii());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
@ -4757,7 +4757,7 @@ TraceFunction* TraceData::function(const TQString& name,
|
|
|
|
|
TraceClass* c = cls(name, shortName);
|
|
|
|
|
|
|
|
|
|
if (!file || !object || !c) {
|
|
|
|
|
qDebug("ERROR - no file/object/class for %s ?!", name.ascii());
|
|
|
|
|
tqDebug("ERROR - no file/object/class for %s ?!", name.ascii());
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4779,7 +4779,7 @@ TraceFunction* TraceData::function(const TQString& name,
|
|
|
|
|
f.setMapIterator(it);
|
|
|
|
|
|
|
|
|
|
#if TRACE_DEBUG
|
|
|
|
|
qDebug("Created %s [TraceData::function]\n for %s, %s, %s",
|
|
|
|
|
tqDebug("Created %s [TraceData::function]\n for %s, %s, %s",
|
|
|
|
|
f.fullName().ascii(),
|
|
|
|
|
c->fullName().ascii(), file->fullName().ascii(),
|
|
|
|
|
object ? object->fullName().ascii() : "(unknown object)");
|
|
|
|
@ -4996,7 +4996,7 @@ TraceFunctionCycle* TraceData::functionCycle(TraceFunction* f)
|
|
|
|
|
|
|
|
|
|
void TraceData::updateFunctionCycles()
|
|
|
|
|
{
|
|
|
|
|
//qDebug("Updating cycles...");
|
|
|
|
|
//tqDebug("Updating cycles...");
|
|
|
|
|
|
|
|
|
|
// init cycle info
|
|
|
|
|
TraceFunctionCycle* cycle;
|
|
|
|
|