Merge "bootstat: Remove debug logging of bootstat_mtime_matches_content."
This commit is contained in:
commit
b5e530f720
2 changed files with 0 additions and 36 deletions
|
@ -46,24 +46,6 @@ bool ParseRecordEventTime(const std::string& path, int32_t* uptime) {
|
|||
|
||||
*uptime = file_stat.st_mtime;
|
||||
|
||||
// The following code (till function exit) is a debug test to ensure the
|
||||
// validity of the file mtime value, i.e., to check that the record file
|
||||
// mtime values are not changed once set.
|
||||
// TODO(jhawkins): Remove this code.
|
||||
std::string content;
|
||||
if (!android::base::ReadFileToString(path, &content)) {
|
||||
PLOG(ERROR) << "Failed to read " << path;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ignore existing bootstat records (which do not contain file content).
|
||||
if (!content.empty()) {
|
||||
int32_t value;
|
||||
if (android::base::ParseInt(content, &value)) {
|
||||
bootstat::LogHistogram("bootstat_mtime_matches_content", value == *uptime);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -89,16 +71,6 @@ void BootEventRecordStore::AddBootEventWithValue(
|
|||
return;
|
||||
}
|
||||
|
||||
// Writing the value as content in the record file is a debug measure to
|
||||
// ensure the validity of the file mtime value, i.e., to check that the record
|
||||
// file mtime values are not changed once set.
|
||||
// TODO(jhawkins): Remove this block.
|
||||
if (!android::base::WriteStringToFd(std::to_string(value), record_fd)) {
|
||||
PLOG(ERROR) << "Failed to write value to " << record_path;
|
||||
close(record_fd);
|
||||
return;
|
||||
}
|
||||
|
||||
// Fill out the stat structure for |record_path| in order to get the atime to
|
||||
// set in the utime() call.
|
||||
struct stat file_stat;
|
||||
|
|
|
@ -45,14 +45,6 @@ bool CreateEmptyBootEventRecord(const std::string& record_path, int32_t value) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Writing the value as content in the record file is a debug measure to
|
||||
// ensure the validity of the file mtime value, i.e., to check that the record
|
||||
// file mtime values are not changed once set.
|
||||
// TODO(jhawkins): Remove this block.
|
||||
if (!android::base::WriteStringToFd(std::to_string(value), record_fd)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the |mtime| of the file to store the value of the boot event while
|
||||
// preserving the |atime|.
|
||||
struct timeval atime = {/* tv_sec */ 0, /* tv_usec */ 0};
|
||||
|
|
Loading…
Reference in a new issue