Bug 1649233 - Add a new ProfilerMarkerPayload that is just a time duration. r=gerald,canaltinova

Differential Revision: https://phabricator.services.mozilla.com/D81592
This commit is contained in:
Paul Adenot 2020-06-30 14:25:09 +00:00
Родитель 3d1fd6f81d
Коммит ee148dcec6
2 изменённых файлов: 39 добавлений и 0 удалений

Просмотреть файл

@ -816,6 +816,32 @@ void GCSliceMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
}
}
ProfileBufferEntryWriter::Length BudgetMarkerPayload::TagAndSerializationBytes()
const {
return CommonPropsTagAndSerializationBytes();
}
void BudgetMarkerPayload::SerializeTagAndPayload(
ProfileBufferEntryWriter& aEntryWriter) const {
static const DeserializerTag tag = TagForDeserializer(Deserialize);
SerializeTagAndCommonProps(tag, aEntryWriter);
}
// static
UniquePtr<ProfilerMarkerPayload> BudgetMarkerPayload::Deserialize(
ProfileBufferEntryReader& aEntryReader) {
ProfilerMarkerPayload::CommonProps props =
DeserializeCommonProps(aEntryReader);
return UniquePtr<ProfilerMarkerPayload>(
new BudgetMarkerPayload(std::move(props)));
}
void BudgetMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
const TimeStamp& aProcessStartTime,
UniqueStacks& aUniqueStacks) const {
StreamCommonProps("Budget", aWriter, aProcessStartTime, aUniqueStacks);
}
ProfileBufferEntryWriter::Length
GCMajorMarkerPayload::TagAndSerializationBytes() const {
return CommonPropsTagAndSerializationBytes() +

Просмотреть файл

@ -228,6 +228,19 @@ class TracingMarkerPayload : public ProfilerMarkerPayload {
TracingKind mKind;
};
class BudgetMarkerPayload : public ProfilerMarkerPayload {
public:
BudgetMarkerPayload(const mozilla::TimeStamp& aStartTime,
const mozilla::TimeStamp& aEndTime)
: ProfilerMarkerPayload(aStartTime, aEndTime) {}
DECL_STREAM_PAYLOAD
private:
explicit BudgetMarkerPayload(CommonProps&& aCommonProps)
: ProfilerMarkerPayload(std::move(aCommonProps)) {}
};
class FileIOMarkerPayload : public ProfilerMarkerPayload {
public:
FileIOMarkerPayload(