Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
binder/android/os/ | 03-May-2024 | - | 196 | 35 | ||
tests/ | 03-May-2024 | - | 2,406 | 1,761 | ||
.clang-format | D | 03-May-2024 | 288 | 14 | 12 | |
Android.bp | D | 03-May-2024 | 3.8 KiB | 179 | 167 | |
AndroidTest.xml | D | 03-May-2024 | 1.2 KiB | 27 | 12 | |
DumpstateInternal.cpp | D | 03-May-2024 | 6.4 KiB | 192 | 151 | |
DumpstateInternal.h | D | 03-May-2024 | 1.8 KiB | 62 | 30 | |
DumpstateSectionReporter.cpp | D | 03-May-2024 | 1.5 KiB | 43 | 21 | |
DumpstateSectionReporter.h | D | 03-May-2024 | 1.7 KiB | 66 | 30 | |
DumpstateService.cpp | D | 03-May-2024 | 8.8 KiB | 228 | 167 | |
DumpstateService.h | D | 03-May-2024 | 2.1 KiB | 66 | 32 | |
DumpstateUtil.cpp | D | 03-May-2024 | 12.7 KiB | 412 | 319 | |
DumpstateUtil.h | D | 03-May-2024 | 6.7 KiB | 219 | 78 | |
OWNERS | D | 03-May-2024 | 89 | 7 | 5 | |
README.md | D | 03-May-2024 | 2.7 KiB | 126 | 85 | |
bugreport-format.md | D | 03-May-2024 | 5.5 KiB | 123 | 97 | |
dumpstate.cpp | D | 03-May-2024 | 111.7 KiB | 2,887 | 2,173 | |
dumpstate.h | D | 03-May-2024 | 19.8 KiB | 603 | 220 | |
dumpstate.rc | D | 03-May-2024 | 799 | 26 | 22 | |
main.cpp | D | 03-May-2024 | 2.1 KiB | 69 | 36 | |
utils.cpp | D | 03-May-2024 | 31.6 KiB | 1,013 | 799 |
README.md
1# `dumpstate` development tips 2 3## To build `dumpstate` 4 5Do a full build first: 6 7``` 8m -j dumpstate 9``` 10 11Then incremental ones: 12 13``` 14mmm -j frameworks/native/cmds/dumpstate 15``` 16 17If you're working on device-specific code, you might need to build them as well. 18Example: 19 20``` 21mmm -j frameworks/native/cmds/dumpstate device/acme/secret_device/dumpstate/ hardware/interfaces/dumpstate 22``` 23 24## To build, deploy, and take a bugreport 25 26``` 27mmm -j frameworks/native/cmds/dumpstate && adb push ${OUT}/system/bin/dumpstate system/bin && adb push ${OUT}/system/lib64/*dumpstate*.so /system/lib64/ && adb shell am bug-report 28``` 29 30Make sure that the device is remounted before running the above command. * If 31you're working with `userdebug` variant, you may need to run the following to 32remount your device: 33 34``` 35 adb root && adb remount -R && adb wait-for-device && adb root && adb remount 36``` 37 38* If you're working with `eng` variant, you may need to run the following to 39 remount your device: 40 41 ``` 42 adb root && adb remount 43 ``` 44 45## To build, deploy, and run unit tests 46 47First create `/data/nativetest64`: 48 49``` 50adb shell mkdir /data/nativetest64 51``` 52 53Then run: 54 55``` 56mmm -j frameworks/native/cmds/dumpstate/ && adb push ${OUT}/data/nativetest64/dumpstate_* /data/nativetest64 && adb shell /data/nativetest64/dumpstate_test/dumpstate_test 57``` 58 59And to run just one test (for example, `DumpstateTest.RunCommandNoArgs`): 60 61``` 62mmm -j frameworks/native/cmds/dumpstate/ && adb push ${OUT}/data/nativetest64/dumpstate_test* /data/nativetest64 && adb shell /data/nativetest64/dumpstate_test/dumpstate_test --gtest_filter=DumpstateTest.RunCommandNoArgs 63``` 64 65## To take quick bugreports 66 67``` 68adb shell setprop dumpstate.dry_run true 69``` 70 71## To emulate a device with user build 72 73``` 74adb shell setprop dumpstate.unroot true 75``` 76 77## To change the `dumpstate` version 78 79``` 80adb shell setprop dumpstate.version VERSION_NAME 81``` 82 83Example: 84 85``` 86adb shell setprop dumpstate.version split-dumpsys && adb shell dumpstate -v 87``` 88 89Then to restore the default version: 90 91``` 92adb shell setprop dumpstate.version default 93``` 94 95## Code style and formatting 96 97Use the style defined at the 98[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) and 99make sure to run the following command prior to `repo upload`: 100 101``` 102git clang-format --style=file HEAD~ 103``` 104 105## Useful Bash tricks 106 107``` 108export BR_DIR=/bugreports 109 110alias br='adb shell cmd activity bug-report' 111alias ls_bugs='adb shell ls -l ${BR_DIR}/' 112 113unzip_bug() { 114 adb pull ${BR_DIR}/$1 && emacs $1 && mv $1 /tmp 115} 116 117less_bug() { 118 adb pull ${BR_DIR}/$1 && less $1 && mv $1 /tmp 119} 120 121rm_bugs() { 122 if [ -z "${BR_DIR}" ] ; then echo "Variable BR_DIR not set"; else adb shell rm -rf ${BR_DIR}/*; fi 123} 124 125``` 126