Bug 711491. Remove WriteTag. r=bgirard

Just use .TagToString() and fwrite that instead
of having a separate function.

--HG--
extra : rebase_source : 410d052883778de3db85d4573707b040760376ca
This commit is contained in:
Jeff Muizelaar 2011-12-16 09:12:46 -05:00
parent 646eecefb9
commit 6dffa3a7cd

View File

@ -116,7 +116,6 @@ public:
{ }
string TagToString(Profile *profile);
void WriteTag(Profile *profile, FILE* stream);
private:
union {
@ -186,7 +185,8 @@ public:
int oldReadPos = mReadPos;
while (mReadPos != mWritePos) {
mEntries[mReadPos].WriteTag(this, stream);
string tag = mEntries[mReadPos].TagToString(this);
fwrite(tag.data(), 1, tag.length(), stream);
mReadPos = (mReadPos + 1) % mEntrySize;
}
mReadPos = oldReadPos;
@ -377,33 +377,6 @@ string ProfileEntry::TagToString(Profile *profile)
return tag;
}
void ProfileEntry::WriteTag(Profile *profile, FILE *stream)
{
fprintf(stream, "%c-%s\n", mTagName, mTagData);
#ifdef ENABLE_SPS_LEAF_DATA
if (mLeafAddress) {
bool found = false;
SharedLibraryInfo& shlibInfo = profile->getSharedLibraryInfo();
unsigned long pc = (unsigned long)mLeafAddress;
// TODO Use binary sort (STL)
for (size_t i = 0; i < shlibInfo.GetSize(); i++) {
SharedLibrary &e = shlibInfo.GetEntry(i);
if (pc > e.GetStart() && pc < e.GetEnd()) {
if (e.GetName()) {
found = true;
fprintf(stream, "l-%s@%li\n", e.GetName(), pc - e.GetStart());
break;
}
}
}
if (!found) {
fprintf(stream, "l-???@%li\n", pc);
}
}
#endif
}
#define PROFILE_DEFAULT_ENTRY 100000
#define PROFILE_DEFAULT_INTERVAL 10