diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-26 21:48:00 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-26 21:48:00 +0000 |
commit | a42d4638f0335dbfd14c1c9f6b05a7b09703a78e (patch) | |
tree | 96d7687e21b42cd5b5de4b23b2a1da472572e60c /base/process_util_linux.cc | |
parent | 1b5eee12138e3963415453974c824472429c4d80 (diff) | |
download | chromium_src-a42d4638f0335dbfd14c1c9f6b05a7b09703a78e.zip chromium_src-a42d4638f0335dbfd14c1c9f6b05a7b09703a78e.tar.gz chromium_src-a42d4638f0335dbfd14c1c9f6b05a7b09703a78e.tar.bz2 |
Replace most LOG/CHECK statements with DLOG/DCHECK statements in base.
[ Reland of 107042 http://codereview.chromium.org/8368009 ]
I tried hard not to change CHECKs that had side effects. I kept fatal checks
that seemed security or debugging-info (in crash reports) sensitive, and ones
that seems particularly well-conceived.
Review URL: http://codereview.chromium.org/8341026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_linux.cc')
-rw-r--r-- | base/process_util_linux.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc index f9d151b..2f433d9 100644 --- a/base/process_util_linux.cc +++ b/base/process_util_linux.cc @@ -84,7 +84,7 @@ int GetProcessCPU(pid_t pid) { DIR* dir = opendir(path.value().c_str()); if (!dir) { - PLOG(ERROR) << "opendir(" << path.value() << ")"; + DPLOG(ERROR) << "opendir(" << path.value() << ")"; return -1; } @@ -273,7 +273,7 @@ ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) { size_t ProcessMetrics::GetPagefileUsage() const { std::vector<std::string> proc_stats; if (!GetProcStats(process_, &proc_stats)) - LOG(WARNING) << "Failed to get process stats."; + DLOG(WARNING) << "Failed to get process stats."; const size_t kVmSize = 22; if (proc_stats.size() > kVmSize) { int vm_size; @@ -287,7 +287,7 @@ size_t ProcessMetrics::GetPagefileUsage() const { size_t ProcessMetrics::GetPeakPagefileUsage() const { std::vector<std::string> proc_stats; if (!GetProcStats(process_, &proc_stats)) - LOG(WARNING) << "Failed to get process stats."; + DLOG(WARNING) << "Failed to get process stats."; const size_t kVmPeak = 21; if (proc_stats.size() > kVmPeak) { int vm_peak; @@ -301,7 +301,7 @@ size_t ProcessMetrics::GetPeakPagefileUsage() const { size_t ProcessMetrics::GetWorkingSetSize() const { std::vector<std::string> proc_stats; if (!GetProcStats(process_, &proc_stats)) - LOG(WARNING) << "Failed to get process stats."; + DLOG(WARNING) << "Failed to get process stats."; const size_t kVmRss = 23; if (proc_stats.size() > kVmRss) { int num_pages; @@ -315,7 +315,7 @@ size_t ProcessMetrics::GetWorkingSetSize() const { size_t ProcessMetrics::GetPeakWorkingSetSize() const { std::vector<std::string> proc_stats; if (!GetProcStats(process_, &proc_stats)) - LOG(WARNING) << "Failed to get process stats."; + DLOG(WARNING) << "Failed to get process stats."; const size_t kVmHwm = 23; if (proc_stats.size() > kVmHwm) { int num_pages; @@ -576,14 +576,14 @@ bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) { FilePath meminfo_file("/proc/meminfo"); std::string meminfo_data; if (!file_util::ReadFileToString(meminfo_file, &meminfo_data)) { - LOG(WARNING) << "Failed to open /proc/meminfo."; + DLOG(WARNING) << "Failed to open /proc/meminfo."; return false; } std::vector<std::string> meminfo_fields; SplitStringAlongWhitespace(meminfo_data, &meminfo_fields); if (meminfo_fields.size() < kMemCachedIndex) { - LOG(WARNING) << "Failed to parse /proc/meminfo. Only found " << + DLOG(WARNING) << "Failed to parse /proc/meminfo. Only found " << meminfo_fields.size() << " fields."; return false; } @@ -752,7 +752,8 @@ bool AdjustOOMScore(ProcessId process, int score) { FilePath oom_file = oom_path.AppendASCII("oom_score_adj"); if (file_util::PathExists(oom_file)) { std::string score_str = base::IntToString(score); - VLOG(1) << "Adjusting oom_score_adj of " << process << " to " << score_str; + DVLOG(1) << "Adjusting oom_score_adj of " << process << " to " + << score_str; int score_len = static_cast<int>(score_str.length()); return (score_len == file_util::WriteFile(oom_file, score_str.c_str(), @@ -765,7 +766,7 @@ bool AdjustOOMScore(ProcessId process, int score) { if (file_util::PathExists(oom_file)) { std::string score_str = base::IntToString( score * kMaxOldOomScore / kMaxOomScore); - VLOG(1) << "Adjusting oom_adj of " << process << " to " << score_str; + DVLOG(1) << "Adjusting oom_adj of " << process << " to " << score_str; int score_len = static_cast<int>(score_str.length()); return (score_len == file_util::WriteFile(oom_file, score_str.c_str(), |