[PR] Instrumentation: Sync file on dump

Summary:
Sync the file with storage device on data dump to stabilize
instrumentation testing

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei

(cherry picked from FBD31738021)
This commit is contained in:
Vladislav Khmelevsky
2021-10-15 20:46:09 +03:00
committed by Maksim Panchenko
parent 2d431eefbf
commit dcdd37fdc2
2 changed files with 12 additions and 0 deletions

View File

@@ -1485,6 +1485,7 @@ __bolt_instr_data_dump() {
writeIndirectCallProfile(FD, Ctx);
Ctx.CallFlowTable->forEachElement(visitCallFlowEntry, FD, &Ctx);
__fsync(FD);
__close(FD);
__munmap(Ctx.MMapPtr, Ctx.MMapSize);
__close(Ctx.FileDesc);
@@ -1509,6 +1510,7 @@ void watchProcess() {
ppid = __getppid();
if (ppid == 1) {
// Parent already dead
__bolt_instr_data_dump();
goto out;
}
}