111 const vector<const Prof::Flat::EventData*>&
115 const vector<uint64_t>&
124 const vector<uint64_t>&
132 const vector<uint64_t>&
135 const vector<uint64_t>&
179 for (
uint i = 0; i < metricMgr.
size(); ++i) {
198 uint32_t count = evdat.second;
199 metricTotal += count;
217 const vector<uint64_t>&
219 bool advanceCounters)
239 VMA ev_vma = evdat.first;
243 if ((ev_ur_vma <= vmaint.
beg() && vmaint.
beg() < ev_ur_vma_ub)
244 || (ev_ur_vma > vmaint.
beg())) {
253 VMA ev_vma = evdat.first;
257 if (ev_ur_vma >= vmaint.
end()) {
263 uint32_t count = evdat.second;
268 if (advanceCounters && (vmaint.
end() > ev_ur_vma_ub)) {
282 for (
uint i = 0; i < metricVal.size(); ++i) {
283 if (metricVal[i] >= val) {
297 const vector<uint64_t>& metricVal,
298 const vector<uint64_t>& metricTot,
299 ColumnFormatter::Flag flg = ColumnFormatter::Flag_NULL);
308 const std::vector<std::string>& procPruneGlobs,
309 uint64_t procPruneThreshold);
317 const std::vector<std::string>& procPruneGlobs,
318 uint64_t procPruneThreshold)
322 const Mgr::StringToADescVecMap& fnameToFMetricMap =
326 const string& profileFile = fnameToFMetricMap.begin()->first;
333 DIAG_EMsg(
"While reading '" << profileFile <<
"'");
340 for (Prof::Flat::ProfileData::const_iterator it = prof.begin();
341 it != prof.end(); ++it) {
349 std::set<std::string> dir;
358 os, srcCode, procPruneGlobs, procPruneThreshold);
371 const std::vector<std::string>& procPruneGlobs,
372 uint64_t procPruneThreshold)
379 bool hasProcGlobs = !procPruneGlobs.empty();
385 os << std::setfill(
'=') << std::setw(77) <<
"=" << std::endl
386 <<
"Load module: " << proflm.
name() << std::endl
387 << std::setfill(
'-') << std::setw(77) <<
"-" << std::endl;
394 <<
"Metric summary for load module (totals):\n" 397 ColumnFormatter::Flag_ForceVal);
404 it != lm.
procs().end(); ++it) {
417 const vector<uint64_t> metricTotsProc =
419 if (!metricCursor.
hasMetricValGE(metricTotsProc, procPruneThreshold)) {
427 os << std::endl << std::endl
428 <<
"Procedure: " << p->
name() <<
" (" << bestName <<
")\n" 429 << std::setfill(
'-') << std::setw(60) <<
"-" << std::endl;
434 <<
"Metric summary for procedure (percents relative to load module):\n" 437 ColumnFormatter::Flag_ForceVal);
438 os << std::endl <<
" ";
440 ColumnFormatter::Flag_ForcePct);
447 <<
"Metric details for procedure (percents relative to procedure):\n";
458 const vector<uint64_t>& metricValVMA =
467 if (file != the_file || line != the_line) {
470 os << the_file <<
":" << the_line << std::endl;
475 os << std::hex << opVMA << std::dec <<
": ";
489 os << std::endl << std::endl;
495 const vector<uint64_t>& metricVal,
496 const vector<uint64_t>& metricTot,
497 ColumnFormatter::Flag flg)
499 for (
uint i = 0; i < metricVal.size(); ++i) {
500 colFmt.
genCol(i, (
double)metricVal[i], (
double)metricTot[i], flg);
vector< uint64_t > m_metricTots
const vector< uint64_t > & computeMetricForVMA(VMA vma)
virtual VMA convertVMAToOpVMA(VMA vma, ushort GCC_ATTR_UNUSED opIndex) const
void genCol(uint mid, double metricVal, double metricTot, Flag flg=Flag_NULL)
const EventData & event(uint i) const
const vector< uint64_t > & metricValAtVMA() const
static bool hasMetricValGE(const vector< uint64_t > &metricVal, uint64_t val)
uint64_t load_addr() const
vector< uint > m_curMetricIdx
MetricCursor(const Prof::Metric::Mgr &metricMgr, const Prof::Flat::LM &proflm, const BinUtil::LM &lm)
string canonicalizeProcName(const std::string &name, ProcNameMgr *procNameMgr)
const vector< const Prof::Flat::EventData * > & metricDescs() const
uint64_t toUInt64(const char *str, unsigned *endidx)
const std::string & name() const
bool doUnrelocate(VMA loadAddr) const
VMA unrelocate(VMA vma) const
const std::string & profileRelId() const
bool fnmatch(const std::vector< std::string > &patternVec, const char *string, int flags)
virtual void read(const std::set< std::string > &directorySet, ReadFlg readflg)
void openread(const char *filename=NULL)
void genColHeaderSummary()
virtual ushort opIndex() const =0
bool findSrcCodeInfo(VMA vma, ushort opIndex, std::string &func, std::string &file, SrcFile::ln &line) const
vector< uint64_t > m_metricValAtVMA
virtual void decode(std::ostream &os)
std::pair< VMA, bucketsz_t > Datum
const vector< uint64_t > & metricTots() const
static void correlateWithObject_LM(const Prof::Metric::Mgr &metricMgr, const Prof::Flat::LM &proflm, const BinUtil::LM &lm, std::ostream &os, bool srcCode, const std::vector< std::string > &procPruneGlobs, uint64_t procPruneThreshold)
void correlateWithObject(const Prof::Metric::Mgr &metricMgr, std::ostream &os, bool srcCode, const std::vector< std::string > &procPruneGlobs, uint64_t procPruneThreshold)
const vector< uint64_t > & computeMetricVals(const VMAInterval vmaint, bool advanceIndices)
const StringToADescVecMap & fnameToFMetricMap() const
vector< const Prof::Flat::EventData * > m_metricDescs
virtual ushort size() const =0
My_t::const_iterator const_iterator
const char * DIAG_UnexpectedInput
static bool hasNonZeroMetricVal(const vector< uint64_t > &metricVal)
const std::string & name() const
const Datum & datum(uint i) const
Metric::ADesc * metric(uint i)
static void writeMetricVals(ColumnFormatter &colFmt, const vector< uint64_t > &metricVal, const vector< uint64_t > &metricTot, ColumnFormatter::Flag flg=ColumnFormatter::Flag_NULL)
virtual void open(const char *filenm)