75 #ifdef NO_STD_CHEADERS 112 const string& func,
const string& file);
140 os <<
"<PROFILE version=\"3.0\">\n";
141 os <<
"<PROFILEHDR>\n" << rawprofData->
GetHdrInfo() <<
"</PROFILEHDR>\n";
142 os <<
"<PROFILEPARAMS>\n";
144 os <<
"<TARGET name";
WriteAttrStr(os, profiledFile); os <<
"/>\n";
157 os <<
"</METRICS>\n";
158 os <<
"</PROFILEPARAMS>\n";
166 os <<
"<PROFILESCOPETREE>\n";
167 os <<
"<PGM n";
WriteAttrStr(os, profiledFile); os <<
">\n";
171 string theFunc, theFile;
177 VMA oppc = it.Current();
186 lm->findSrcCodeInfo(pc, opIndex, func, file, line);
187 func = GetBestFuncName(func);
195 if (func.empty()) { func =
UNKNOWN; }
199 if (!theFile.empty() && func == theFunc && func !=
UNKNOWN) {
209 if (func != theFunc) {
219 if (it1 == funcLineMap.end()) {
232 if (dm->
FindPC(pc, opIndex)) {
234 for ( ; mIt.
IsValid(); ++mIt) {
236 (*vec)[i] += m->
Find(pc, opIndex);
241 if (theFunc != func) { theFunc = func; }
242 if (theFile != file) { theFile = file; }
248 if (funcLineMap.size() > 0) {
254 os <<
"</PROFILESCOPETREE>\n";
259 os <<
"</PROFILE>\n";
269 const char *PROFILEdtd =
270 #include <lib/xml/PROFILE.dtd.h> 275 os <<
"<?xml version=\"1.0\"?>" << endl;
276 os <<
"<!DOCTYPE PROFILE [\n" << PROFILEdtd <<
"]>" << endl;
290 const string& func,
const string& file)
292 static const char* I[] = {
"",
299 if (map.size() == 0) {
return; }
301 os << I[1] <<
"<F n";
WriteAttrStr(os, file); os <<
">\n";
302 os << I[2] <<
"<P n";
WriteAttrStr(os, func); os <<
">\n";
305 for (it = map.begin(); it != map.end(); ++it) {
312 for (
unsigned int i = 0; i < vec->
GetSz(); ++i) {
313 if ( (*vec)[i] != 0 ) {
315 double v = (double)(*vec)[i] * (double)dm->
GetPeriod();
322 os << I[3] <<
"</S>" << endl;
325 os << I[2] <<
"</P>" << endl;
326 os << I[1] <<
"</F>\n";
332 for (it = map.begin(); it != map.end(); ++it) {
unsigned int GetNumMetrics() const
PCProfileDatum Find(VMA pc, ushort opIndex) const
unsigned int GetSz() const
const std::string & GetNativeName() const
void ClearFuncLineMap(LineToPCProfileVecMap &map)
const std::string & GetName() const
bool isValid(SrcFile::ln line)
const PCProfileMetricSet * GetMetricSet() const
void DumpFuncLineMap(ostream &os, LineToPCProfileVecMap &map, DerivedProfile *profData, const string &func, const string &file)
const std::string & GetHdrInfo() const
bool WriteAttrStr(std::ostream &os, const char *s, int flags=ESC_TRUE)
DerivedProfileMetric * Current() const
static void WriteProfile(std::ostream &os, DerivedProfile *profData, binutils::LM *lm)
const PCProfile * GetPCProfile() const
std::map< SrcFile::ln, PCProfileVec * > LineToPCProfileVecMap
LineToPCProfileVecMap::iterator LineToPCProfileVecMapIt
unsigned short int ushort
bool WriteAttrNum(std::ostream &os, T n)
const DerivedProfileMetric * GetMetric(unsigned int i) const
static void DumpProfileFooter(std::ostream &os)
PCProfileMetric * Current() const
bool FindPC(VMA pc, ushort opIndex)
static void DumpProfileHeader(std::ostream &os)
virtual VMA convertOpVMAToVMA(VMA opvma, ushort &opIndex) const
LineToPCProfileVecMap::value_type LineToPCProfileVecMapVal
const std::string & GetProfiledFile() const