diff options
Diffstat (limited to 'cmds/dumpstate/dumpstate.c')
-rw-r--r-- | cmds/dumpstate/dumpstate.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c index 1fbcef6..dc1ada0 100644 --- a/cmds/dumpstate/dumpstate.c +++ b/cmds/dumpstate/dumpstate.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include <dirent.h> #include <errno.h> #include <fcntl.h> #include <limits.h> @@ -75,6 +76,28 @@ static void get_tombstone_fds(tombstone_data_t data[NUM_TOMBSTONES]) { } } +static void dump_dev_files(const char *title, const char *driverpath, const char *filename) +{ + DIR *d; + struct dirent *de; + char path[PATH_MAX]; + + d = opendir(driverpath); + if (d == NULL) { + return; + } + + while ((de = readdir(d))) { + if (de->d_type != DT_LNK) { + continue; + } + snprintf(path, sizeof(path), "%s/%s/%s", driverpath, de->d_name, filename); + dump_file(title, path); + } + + closedir(d); +} + /* dumps the current system state to stdout */ static void dumpstate() { time_t now = time(NULL); @@ -107,7 +130,9 @@ static void dumpstate() { printf("Command line: %s\n", strtok(cmdline_buf, "\n")); printf("\n"); + dump_dev_files("TRUSTY VERSION", "/sys/bus/platform/drivers/trusty", "trusty_version"); run_command("UPTIME", 10, "uptime", NULL); + dump_file("MMC PERF", "/sys/block/mmcblk0/stat"); dump_file("MEMORY INFO", "/proc/meminfo"); run_command("CPU INFO", 10, "top", "-n", "1", "-d", "1", "-m", "30", "-t", NULL); run_command("PROCRANK", 20, "procrank", NULL); @@ -270,9 +295,6 @@ static void dumpstate() { run_command("FILESYSTEMS & FREE SPACE", 10, "df", NULL); - run_command("PACKAGE SETTINGS", 20, SU_PATH, "root", "cat", "/data/system/packages.xml", NULL); - dump_file("PACKAGE UID ERRORS", "/data/system/uiderrors.txt"); - run_command("LAST RADIO LOG", 10, "parse_radio_log", "/proc/last_radio_log", NULL); printf("------ BACKLIGHTS ------\n"); |