mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 735262. Make leaf address printing saner. r=bgirard
We don't need to store an mLeafAddress field for each profile entry. Instead just add a 'l' tag for the leaf entries.
This commit is contained in:
parent
7a414c7e1e
commit
9c450cf671
@ -119,33 +119,27 @@ class ProfileEntry
|
||||
public:
|
||||
ProfileEntry()
|
||||
: mTagData(NULL)
|
||||
, mLeafAddress(0)
|
||||
, mTagName(0)
|
||||
{ }
|
||||
|
||||
// aTagData must not need release (i.e. be a string from the text segment)
|
||||
ProfileEntry(char aTagName, const char *aTagData)
|
||||
: mTagData(aTagData)
|
||||
, mLeafAddress(0)
|
||||
, mTagName(aTagName)
|
||||
{ }
|
||||
|
||||
// aTagData must not need release (i.e. be a string from the text segment)
|
||||
ProfileEntry(char aTagName, const char *aTagData, Address aLeafAddress)
|
||||
: mTagData(aTagData)
|
||||
, mLeafAddress(aLeafAddress)
|
||||
, mTagName(aTagName)
|
||||
{ }
|
||||
|
||||
ProfileEntry(char aTagName, double aTagFloat)
|
||||
: mTagFloat(aTagFloat)
|
||||
, mLeafAddress(0)
|
||||
, mTagName(aTagName)
|
||||
{ }
|
||||
|
||||
ProfileEntry(char aTagName, uintptr_t aTagOffset)
|
||||
: mTagOffset(aTagOffset)
|
||||
, mLeafAddress(0)
|
||||
, mTagName(aTagName)
|
||||
{ }
|
||||
|
||||
ProfileEntry(char aTagName, Address aTagAddress)
|
||||
: mTagAddress(aTagAddress)
|
||||
, mTagName(aTagName)
|
||||
{ }
|
||||
|
||||
@ -159,7 +153,6 @@ private:
|
||||
Address mTagAddress;
|
||||
uintptr_t mTagOffset;
|
||||
};
|
||||
Address mLeafAddress;
|
||||
char mTagName;
|
||||
};
|
||||
|
||||
@ -582,15 +575,17 @@ void doSampleStackTrace(ProfileStack *aStack, ThreadProfile &aProfile, TickSampl
|
||||
// followed by 0 or more 'c' tags.
|
||||
for (mozilla::sig_safe_t i = 0; i < aStack->mStackPointer; i++) {
|
||||
if (i == 0) {
|
||||
Address pc = 0;
|
||||
if (sample) {
|
||||
pc = sample->pc;
|
||||
}
|
||||
aProfile.addTag(ProfileEntry('s', aStack->mStack[i], pc));
|
||||
aProfile.addTag(ProfileEntry('s', aStack->mStack[i]));
|
||||
} else {
|
||||
aProfile.addTag(ProfileEntry('c', aStack->mStack[i]));
|
||||
}
|
||||
}
|
||||
#ifdef ENABLE_SPS_LEAF_DATA
|
||||
if (sample) {
|
||||
Address pc = sample->pc;
|
||||
aProfile.addTag(ProfileEntry('l', sample->pc));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* used to keep track of the last event that we sampled during */
|
||||
@ -679,12 +674,6 @@ std::ostream& operator<<(std::ostream& stream, const ProfileEntry& entry)
|
||||
} else {
|
||||
stream << entry.mTagName << "-" << entry.mTagData << "\n";
|
||||
}
|
||||
|
||||
#ifdef ENABLE_SPS_LEAF_DATA
|
||||
if (entry.mLeafAddress) {
|
||||
stream << entry.mTagName << "-" << entry.mLeafAddress << "\n";
|
||||
}
|
||||
#endif
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user