summaryrefslogtreecommitdiff
path: root/dumpstate
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2016-09-26 15:37:26 -0700
committerFelipe Leme <felipeal@google.com>2016-09-27 10:35:16 -0700
commitdb9b9d7aa9558d1e0a5499d745936d5b2c354e6b (patch)
tree4cfcbe1f7f186161c4330e45f8e416ac7613afb8 /dumpstate
parentdeaf6503cfd5ca6311b1cd47f10f988473650dbc (diff)
downloadbullhead-db9b9d7aa9558d1e0a5499d745936d5b2c354e6b.tar.gz
Uses new Dumpstate class functions on dumpstate_board().
BUG: 26379932 Test: manual / refactored code Change-Id: I510ceab33d714f4ded3f476c2e08bcb416d8ea70
Diffstat (limited to 'dumpstate')
-rw-r--r--dumpstate/dumpstate.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/dumpstate/dumpstate.cpp b/dumpstate/dumpstate.cpp
index ef6d6ff..74c2f06 100644
--- a/dumpstate/dumpstate.cpp
+++ b/dumpstate/dumpstate.cpp
@@ -18,22 +18,24 @@
void dumpstate_board()
{
- dump_file("INTERRUPTS", "/proc/interrupts");
- dump_file("RPM Stats", "/d/rpm_stats");
- dump_file("Power Management Stats", "/d/rpm_master_stats");
- run_command("SUBSYSTEM TOMBSTONES", 5, SU_PATH, "root", "ls", "-l", "/data/tombstones/ramdump", NULL);
- dump_file("BAM DMUX Log", "/d/ipc_logging/bam_dmux/log");
- dump_file("SMD Log", "/d/ipc_logging/smd/log");
- dump_file("SMD PKT Log", "/d/ipc_logging/smd_pkt/log");
- dump_file("IPC Router Log", "/d/ipc_logging/ipc_router/log");
- run_command("ION HEAPS", 5, SU_PATH, "root", "/system/bin/sh", "-c", "for d in $(ls -d /d/ion/*); do for f in $(ls $d); do echo --- $d/$f; cat $d/$f; done; done", NULL);
- dump_file("dmabuf info", "/d/dma_buf/bufinfo");
- dump_file("Battery Type", "/sys/class/power_supply/bms/battery_type");
- run_command("Temperatures", 5, SU_PATH, "root", "/system/bin/sh", "-c", "for f in emmc_therm msm_therm pa_therm0 xo_therm ; do echo -n \"$f : \" ; cat /sys/class/hwmon/hwmon2/device/$f ; done ; for f in `ls /sys/class/thermal` ; do type=`cat /sys/class/thermal/$f/type` ; temp=`cat /sys/class/thermal/$f/temp` ; echo \"$type: $temp\" ; done", NULL);
- dump_file("dmesg-ramoops-0", "/sys/fs/pstore/dmesg-ramoops-0");
- dump_file("dmesg-ramoops-1", "/sys/fs/pstore/dmesg-ramoops-1");
- dump_file("LITTLE cluster time-in-state", "/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state");
- run_command("LITTLE cluster cpuidle", 5, SU_PATH, "root", "/system/bin/sh", "-c", "for d in $(ls -d /sys/devices/system/cpu/cpu0/cpuidle/state*); do echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; done", NULL);
- dump_file("big cluster time-in-state", "/sys/devices/system/cpu/cpu4/cpufreq/stats/time_in_state");
- run_command("big cluster cpuidle", 5, SU_PATH, "root", "/system/bin/sh", "-c", "for d in $(ls -d /sys/devices/system/cpu/cpu4/cpuidle/state*); do echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; done", NULL);
+ Dumpstate& ds = Dumpstate::GetInstance();
+
+ ds.DumpFile("INTERRUPTS", "/proc/interrupts");
+ ds.DumpFile("RPM Stats", "/d/rpm_stats");
+ ds.DumpFile("Power Management Stats", "/d/rpm_master_stats");
+ ds.RunCommand("SUBSYSTEM TOMBSTONES", {"ls", "-l", "/data/tombstones/ramdump"} , CommandOptions::AS_ROOT_5);
+ ds.DumpFile("BAM DMUX Log", "/d/ipc_logging/bam_dmux/log");
+ ds.DumpFile("SMD Log", "/d/ipc_logging/smd/log");
+ ds.DumpFile("SMD PKT Log", "/d/ipc_logging/smd_pkt/log");
+ ds.DumpFile("IPC Router Log", "/d/ipc_logging/ipc_router/log");
+ ds.RunCommand("ION HEAPS", {"/system/bin/sh", "-c", "for d in $(ls -d /d/ion/*); do for f in $(ls $d); do echo --- $d/$f; cat $d/$f; done; done"});
+ ds.DumpFile("dmabuf info", "/d/dma_buf/bufinfo");
+ ds.DumpFile("Battery Type", "/sys/class/power_supply/bms/battery_type");
+ ds.RunCommand("Temperatures", {"/system/bin/sh", "-c", "for f in emmc_therm msm_therm pa_therm0 xo_therm ; do echo -n \"$f : \" ; cat /sys/class/hwmon/hwmon2/device/$f ; done ; for f in `ls /sys/class/thermal` ; do type=`cat /sys/class/thermal/$f/type` ; temp=`cat /sys/class/thermal/$f/temp` ; echo \"$type: $temp\" ; done"}, CommandOptions::AS_ROOT_5);
+ ds.DumpFile("dmesg-ramoops-0", "/sys/fs/pstore/dmesg-ramoops-0");
+ ds.DumpFile("dmesg-ramoops-1", "/sys/fs/pstore/dmesg-ramoops-1");
+ ds.DumpFile("LITTLE cluster time-in-state", "/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state");
+ ds.RunCommand("LITTLE cluster cpuidle", {"/system/bin/sh", "-c", "for d in $(ls -d /sys/devices/system/cpu/cpu0/cpuidle/state*); do echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; done"}, CommandOptions::AS_ROOT_5);
+ ds.DumpFile("big cluster time-in-state", "/sys/devices/system/cpu/cpu4/cpufreq/stats/time_in_state");
+ ds.RunCommand("big cluster cpuidle", {"/system/bin/sh", "-c", "for d in $(ls -d /sys/devices/system/cpu/cpu4/cpuidle/state*); do echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; done"}, CommandOptions::AS_ROOT_5);
};