112 uint ANode::s_nextUniqueId = 1;
114 const std::string Tree::UnknownLMNm =
"<unknown load module>";
116 const std::string Tree::UnknownFileNm =
"<unknown file>";
118 const std::string Tree::UnknownProcNm =
"<unknown procedure>";
120 const std::string Tree::PartialUnwindProcNm =
"<partial call paths>";
122 const std::string Tree::UnknownGlobalVariable =
"<unknown variable>";
127 Tree::Tree(
const char* name,
Root* root)
178 static const char* structureDTD =
181 os <<
"<?xml version=\"1.0\"?>\n";
182 os <<
"<!DOCTYPE HPCToolkitStructure [\n" << structureDTD <<
"]>\n";
190 os <<
"<HPCToolkitStructure i=\"0\" version=\"4.6\" n" 193 os <<
"</HPCToolkitStructure>\n";
203 "Pgm",
"Group",
"LM",
"File",
"Proc",
"Alien",
"Loop",
"Stmt",
"Ref",
"ANY" 210 return ScopeNames[tp];
217 DIAG_Assert((i >= 0) && (i < TyNUMBER),
"");
249 lmMap_realpath =
new LMMap();
250 lmMap_basename =
new LMMap();
261 lmMap_realpath =
NULL;
262 lmMap_basename =
NULL;
277 LMMap::iterator it1 = lmMap_realpath->find(nm_real);
278 LM* x = (it1 != lmMap_realpath->end()) ? it1->second :
NULL;
286 if (nm_real == nm_base) {
287 LMMap::iterator it2 = lmMap_basename->find(nm_base);
289 x = (it2 != lmMap_basename->end()) ? it2->second :
NULL;
302 DIAG_Assert((parent ==
NULL) || (t == TyRoot) || (t == TyGroup) || (t == TyLM)
303 || (t == TyFile) || (t == TyProc) || (t == TyAlien)
304 || (t == TyLoop),
"");
306 ancestorRoot()->insertGroupMap(
this);
315 grp =
new Group(nm, parent);
330 DIAG_Assert((parent ==
NULL) || (t == TyRoot) || (t == TyGroup),
"");
365 lm =
new LM(lm_nm, pgm);
379 DIAG_Assert((parent ==
NULL) || (t == TyRoot) || (t == TyGroup) || (t == TyLM),
"");
381 m_name = (fname) ? fname :
"";
384 ancestorLM()->insertFileMap(
this);
403 const char* note =
"(found)";
405 string nm_real = filenm;
411 file =
new File(nm_real, lm);
413 DIAG_DevMsgIf(
DBG_FILE,
"Struct::File::demand: " << note << endl
414 <<
"\tin : " << filenm << endl
415 <<
"\tout: " << file->
name());
425 DIAG_Assert((parent ==
NULL) || (t == TyGroup) || (t == TyFile),
"");
427 m_name = (
n) ? n :
"";
428 m_linkname = (
ln) ? ln :
"";
435 File* fileStrct = ancestorFile();
462 proc =
new Proc(name, file, linkname,
false, begLn, endLn);
467 else if (didCreate) {
480 const char* displaynm)
483 DIAG_Assert((parent ==
NULL) || (t == TyGroup) || (t == TyAlien)
484 || (t == TyProc) || (t == TyLoop),
"");
486 m_filenm = (filenm) ? filenm :
"";
489 m_name = (nm) ? nm :
"";
490 m_displaynm = (displaynm) ? displaynm :
"";
509 :
ACodeNode(TyRef, parent, parent->begLine(), parent->begLine(), 0, 0)
516 DIAG_Assert(begPos <=
endPos,
"");
517 DIAG_Assert(begPos > 0,
"");
518 DIAG_Assert(
m_name.length() > 0,
"");
526 #define dyn_cast_return(base, derived, expr) \ 527 { base* ptr = expr; \ 531 return dynamic_cast<derived*>(ptr); \ 545 const ANode* x =
this;
546 while (x && x->
type() != ty) {
549 return const_cast<ANode*
>(x);
556 const ANode* x =
this;
557 while (x && x->
type() != ty1 && x->
type() != ty2) {
560 return const_cast<ANode*
>(x);
567 const ANode* x =
this;
568 while (x && x->
type() != ty1 && x->
type() != ty2 && x->
type() != ty3) {
571 return const_cast<ANode*
>(x);
579 while (iter && difference > 0 && iter != parent) {
583 if (iter && iter == parent)
605 while ( (!anc1.empty() && !anc2.empty()) && (anc1.front() == anc2.front())) {
696 if ( !(mBegId < mEndId) ) {
700 const ANode* root =
this;
704 ANode* n_parent =
n->parent();
706 for (
uint mId = mBegId; mId < mEndId; ++mId) {
707 double mVal =
n->demandMetric(mId, mEndId);
719 ANode* x = it.current();
741 for (
ANode* x = desc; x !=
NULL; x = x->parent()) {
757 ANode* d1 = desc1, *d2 = desc2;
768 for (
ANode* x = d1; (x && x != lca); x = x->
parent()) {
788 for (
ANode* x = node_dst; x != lca; x = x->
parent()) {
789 path_dst.push_front(x);
791 for (
ANode* x = node_src; x != lca; x = x->
parent()) {
792 path_src.push_front(x);
794 DIAG_Assert(path_dst.size() > 0 && path_src.size() > 0,
"");
798 ANodeList::iterator it_dst = path_dst.begin();
799 ANodeList::iterator it_src = path_src.begin();
801 for ( ; (it_dst != path_dst.end() && it_src != path_src.end());
802 ++it_src, ++it_dst) {
803 ANode* x_src = *it_src;
804 ANode* x_dst = *it_dst;
806 merged |=
merge(x_dst, x_src);
828 ANode* x = it.current();
838 DIAG_Assert(
Logic::equiv(dst0, src0),
"Invariant broken!");
863 bool goodBnds =
true;
871 return ((ty_dst == ty_src) && goodTy && goodBnds);
882 std::pair<GroupMap::iterator, bool> ret =
883 groupMap->insert(std::make_pair(grp->
name(), grp));
884 DIAG_Assert(ret.second,
"Duplicate!");
898 string nm_real = lm->
name();
901 std::pair<LMMap::iterator, bool> ret1 =
902 lmMap_realpath->insert(std::make_pair(nm_real, lm));
903 DIAG_Assert(ret1.second,
"Root::insertLMMap: Duplicate!");
906 std::pair<LMMap::iterator, bool> ret2 =
907 lmMap_basename->insert(std::make_pair(nm_base, lm));
910 LMMap::iterator entry = ret2.first;
911 entry->second =
NULL;
919 string nm_real = f->
name();
921 DIAG_DevMsg(2,
"LM: mapping file name '" << nm_real <<
"' to File* " << f);
922 std::pair<FileMap::iterator, bool> ret =
923 m_fileMap->insert(std::make_pair(nm_real, f));
924 DIAG_Assert(ret.second,
"Duplicate instance: " << f->
name() <<
"\n" <<
toStringXML());
931 DIAG_DevMsg(2,
"File (" <<
this <<
"): mapping proc name '" << p->
name()
932 <<
"' to Proc* " << p);
933 m_procMap->insert(make_pair(p->
name(), p));
941 (*m_stmtMap)[stmt->
begLine()] = stmt;
950 FileMap::iterator it = m_fileMap->find(nm_real);
951 File* x = (it != m_fileMap->end()) ? it->second :
NULL;
962 found = findProc(vma);
976 return (it != m_procMap->end()) ? it->second :
NULL;
988 return (it != m_stmtMap->end()) ? it->second :
NULL;
1008 template<
typename T>
1012 if (!m) {
return true; }
1018 if (it != m->end()) {
1020 DIAG_Assert(!x.
overlaps(y),
"LM::verifyMap: found overlapping elements within " << map_nm <<
": " << x.
toString() <<
" and " << y.
toString());
1034 verifyMap(mp,
"stmtMap");
1039 return verifyMap(m_stmtMap,
"stmtMap");
1049 ProcMap::const_iterator it = m_procMap->find(name);
1050 if (it != m_procMap->end()) {
1051 if (linkname && linkname[0] !=
'\0') {
1052 for ( ; (it != m_procMap->end() && strcmp(it->first.c_str(),
name) == 0);
1054 Proc* p = it->second;
1055 if (strcmp(p->
linkName().c_str(), linkname) == 0) {
1111 bool changed =
false;
1162 for (sibling = dynamic_cast<ACodeNode*>(prnt->
lastChild()); sibling;
1168 if (sibling !=
NULL) {
1186 else if (beg_epsilon != 0 || end_epsilon != 0) {
1189 int end_delta = ln -
endLine();
1190 return ((beg_delta > 0 && beg_delta <= beg_epsilon)
1191 || (end_delta > 0 && end_delta <= end_epsilon));
1201 DIAG_Assert(ln !=
ln_NULL,
"ACodeNode::ACodeNodeWithLine: invalid line");
1206 fnd =
dynamic_cast<ACodeNode*
>(it.Current());
1207 DIAG_Assert(fnd,
"");
1217 if (inner)
return inner;
1235 if (endLinesEqual) {
1241 int cmp1 = px->
name().compare(py->name());
1242 if (cmp1 != 0) {
return cmp1; }
1243 int cmp2 = px->
linkName().compare(py->linkName());
1244 if (cmp2 != 0) {
return cmp2; }
1250 bool vmaSetsEqual = (!x_lt_y && !y_lt_x);
1255 if (x->
isLeaf()) {
return -1; }
1256 else if (y->
isLeaf()) {
return 1; }
1262 else if (x_lt_y) {
return -1; }
1263 else if (y_lt_x) {
return 1; }
1324 if (lmStrct && fileStrct) {
1325 nm =
"[" + lmStrct->
name() +
"]<" + fileStrct->
name() +
">";
1345 nm =
"[" + lmStrct->
name() +
"]";
1364 string nm =
"<" + m_filenm +
">[" +
m_name +
"]:";
1400 "HPCToolkitStructure",
"G",
"LM",
"F",
"P",
"A",
"L",
"S",
"REF",
"ANY" 1406 return XMLelements[tp];
1413 std::ostringstream os;
1494 if (!m_linkname.empty() &&
m_name != m_linkname) {
1572 bool isXMLLeaf =
isLeaf() && !doMetrics;
1577 os << pfx <<
"<" <<
toXML(oFlags) <<
"/>\n";
1580 os << pfx <<
"<" <<
toXML(oFlags) <<
">\n";
1596 const char* pfx)
const 1618 string pfx_new = pfx + indent;
1621 it.current()->writeXML(os, oFlags, pfx_new.c_str());
1648 ANode* scope = it.current();
1661 string indent =
" ";
1669 string prefix = pre + indent;
1672 ANode* scope = it.current();
1673 scope->
writeXML(os, oFlags, prefix.c_str());
1695 const PerfMetric&
metric = IndexToPerfDataInfo(i);
1696 bool percent = metric.Percent();
1698 bool percent =
true;
1702 double percVal = val / root.
metric(i) * 100;
1703 sprintf(temp,
"%5.2lf", percVal);
1718 os <<
name() <<
",,,,";
1722 it.current()->CSV_dump(root, os);
1738 it.current()->CSV_dump(root, os, baseName().c_str());
1745 const char* file_name,
1755 it.current()->CSV_dump(root, os, file_name,
name().c_str(), 1);
1772 const char* file_name,
const char* proc_name,
1780 os << (file_name ? file_name :
name().c_str()) <<
"," 1781 << (proc_name ? proc_name :
"") <<
"," 1788 it.current()->CSV_dump(root, os, file_name, proc_name, lLevel+1);
1807 std::ostringstream os;
1808 dump(os, oFlags, pre);
1825 std::ostringstream os;
1826 dumpme(os, oFlags, prefix);
1834 string prefix = string(pre) +
" ";
1850 it.current()->dump(os, oFlags, prefix.c_str());
1957 ostream& os = std::cerr;
1959 os <<
"Procedure map\n";
1961 it != m_procMap->end(); ++it) {
1963 os <<
" --> " << hex <<
"Ox" << it->second << dec << endl;
1968 os <<
"Statement map\n";
1970 it != m_stmtMap->end(); ++it) {
1972 os <<
" --> " << hex <<
"Ox" << it->second << dec << endl;
2000 for (sibling = dynamic_cast<ACodeNode*>(prnt->
lastChild());
2002 Ref *ref =
dynamic_cast<Ref*
>(sibling);
2003 DIAG_Assert(ref == sibling,
"");
2008 if (sibling !=
NULL) {
void insertFileMap(File *file)
LM * findLM(const char *nm) const
virtual std::string XMLLineRange(uint oFlags) const
void Ctor(const char *filenm, ANode *parent)
bool overlaps(VMAInterval x) const
virtual std::ostream & writeXML(std::ostream &os=std::cout, uint oFlags=0, const char *pre="") const
virtual void CSV_dump(const Root &root, std::ostream &os=std::cout, const char *file_name=NULL, const char *proc_name=NULL, int lLevel=0) const
virtual std::ostream & dumpme(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
Group * ancestorGroup() const
virtual std::string codeName() const
static const std::string & ANodeTyToName(ANodeTy tp)
virtual std::string toXML(uint oFlags=0) const
void merge(const VMAIntervalSet &x)
string toStr(const int x, int base)
void checkLineRange(SrcFile::ln begLn, SrcFile::ln endLn)
std::string codeName_LM_F() const
std::string toString_id(uint oFlags=0) const
virtual std::string codeName() const
void insertProcMap(Proc *proc)
ACodeNode * ACodeNodeWithLine(SrcFile::ln ln) const
virtual std::string toXML(uint oFlags=0) const
#define dyn_cast_return(base, derived, expr)
ANode * ancestor(ANodeTy type) const
Proc & operator=(const Proc &x)
LM & operator=(const LM &x)
void expandLineRange(SrcFile::ln begLn, SrcFile::ln endLn, int propagate=1)
bool include(SrcFile::ln beg1, SrcFile::ln end1, SrcFile::ln beg2, SrcFile::ln end2)
static ANodeTy IntToANodeTy(long i)
ACodeNode * nextSiblingNonOverlapping() const
virtual std::string codeName() const
const char * DIAG_Unimplemented
virtual std::string codeName() const
bool isValid(SrcFile::ln line)
File & operator=(const File &x)
virtual const std::string & name() const
virtual std::string codeName() const
bool equiv(bool p, bool q)
virtual std::string toXML(uint oFlags=0) const
void setLineRange(SrcFile::ln begLn, SrcFile::ln endLn, int propagate=1)
static bool verifyMap(VMAIntervalMap< T > *mp, const char *map_nm)
double metric(size_t mId) const
virtual const std::string & name() const
bool hasMetrics(uint mBegId=Metric::IData::npos, uint mEndId=Metric::IData::npos) const
void Ctor(ACodeNode *parent, const char *filenm, const char *procnm, const char *displaynm)
static RealPathMgr & singleton()
virtual std::ostream & dumpme(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
virtual std::ostream & writeXML(std::ostream &os=std::cout, uint oFlags=0, const char *pre="") const
map< VMA, ProcInfo * > ProcMap
ACodeNode * ACodeNodeParent() const
std::ostream & writeXML(std::ostream &os=std::cerr, uint oFlags=0) const
virtual const std::string & name() const
static File * demand(LM *lm, const std::string &filenm)
ANode * nextSibling() const
int compare(SrcFile::ln x, SrcFile::ln y)
virtual std::ostream & dumpme(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
std::string lineRange() const
const ANodeFilter ANodeTyFilter[ANode::TyNUMBER]
virtual std::string toXML(uint oFlags=0) const
virtual std::string toXML(uint oFlags=0) const
virtual std::ostream & dumpme(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
virtual std::ostream & writeXML(std::ostream &os=std::cout, uint oFlags=0, const char *pre="") const
virtual std::ostream & dumpme(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
const std::string & linkName() const
virtual std::string toXML(uint oFlags=0) const
void setFile(std::string filenm)
std::string MakeAttrStr(const char *x, int flags=ESC_TRUE)
virtual std::string codeName() const
virtual std::string codeName() const
void(* T)(int code, va_list_box *box, int put(int c, void *cl), void *cl, unsigned char flags[256], int width, int precision)
File * findFile(const char *nm) const
virtual std::string codeName() const
Proc * findProc(const char *name, const char *linkname=NULL) const
static int compare(const ACodeNode *x, const ACodeNode *y)
bool realpath(std::string &pathNm) const
virtual std::string XMLVMAIntervals(uint oFlags) const
map< VMA, GroupInfo * > GroupMap
virtual std::ostream & dumpme(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
void Ctor(const char *n, ACodeNode *parent, const char *ln, bool hasSym)
Stmt * findStmt(VMA vma) const
void CSV_DumpSelf(const Root &root, std::ostream &os=std::cout) const
static const std::string ScopeNames[TyNUMBER]
static int distance(ANode *ancestor, ANode *descendent)
virtual std::ostream & dumpme(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
Alien * ancestorAlien() const
SrcFile::ln begLine() const
Root & operator=(const Root &x)
void insertGroupMap(Group *grp)
Group * findGroup(const char *nm) const
virtual std::ostream & dumpme(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
virtual void CSV_dump(const Root &root, std::ostream &os=std::cout, const char *file_name=NULL, const char *proc_name=NULL, int lLevel=0) const
virtual const std::string & name() const
Root * ancestorRoot() const
File * ancestorFile() const
bool hasMetric(size_t mId) const
static bool mergePaths(ANode *lca, ANode *node_dst, ANode *node_src)
virtual std::string toXML(uint oFlags=0) const
static int cmpByLine(const void *x, const void *y)
Proc * findProc(VMA vma) const
void aggregateMetrics(uint mBegId, uint mEndId)
std::string toString() const
ANode * firstChild() const
Loop * ancestorLoop() const
const VMAIntervalSet & vmaSet() const
#define DIAG_DevMsg(level,...)
virtual std::ostream & dumpme(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
bool verifyStmtMap() const
My_t::const_iterator const_iterator
void Ctor(const char *nm)
virtual void CSV_dump(const Root &root, std::ostream &os=std::cout, const char *file_name=NULL, const char *proc_name=NULL, int lLevel=0) const
map< string, FileInfo * > FileMap
virtual std::ostream & dumpme(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
std::string toStringXML(uint oFlags=0, const char *pre="") const
Ref(ACodeNode *parent, int _begPos, int _endPos, const char *refName)
virtual std::string toXML(uint oFlags=0) const
ANode * lastChild() const
std::string toStringMe(uint oFlags=0, const char *pre="") const
ANode * prevSibling() const
RealPathMgr & s_realpathMgr
void Ctor(const char *nm, ANode *parent)
static LM * demand(Root *pgm, const std::string &lm_fnm)
double demandMetric(size_t mId, size_t size=0) const
virtual std::string toXML(uint oFlags=0) const
static bool isMergable(ANode *node_dst, ANode *node_src)
static ANode * leastCommonAncestor(ANode *n1, ANode *n2)
ACodeNode * ancestorProcCtxt() const
virtual void CSV_dump(const Root &root, std::ostream &os=std::cout, const char *file_name=NULL, const char *proc_name=NULL, int lLevel=0) const
virtual NonUniformDegreeTreeNode * Current() const
static const string XMLelements[ANode::TyNUMBER]
std::list< ANode * > ANodeList
SrcFile::ln endLine() const
static bool arePathsOverlapping(ANode *lca, ANode *desc1, ANode *desc2)
Stmt * ancestorStmt() const
static int cmpByName(const void *x, const void *y)
virtual const std::string & name() const
std::string MakeAttrNum(int x)
static const std::string & ANodeTyToXMLelement(ANodeTy tp)
void insertStmtMap(Stmt *stmt)
std::string toString() const
std::ostream & dump(std::ostream &os=std::cerr, uint oFlags=0) const
Alien & operator=(const Alien &x)
ACodeNode * findByVMA(VMA vma) const
iterator find(const key_type &toFind)
std::ostream & dump(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
virtual NonUniformDegreeTreeNode * Current() const
string basename(const char *fName)
void Ctor(const char *nm, ANode *parent)
virtual void CSV_dump(const Root &root, std::ostream &os=std::cout, const char *file_name=NULL, const char *proc_name=NULL, int lLevel=0) const
virtual std::ostream & dumpme(std::ostream &os=std::cerr, uint oFlags=0, const char *pre="") const
bool containsLine(SrcFile::ln ln) const
virtual std::string toXML(uint oFlags=0) const
virtual std::string toString(uint oFlags=0, const char *pre="") const
bool writeXML_pre(std::ostream &os=std::cout, uint oFlags=0, const char *prefix="") const
static Group * demand(Root *pgm, const std::string &nm, ANode *parent)
void linkAndSetLineRange(ACodeNode *parent)
virtual std::string toXML(uint oFlags=0) const
std::ostream & writeMetricsXML(std::ostream &os, const Mgr *metricMgr, uint mBegId=Metric::IData::npos, uint mEndId=Metric::IData::npos, int oFlags=0, const char *pfx="") const
<!-- ********************************************************************--> n<!-- HPCToolkit Experiment DTD --> n<!-- Version 2.1 --> n<!-- ********************************************************************--> n<!ELEMENT HPCToolkitExperiment(Header,(SecCallPathProfile|SecFlatProfile) *)> n<!ATTLIST HPCToolkitExperiment\n version CDATA #REQUIRED > n n<!-- ******************************************************************--> n n<!-- Info/NV:flexible name-value pairs:(n) ame;(t) ype;(v) alue --> n<!ELEMENT Info(NV *)> n<!ATTLIST Info\n n CDATA #IMPLIED > n<!ELEMENT NV EMPTY > n<!ATTLIST NV\n n CDATA #REQUIRED\n t CDATA #IMPLIED\n v CDATA #REQUIRED > n n<!-- ******************************************************************--> n<!-- Header --> n<!-- ******************************************************************--> n<!ELEMENT Header(Info *)> n<!ATTLIST Header\n n CDATA #REQUIRED > n n<!-- ******************************************************************--> n<!-- Section Header --> n<!-- ******************************************************************--> n<!ELEMENT SecHeader(MetricTable?, MetricDBTable?, TraceDBTable?, LoadModuleTable?, FileTable?, ProcedureTable?, Info *)> n n<!-- MetricTable:--> n<!ELEMENT MetricTable(Metric) * > n n<!-- Metric:(i) d;(n) ame --> n<!--(v) alue-type:transient type of values --> n<!--(t) ype:persistent type of metric --> n<!-- fmt:format;show;--> n<!ELEMENT Metric(MetricFormula *, Info?)> n<!ATTLIST Metric\n i CDATA #REQUIRED\n n CDATA #REQUIRED\n es CDATA #IMPLIED\n em CDATA #IMPLIED\n ep CDATA #IMPLIED\n v(raw|final|derived-incr|derived) \"raw\\ t (inclusive|exclusive|nil) \nil\\ partner CDATA #IMPLIED\ fmt CDATA #IMPLIED\ show (1|0) \1\\ show-percent (1|0) \1> n n<!-- MetricFormula represents derived metrics: (t)ype; (frm): formula --> n<!ELEMENT MetricFormula (Info?)> n<!ATTLIST MetricFormula\ t (combine|finalize) \finalize\\ i CDATA #IMPLIED\ frm CDATA #REQUIRED> n n<!-- Metric data, used in sections: (n)ame [from Metric]; (v)alue --> n<!ELEMENT M EMPTY> n<!ATTLIST M\ n CDATA #REQUIRED\ v CDATA #REQUIRED> n n<!-- MetricDBTable: --> n<!ELEMENT MetricDBTable (MetricDB)*> n n<!-- MetricDB: (i)d; (n)ame --> n<!-- (t)ype: persistent type of metric --> n<!-- db-glob: file glob describing files in metric db --> n<!-- db-id: id within metric db --> n<!-- db-num-metrics: number of metrics in db --> n<!-- db-header-sz: size (in bytes) of a db file header --> n<!ELEMENT MetricDB EMPTY> n<!ATTLIST MetricDB\ i CDATA #REQUIRED\ n CDATA #REQUIRED\ t (inclusive|exclusive|nil) \nil\\ partner CDATA #IMPLIED\ db-glob CDATA #IMPLIED\ db-id CDATA #IMPLIED\ db-num-metrics CDATA #IMPLIED\ db-header-sz CDATA #IMPLIED> n n<!-- TraceDBTable: --> n<!ELEMENT TraceDBTable (TraceDB)> n n<!-- TraceDB: (i)d --> n<!-- db-min-time: min beginning time stamp (global) --> n<!-- db-max-time: max ending time stamp (global) --> n<!ELEMENT TraceDB EMPTY> n<!ATTLIST TraceDB\ i CDATA #REQUIRED\ db-glob CDATA #IMPLIED\ db-min-time CDATA #IMPLIED\ db-max-time CDATA #IMPLIED\ db-header-sz CDATA #IMPLIED> n n<!-- LoadModuleTable assigns a short name to a load module --> n<!ELEMENT LoadModuleTable (LoadModule)*> n n<!ELEMENT LoadModule (Info?)> n<!ATTLIST LoadModule\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!-- FileTable assigns a short name to a file --> n<!ELEMENT FileTable (File)*> n n<!ELEMENT File (Info?)> n<!ATTLIST File\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!-- ProcedureTable assigns a short name to a procedure --> n<!ELEMENT ProcedureTable (Procedure)*> n n<!-- Info/NV: flexible name-value pairs: (n)ame; (t)ype; (v)alue --> n<!-- f: family of the procedure (fake, root, ...)--> n<!ELEMENT Procedure (Info?)> n<!ATTLIST Procedure\ i CDATA #REQUIRED\ n CDATA #REQUIRED\ f CDATA #IMPLIED> n n<!-- ****************************************************************** --> n<!-- Section: Call path profile --> n<!-- ****************************************************************** --> n<!ELEMENT SecCallPathProfile (SecHeader, SecCallPathProfileData)> n<!ATTLIST SecCallPathProfile\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!ELEMENT SecCallPathProfileData (PF|M)*> n<!-- Procedure frame --> n<!-- (i)d: unique identifier for cross referencing --> n<!-- (s)tatic scope id --> n<!-- (n)ame: a string or an id in ProcedureTable --> n<!-- (lm) load module: a string or an id in LoadModuleTable --> n<!-- (f)ile name: a string or an id in LoadModuleTable --> n<!-- (l)ine range: \beg-end\ (inclusive range) --> n<!-- (a)lien: whether frame is alien to enclosing P --> n<!-- (str)uct: hpcstruct node id --> n<!-- (t)ype: hpcrun node type: memory access, variable declaration, ... --> n<!-- (v)ma-range-set: \{[beg-end), [beg-end)...}\ --> n<!ELEMENT PF (PF|Pr|L|C|S|M)*> n<!ATTLIST PF\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ n CDATA #REQUIRED\ lm CDATA #IMPLIED\ f CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Procedure (static): GOAL: replace with 'P' --> n<!ELEMENT Pr (Pr|L|C|S|M)*> n<!ATTLIST Pr\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ n CDATA #REQUIRED\ lm CDATA #IMPLIED\ f CDATA #IMPLIED\ l CDATA #IMPLIED\ a (1|0) \0\\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Callsite (a special StatementRange) --> n<!ELEMENT C (PF|M)*> n<!ATTLIST C\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n n<!-- ****************************************************************** --> n<!-- Section: Flat profile --> n<!-- ****************************************************************** --> n<!ELEMENT SecFlatProfile (SecHeader, SecFlatProfileData)> n<!ATTLIST SecFlatProfile\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!ELEMENT SecFlatProfileData (LM|M)*> n<!-- Load module: (i)d; (n)ame; (v)ma-range-set --> n<!ELEMENT LM (F|P|M)*> n<!ATTLIST LM\ i CDATA #IMPLIED\ n CDATA #REQUIRED\ v CDATA #IMPLIED> n<!-- File --> n<!ELEMENT F (P|L|S|M)*> n<!ATTLIST F\ i CDATA #IMPLIED\ n CDATA #REQUIRED> n<!-- Procedure (Note 1) --> n<!ELEMENT P (P|A|L|S|C|M)*> n<!ATTLIST P\ i CDATA #IMPLIED\ n CDATA #REQUIRED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Alien (Note 1) --> n<!ELEMENT A (A|L|S|C|M)*> n<!ATTLIST A\ i CDATA #IMPLIED\ f CDATA #IMPLIED\ n CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Loop (Note 1,2) --> n<!ELEMENT L (A|Pr|L|S|C|M)*> n<!ATTLIST L\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ f CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Statement (Note 2) --> n<!-- (it): trace record identifier --> n<!ELEMENT S (S|M)*> n<!ATTLIST S\ i CDATA #IMPLIED\ it CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Note 1: Contained Cs may not contain PFs --> n<!-- Note 2: The 's' attribute is not used for flat profiles --> n
virtual const std::string & name() const
Proc * ancestorProc() const
ACodeNode(ANodeTy ty, ANode *parent=NULL, SrcFile::ln begLn=ln_NULL, SrcFile::ln endLn=ln_NULL, VMA begVMA=0, VMA endVMA=0)
void buildMap(VMAIntervalMap< T > *&mp, ANode::ANodeTy ty) const
void CSV_TreeDump(std::ostream &os=std::cout) const
static bool merge(ANode *node_dst, ANode *node_src)
static Proc * demand(File *file, const std::string &name, const std::string &linkname, SrcFile::ln begLn=ln_NULL, SrcFile::ln endLn=ln_NULL, bool *didCreate=NULL)
void writeXML_post(std::ostream &os=std::cout, uint oFlags=0, const char *prefix="") const