SWDEV-276853 - Add kernelVerify

Add kernelVerify for data verification and memory
reading performance checking in kernel.

Change-Id: Id3f9bcad75d643f493daf9d5f47b3a012a427179


[ROCm/hip commit: 9ba66fc157]
This commit is contained in:
Tao Sang
2021-05-26 23:14:45 -04:00
committed by Tao Sang
parent bbd07b0bd9
commit 230088d790
2 changed files with 114 additions and 34 deletions
@@ -134,6 +134,21 @@ struct CaptureStream {
assert(false);
}
}
// Truncate the file up to size if we don't want too long log
void Truncate(size_t size) {
struct stat sb = { 0 };
if (::stat(tempname, &sb) == -1) {
failed("failed lstat(%s) with error: %s \n", tempname, ::strerror(errno));
return;
}
if (sb.st_size > size) {
if (::truncate(tempname, static_cast<off_t>(size)) == -1) {
failed("failed truncate(%s) with error: %s \n", tempname, ::strerror(errno));
return;
}
}
}
};
#endif