mirror of
https://gitee.com/openharmony/arkcompiler_toolchain
synced 2024-11-27 17:50:33 +00:00
fix bug for lastobjectid
Signed-off-by: cwx1148594 <caolili14@huawei.com>
This commit is contained in:
parent
0c385b18b3
commit
c084996837
@ -230,7 +230,7 @@ void HeapProfilerImpl::Frontend::HeapStatsUpdate(HeapStat* updateData, int32_t c
|
||||
channel_->SendNotification(heapStatsUpdate);
|
||||
}
|
||||
|
||||
void HeapProfilerImpl::Frontend::LastSeenObjectId(int32_t lastSeenObjectId)
|
||||
void HeapProfilerImpl::Frontend::LastSeenObjectId(int32_t lastSeenObjectId, int64_t timeStampUs)
|
||||
{
|
||||
if (!AllowNotify()) {
|
||||
return;
|
||||
@ -238,12 +238,8 @@ void HeapProfilerImpl::Frontend::LastSeenObjectId(int32_t lastSeenObjectId)
|
||||
|
||||
tooling::LastSeenObjectId lastSeenObjectIdEvent;
|
||||
lastSeenObjectIdEvent.SetLastSeenObjectId(lastSeenObjectId);
|
||||
int64_t timestamp = 0;
|
||||
struct timeval tv = {0, 0};
|
||||
gettimeofday(&tv, nullptr);
|
||||
const int THOUSAND = 1000;
|
||||
timestamp = static_cast<int64_t>(tv.tv_usec + tv.tv_sec * THOUSAND * THOUSAND);
|
||||
double timestampMS = static_cast<double>(timestamp) / THOUSAND;
|
||||
double timestampMS = static_cast<double>(timeStampUs) / THOUSAND;
|
||||
lastSeenObjectIdEvent.SetTimestamp(timestampMS);
|
||||
channel_->SendNotification(lastSeenObjectIdEvent);
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ private:
|
||||
void AddHeapSnapshotChunk(char *data, int32_t size);
|
||||
void ReportHeapSnapshotProgress(int32_t done, int32_t total);
|
||||
void HeapStatsUpdate(HeapStat* updateData, int32_t count);
|
||||
void LastSeenObjectId(int32_t lastSeenObjectId);
|
||||
void LastSeenObjectId(int32_t lastSeenObjectId, int64_t timeStampUs);
|
||||
void ResetProfiles();
|
||||
|
||||
private:
|
||||
@ -136,12 +136,12 @@ private:
|
||||
frontend_->HeapStatsUpdate(updateData, count);
|
||||
}
|
||||
|
||||
void UpdateLastSeenObjectId(int32_t lastSeenObjectId) override
|
||||
void UpdateLastSeenObjectId(int32_t lastSeenObjectId, int64_t timeStampUs) override
|
||||
{
|
||||
if (!Good()) {
|
||||
return;
|
||||
}
|
||||
frontend_->LastSeenObjectId(lastSeenObjectId);
|
||||
frontend_->LastSeenObjectId(lastSeenObjectId, timeStampUs);
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user