mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-07 08:03:29 +00:00
!1699 fix some bugs for heapstatsupdate event
Merge pull request !1699 from Riachel/master
This commit is contained in:
commit
0808ad92c9
@ -119,14 +119,7 @@ bool HeapSnapshot::FinishSnapshot()
|
||||
|
||||
void HeapSnapshot::RecordSampleTime()
|
||||
{
|
||||
uint32_t len = timeStamps_.size();
|
||||
if (len > 0) {
|
||||
if (sequenceId_ != timeStamps_[len - 1U].GetLastSequenceId()) {
|
||||
timeStamps_.emplace_back(sequenceId_);
|
||||
}
|
||||
} else {
|
||||
timeStamps_.emplace_back(sequenceId_);
|
||||
}
|
||||
timeStamps_.emplace_back(sequenceId_ + SEQ_STEP);
|
||||
}
|
||||
|
||||
void HeapSnapshot::PushHeapStat(Stream* stream)
|
||||
@ -166,7 +159,7 @@ void HeapSnapshot::PushHeapStat(Stream* stream)
|
||||
stream->UpdateHeapStats(&statsBuffer.front(), static_cast<int32_t>(statsBuffer.size()));
|
||||
statsBuffer.clear();
|
||||
}
|
||||
stream->UpdateLastSeenObjectId(sequenceId);
|
||||
stream->UpdateLastSeenObjectId(sequenceId_);
|
||||
}
|
||||
|
||||
void HeapSnapshot::AddNode(TaggedObject* address)
|
||||
|
@ -226,7 +226,8 @@ void HeapProfilerImpl::Frontend::LastSeenObjectId(int32_t lastSeenObjectId)
|
||||
gettimeofday(&tv, nullptr);
|
||||
const int THOUSAND = 1000;
|
||||
timestamp = static_cast<int64_t>(tv.tv_usec + tv.tv_sec * THOUSAND * THOUSAND);
|
||||
lastSeenObjectIdEvent.SetTimestamp(timestamp);
|
||||
double timestampMS = static_cast<double>(timestamp) / THOUSAND;
|
||||
lastSeenObjectIdEvent.SetTimestamp(timestampMS);
|
||||
channel_->SendNotification(lastSeenObjectIdEvent);
|
||||
}
|
||||
|
||||
|
@ -992,12 +992,12 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
int64_t GetTimestamp() const
|
||||
double GetTimestamp() const
|
||||
{
|
||||
return timestamp_;
|
||||
}
|
||||
|
||||
LastSeenObjectId &SetTimestamp(int64_t timestamp)
|
||||
LastSeenObjectId &SetTimestamp(double timestamp)
|
||||
{
|
||||
timestamp_ = timestamp;
|
||||
return *this;
|
||||
@ -1008,7 +1008,7 @@ private:
|
||||
NO_MOVE_SEMANTIC(LastSeenObjectId);
|
||||
|
||||
int32_t lastSeenObjectId_ {};
|
||||
int64_t timestamp_ {};
|
||||
double timestamp_ {};
|
||||
};
|
||||
|
||||
class ReportHeapSnapshotProgress final : public PtBaseEvents {
|
||||
|
Loading…
Reference in New Issue
Block a user