Index: components/metrics/serialization/serialization_utils.cc |
diff --git a/components/metrics/serialization/serialization_utils.cc b/components/metrics/serialization/serialization_utils.cc |
index d57b51b2c08f09e3c9f87dacc146f40a11f4d8d3..c786f79a10a664e1eef36fe24852bf4dff4eb284 100644 |
--- a/components/metrics/serialization/serialization_utils.cc |
+++ b/components/metrics/serialization/serialization_utils.cc |
@@ -122,7 +122,7 @@ void SerializationUtils::ReadAndTruncateMetricsFromFile( |
result = stat(filename.c_str(), &stat_buf); |
if (result < 0) { |
if (errno != ENOENT) |
- DPLOG(ERROR) << filename << ": bad metrics file stat"; |
+ DPLOG(ERROR) << filename << ": bad metrics file stat" << " : " << errno; |
ostap
2015/04/06 22:12:34
Please, make message consistent - filename after m
|
// Nothing to collect---try later. |
return; |
@@ -133,12 +133,12 @@ void SerializationUtils::ReadAndTruncateMetricsFromFile( |
} |
base::ScopedFD fd(open(filename.c_str(), O_RDWR)); |
if (fd.get() < 0) { |
- DPLOG(ERROR) << filename << ": cannot open"; |
+ DPLOG(ERROR) << " cannot open: " << filename << " : " << errno; |
return; |
} |
result = flock(fd.get(), LOCK_EX); |
if (result < 0) { |
- DPLOG(ERROR) << filename << ": cannot lock"; |
+ DPLOG(ERROR) << "cannot lock: " << filename << " : " << errno; |
return; |
} |
@@ -157,11 +157,11 @@ void SerializationUtils::ReadAndTruncateMetricsFromFile( |
result = ftruncate(fd.get(), 0); |
if (result < 0) |
- DPLOG(ERROR) << "truncate metrics log"; |
+ DPLOG(ERROR) << "truncate metrics log: " << filename << " : " << errno; |
result = flock(fd.get(), LOCK_UN); |
if (result < 0) |
- DPLOG(ERROR) << "unlock metrics log"; |
+ DPLOG(ERROR) << "unlock metrics log: " << filename << " : " << errno; |
} |
bool SerializationUtils::WriteMetricToFile(const MetricSample& sample, |
@@ -174,7 +174,7 @@ bool SerializationUtils::WriteMetricToFile(const MetricSample& sample, |
READ_WRITE_ALL_FILE_FLAGS)); |
if (file_descriptor.get() < 0) { |
- DLOG(ERROR) << "error openning the file"; |
+ DLOG(ERROR) << "error openning the file: " << filename << " : " << errno; |
return false; |
} |
@@ -190,7 +190,7 @@ bool SerializationUtils::WriteMetricToFile(const MetricSample& sample, |
std::string msg = sample.ToString(); |
int32 size = msg.length() + sizeof(int32); |
if (size > kMessageMaxLength) { |
- DLOG(ERROR) << "cannot write message: too long"; |
+ DLOG(ERROR) << "cannot write message: too long" << " : " << errno; |
return false; |
} |
@@ -199,13 +199,13 @@ bool SerializationUtils::WriteMetricToFile(const MetricSample& sample, |
if (!base::WriteFileDescriptor(file_descriptor.get(), |
reinterpret_cast<char*>(&size), |
sizeof(size))) { |
- DPLOG(ERROR) << "error writing message length"; |
+ DPLOG(ERROR) << "error writing message length" << " : " << errno; |
return false; |
} |
if (!base::WriteFileDescriptor( |
file_descriptor.get(), msg.c_str(), msg.size())) { |
- DPLOG(ERROR) << "error writing message"; |
+ DPLOG(ERROR) << "error writing message" << " : " << errno; |
return false; |
} |