• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

binder/android/os/14-Jan-2024-21542

tests/15-Dec-2024-2,5831,907

.clang-formatD14-Jan-2024288 1412

Android.bpD15-Dec-20244.7 KiB204192

AndroidTest.xmlD14-Jan-20241.2 KiB2712

DumpPool.cppD14-Jan-20245.3 KiB185144

DumpPool.hD14-Jan-20246.8 KiB21187

DumpstateInternal.cppD14-Jan-20246.7 KiB198156

DumpstateInternal.hD14-Jan-20241.9 KiB6331

DumpstateService.cppD15-Dec-202411.2 KiB281215

DumpstateService.hD15-Dec-20242.8 KiB7742

DumpstateUtil.cppD15-Dec-202414.6 KiB445339

DumpstateUtil.hD15-Dec-20247.6 KiB24085

OWNERSD15-Dec-202492 65

README.mdD14-Jan-20242.8 KiB13289

TEST_MAPPINGD15-Dec-2024655 3736

TaskQueue.cppD14-Jan-20241.1 KiB4120

TaskQueue.hD14-Jan-20242.1 KiB7730

bugreport-format.mdD14-Jan-20245.5 KiB12397

dumpstate.cppD15-Dec-2024180.3 KiB4,6583,514

dumpstate.hD15-Dec-202423.9 KiB694265

dumpstate.rcD14-Jan-2024761 2824

dumpstate_smoke_test.xmlD14-Jan-20241.4 KiB3215

dumpstate_test.xmlD14-Jan-20241.4 KiB3015

main.cppD14-Jan-20242.1 KiB6936

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## To set Bugreport API workflow for bugreport
96
97```
98adb shell setprop settings_call_bugreport_api true
99```
100
101## Code style and formatting
102
103Use the style defined at the
104[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) and
105make sure to run the following command prior to `repo upload`:
106
107```
108git clang-format --style=file HEAD~
109```
110
111## Useful Bash tricks
112
113```
114export BR_DIR=/bugreports
115
116alias br='adb shell cmd activity bug-report'
117alias ls_bugs='adb shell ls -l ${BR_DIR}/'
118
119unzip_bug() {
120  adb pull ${BR_DIR}/$1 && emacs $1 && mv $1 /tmp
121}
122
123less_bug() {
124  adb pull ${BR_DIR}/$1 && less $1 && mv $1 /tmp
125}
126
127rm_bugs() {
128 if [ -z "${BR_DIR}" ] ; then echo "Variable BR_DIR not set"; else adb shell rm -rf ${BR_DIR}/*; fi
129}
130
131```
132