Merge "dumpstate: improved collection, better error handling."
This commit is contained in:
@@ -143,7 +143,7 @@ static void dumpstate() {
|
||||
dump_file("BINDER STATS", "/sys/kernel/debug/binder/stats");
|
||||
dump_file("BINDER STATE", "/sys/kernel/debug/binder/state");
|
||||
|
||||
run_command("FILESYSTEMS & FREE SPACE", 10, "df", NULL);
|
||||
run_command("FILESYSTEMS & FREE SPACE", 10, "su", "root", "df", NULL);
|
||||
|
||||
dump_file("PACKAGE SETTINGS", "/data/system/packages.xml");
|
||||
dump_file("PACKAGE UID ERRORS", "/data/system/uiderrors.txt");
|
||||
|
||||
@@ -167,6 +167,7 @@ int run_command(const char *title, int timeout_seconds, const char *command, ...
|
||||
|
||||
execvp(command, (char**) args);
|
||||
printf("*** exec(%s): %s\n", command, strerror(errno));
|
||||
fflush(stdout);
|
||||
_exit(-1);
|
||||
}
|
||||
|
||||
@@ -178,7 +179,7 @@ int run_command(const char *title, int timeout_seconds, const char *command, ...
|
||||
if (p == pid) {
|
||||
if (WIFSIGNALED(status)) {
|
||||
printf("*** %s: Killed by signal %d\n", command, WTERMSIG(status));
|
||||
} else if (WEXITSTATUS(status) > 0) {
|
||||
} else if (WIFEXITED(status) && WEXITSTATUS(status) > 0) {
|
||||
printf("*** %s: Exit code %d\n", command, WEXITSTATUS(status));
|
||||
}
|
||||
if (title) printf("[%s: %.1fs elapsed]\n\n", command, elapsed);
|
||||
|
||||
Reference in New Issue
Block a user