dumpstate: move the dump registers from regmap to each driver
dumpstate availible to dump data with below 2 permission: -r--r--r-- 1 root root -r--r----- 1 system system but /d/regmap permission is -r-------- 1 root root 1. we cannot change root to system with chown if the file node is root 2. we cannot change to read with chmod if the file node is root 3. try change permission in vendor_init causes sepolicy build fail with message rule neverallow Base on above results, we added new file node in kernel with available permission to dump needed data and dump it. Bug: 194941806 Test: adb bugreport Change-Id: Ieeb1adfb0351ceb33bf817cbef3663d41cdb8645 Signed-off-by: Ted Lin <tedlin@google.com>
This commit is contained in:
parent
f739cf68c0
commit
2b86da4352
1 changed files with 3 additions and 5 deletions
|
@ -378,10 +378,8 @@ void DumpstateDevice::dumpPowerSection(int fd) {
|
||||||
" for f in `ls bd_*` ; do echo \"$f: `cat $f`\" ; done"});
|
" for f in `ls bd_*` ; do echo \"$f: `cat $f`\" ; done"});
|
||||||
if (!PropertiesHelper::IsUserBuild()) {
|
if (!PropertiesHelper::IsUserBuild()) {
|
||||||
|
|
||||||
RunCommandToFd(fd, "DC_registers dump", {"/vendor/bin/sh", "-c",
|
DumpFileToFd(fd, "DC_registers dump", "/sys/class/power_supply/pca9468-mains/device/registers_dump");
|
||||||
"for f in /d/regmap/*-0057-pca9468-mains ; do "
|
|
||||||
"regs=`cat $f/registers`; echo $f: ;"
|
|
||||||
"echo \"$regs\"; done"});
|
|
||||||
|
|
||||||
RunCommandToFd(fd, "fg_model", {"/vendor/bin/sh", "-c",
|
RunCommandToFd(fd, "fg_model", {"/vendor/bin/sh", "-c",
|
||||||
"for f in /d/maxfg* ; do "
|
"for f in /d/maxfg* ; do "
|
||||||
|
@ -401,7 +399,7 @@ void DumpstateDevice::dumpPowerSection(int fd) {
|
||||||
|
|
||||||
/* FG Registers */
|
/* FG Registers */
|
||||||
RunCommandToFd(fd, "fg registers", {"/vendor/bin/sh", "-c",
|
RunCommandToFd(fd, "fg registers", {"/vendor/bin/sh", "-c",
|
||||||
"for f in /d/regmap/*-0036 ; do "
|
"for f in /d/maxfg* ; do "
|
||||||
"regs=`cat $f/registers`; echo $f: ;"
|
"regs=`cat $f/registers`; echo $f: ;"
|
||||||
"echo \"$regs\"; done"});
|
"echo \"$regs\"; done"});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue