mirror of
https://gitee.com/openharmony/developtools_hiperf
synced 2024-11-23 07:29:42 +00:00
commit
b010125caf
@ -512,6 +512,12 @@ bool PerfEvents::StartTracking(bool immediately)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (recordCallBack_) {
|
||||
if (!PrepareRecordThread()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
HLOGD("step: 1. enable event");
|
||||
trackingStartTime_ = steady_clock::now();
|
||||
if (immediately) {
|
||||
@ -521,12 +527,6 @@ bool PerfEvents::StartTracking(bool immediately)
|
||||
}
|
||||
}
|
||||
|
||||
if (recordCallBack_) {
|
||||
if (!PrepareRecordThread()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (immediately) {
|
||||
printf("Profiling duration is %.3f seconds.\n", float(timeOut_.count()) / THOUSANDS);
|
||||
printf("Start Profiling...\n");
|
||||
@ -547,14 +547,15 @@ bool PerfEvents::StartTracking(bool immediately)
|
||||
StatLoop();
|
||||
}
|
||||
|
||||
HLOGD("step: 3. disable event");
|
||||
if (!PerfEventsEnable(false)) {
|
||||
HLOGE("PerfEvents::PerfEventsEnable() failed");
|
||||
}
|
||||
if (recordCallBack_) {
|
||||
// read left samples after disable events
|
||||
ReadRecordsFromMmaps();
|
||||
}
|
||||
|
||||
HLOGD("step: 3. disable event");
|
||||
if (!PerfEventsEnable(false)) {
|
||||
HLOGE("PerfEvents::PerfEventsEnable() failed");
|
||||
}
|
||||
trackingEndTime_ = steady_clock::now();
|
||||
|
||||
RecoverCaptureSig();
|
||||
|
Loading…
Reference in New Issue
Block a user