prune-trace: correctly handle 0 trace entries
If the analyzed program does not read any memory, or the reading memory accesses are filtered out in the import step (import-trace -m), the trace table may hold no entries for the program. This commit makes sure the SamplingPruner and FESamplingPruner deal properly with this situation. Change-Id: I6bb5da23f345fa97cf8ab0b688cce5d00945249a
This commit is contained in:
@ -146,6 +146,11 @@ bool FESamplingPruner::sampling_prune(const fail::Database::Variant& variant)
|
|||||||
samplerows = std::min(pilotcount, m_samplesize);
|
samplerows = std::min(pilotcount, m_samplesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pilotcount == 0) {
|
||||||
|
LOG << "no entries found, nothing to sample from!" << endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
LOG << "loaded " << pilotcount << " entries, sampling "
|
LOG << "loaded " << pilotcount << " entries, sampling "
|
||||||
<< samplerows << " entries with fault expansion ..." << endl;
|
<< samplerows << " entries with fault expansion ..." << endl;
|
||||||
|
|
||||||
|
|||||||
@ -173,6 +173,11 @@ bool SamplingPruner::sampling_prune(const fail::Database::Variant& variant)
|
|||||||
mysql_free_result(res);
|
mysql_free_result(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pilotcount == 0) {
|
||||||
|
LOG << "no entries found, nothing to sample from!" << endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
LOG << "loaded " << pilotcount << " entries, sampling "
|
LOG << "loaded " << pilotcount << " entries, sampling "
|
||||||
<< m_samplesize << " fault-space coordinates ..." << endl;
|
<< m_samplesize << " fault-space coordinates ..." << endl;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user