Skip to content

Commit

Permalink
Bug 1649233 - Add a new ProfilerMarkerPayload that is just a time dur…
Browse files Browse the repository at this point in the history
…ation. r=gerald,canaltinova

Differential Revision: https://phabricator.services.mozilla.com/D81592
  • Loading branch information
padenot committed Jun 30, 2020
1 parent 3d1fd6f commit ee148dc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tools/profiler/core/ProfilerMarkerPayload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() +
Expand Down
13 changes: 13 additions & 0 deletions tools/profiler/public/ProfilerMarkerPayload.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ee148dc

Please sign in to comment.