Chromium Code Reviews| Index: chrome/browser/chromeos/system_logs/command_line_log_source.cc |
| diff --git a/chrome/browser/chromeos/system_logs/command_line_log_source.cc b/chrome/browser/chromeos/system_logs/command_line_log_source.cc |
| index de59f36d427e109213eeb145bf92be6142eb8cb4..31bed14bbe01838290dc770558da1ef9e9923cb9 100644 |
| --- a/chrome/browser/chromeos/system_logs/command_line_log_source.cc |
| +++ b/chrome/browser/chromeos/system_logs/command_line_log_source.cc |
| @@ -14,6 +14,7 @@ |
| #include "base/files/file_path.h" |
| #include "base/logging.h" |
| #include "base/process/launch.h" |
| +#include "base/sys_info.h" |
| #include "content/public/browser/browser_thread.h" |
| using content::BrowserThread; |
| @@ -66,13 +67,18 @@ void ExecuteCommandLines(system_logs::SystemLogsResponse* response) { |
| commands.push_back(std::make_pair("modetest", command)); |
| #endif |
| - // Get a list of file sizes for the logged in user (excluding the names of |
| - // the files in the Downloads directory for privay reasons). |
| - command = base::CommandLine(base::FilePath("/bin/sh")); |
| - command.AppendArg("-c"); |
| - command.AppendArg("/usr/bin/du -h /home/chronos/user |" |
| - " grep -v -e \\/home\\/chronos\\/user\\/Downloads\\/"); |
| - commands.push_back(std::make_pair("user_files", command)); |
| + // Get a list of file sizes for the whole system (excluding the names of the |
| + // files in the Downloads directory for privay reasons). |
| + if (base::SysInfo::IsRunningOnChromeOS()) { |
| + // The following command would hang if run in Linux Chrome OS build on a |
| + // Linux Workstation. |
| + command = base::CommandLine(base::FilePath("/bin/sh")); |
| + command.AppendArg("-c"); |
| + command.AppendArg( |
| + "/usr/bin/du -h / |" |
| + " grep -v -e \\/home\\/chronos\\/.*\\/Downloads\\/"); |
|
Rahul Chaturvedi
2016/12/08 00:17:02
This might need to be everything under /home/.*/Do
afakhry
2016/12/08 00:30:51
You're right. /home/user/<hash>/Downloads still ne
|
| + commands.push_back(std::make_pair("system_files", command)); |
| + } |
| // Get disk space usage information |
| command = base::CommandLine(base::FilePath("/bin/df")); |