aboutsummaryrefslogtreecommitdiff
path: root/en/devices/tech
diff options
context:
space:
mode:
Diffstat (limited to 'en/devices/tech')
-rw-r--r--en/devices/tech/debug/asan.html16
-rw-r--r--en/devices/tech/debug/gdb.html42
-rw-r--r--en/devices/tech/power/values.html104
3 files changed, 113 insertions, 49 deletions
diff --git a/en/devices/tech/debug/asan.html b/en/devices/tech/debug/asan.html
index 9ea32939..29df8b6d 100644
--- a/en/devices/tech/debug/asan.html
+++ b/en/devices/tech/debug/asan.html
@@ -44,7 +44,8 @@ HWASan is non-deterministic. There are only 256 possible tag values, so there is
probability of missing any bug. HWAsan does not have ASan's limited-size redzones for
detecting overflows and limited-capacity quarantine for detecting use-after-free,
so it does not matter to HWAsan how large the overflow is or how long ago the memory
-was deallocated. This makes HWASan better than ASan.</p>
+was deallocated. This makes HWASan better than ASan. You can read more about
+<a href="http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html" class="external">the design of HWAsan</a>.</p>
<p>Valgrind's Memcheck tool is similar, but ASan also detects stack/global overflows
in addition to heap overflows, and is much faster with less memory overhead. Conversely,
@@ -60,10 +61,15 @@ instead.</p>
<h2 id="using-hwasan">Using HWAsan</h2>
-<p>As of December 2018 only Pixel 2 and Pixel 2 XL are supported. Supporting another device
-requires backporting several kernel patches. The Android team is working on getting those into
-the common kernel.
-You may also need to remove some optional extras to make room on your system partition for the
+<p>As of February 2019 only Pixel 2 and Pixel 2 XL support HWAsan. The Android team is working on
+getting the necessary patches into the common kernel, but for now supporting another device requires
+backporting these kernel patches:</p>
+<ul>
+<li><a href="https://lore.kernel.org/patchwork/project/lkml/list/?series=375855" class="external">arm64: untag user pointers passed to the kernel</a></li>
+<li><a href="https://lore.kernel.org/patchwork/project/lkml/list/?series=375865" class="external">arm64 relaxed ABI</a></li>
+</ul>
+
+<p>You may also need to remove some optional extras to make room on your system partition for the
larger libraries. See the <code>walleye_hwasan</code> target for an example.</p>
<p>Use the following commands to build the entire platform using HWASan:</p>
diff --git a/en/devices/tech/debug/gdb.html b/en/devices/tech/debug/gdb.html
index 49d62aa3..34096fb6 100644
--- a/en/devices/tech/debug/gdb.html
+++ b/en/devices/tech/debug/gdb.html
@@ -162,5 +162,47 @@ the following property:</p>
set arm fallback-mode arm # or thumb
</pre>
+<h2 id="vscode">Debugging with VS Code</h2>
+<p>GDB supports debugging platform code on
+ <a href="https://code.visualstudio.com/" class="external">Visual Studio Code</a>.
+ You can use the
+ VS Code debugger frontend instead of the GDB CLI interface to control and
+ debug native code running on devices.</p>
+<p>Before using VS Code for debugging, make sure you install the
+ <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools" class="external">
+ C/C++ extension</a>.</p>
+<p>To debug code using VS Code:</p>
+<ol>
+ <li>Ensure all build artifacts (such as symbols) required to run
+ <code>gdbclient.py</code> are present.</li>
+ <li>
+ <p>Run the following command:</p>
+ <pre class="prettyprint"><code class="devsite-terminal">gdbclient.py <var>-p pid | -n proc-name | -r ...</var> --setup-forwarding vscode <var>ANY_OTHER_FLAGS</var></code></pre>
+ <p>This prints a JSON object and <code>gdbclient.py</code> continues running.
+ This is expected; do not kill the <code>gdbclient.py</code> program.</p>
+ </li>
+ <li>In the debugging tab in VS Code, select
+ <strong>add configuration</strong>, then select
+ <strong>C/C++ gdb attach</strong>.
+ This opens a <code>launch.json</code> file and adds a new JSON object to a
+ list.
+ </li>
+ <li>Delete the newly added debugger configuration.</li>
+ <li>Copy the JSON object printed by <code>gdbclient.py</code> and paste it
+ into the object you just deleted. Save the changes.
+ </li>
+ <li>To reload the window to refresh the debugger list, press
+ <strong>Ctrl+Shift+P</strong> and type "reload window".
+ </li>
+ <li>Select the new debugger configuration and press
+ <strong>run</strong>. The debugger should connect after 10 to 30 seconds.
+ </li>
+ <li>When you are done debugging, go to the terminal running
+ <code>gdbclient.py</code> and press <strong>enter</strong> to end the
+ <code>gdbclient.py</code> program.
+ </li>
+</ol>
+<p>After setting up the debugger configuration for the first time,
+ you can skip steps 3 through 6.</p>
</body>
</html>
diff --git a/en/devices/tech/power/values.html b/en/devices/tech/power/values.html
index e4c68426..a2ea8388 100644
--- a/en/devices/tech/power/values.html
+++ b/en/devices/tech/power/values.html
@@ -5,6 +5,7 @@
<meta name="book_path" value="/_book.yaml" />
</head>
<body>
+ {% include "_versions.html" %}
<!--
Copyright 2017 The Android Open Source Project
@@ -104,17 +105,18 @@ sample file in AOSP, see
<th>Example Value</th>
<th>Notes</th>
</tr>
+
<tr>
- <td>none</td>
- <td>Nothing</td>
- <td>0</td>
- <td></td>
+ <td>ambient.on</td>
+ <td>Additional power used when screen is in doze/ambient/always-on mode instead of off.</td>
+ <td>around 100 mA</td>
+ <td> - </td>
</tr>
<tr>
<td>screen.on</td>
<td>Additional power used when screen is turned on at minimum brightness.</td>
- <td>200mA</td>
+ <td>200 mA</td>
<td>Includes touch controller and display backlight. At 0 brightness, not the
Android minimum which tends to be 10 or 20%.</td>
</tr>
@@ -123,7 +125,7 @@ sample file in AOSP, see
<td>screen.full</td>
<td>Additional power used when screen is at maximum brightness, compared to
screen at minimum brightness.</td>
- <td>100mA-300mA</td>
+ <td>100 mA-300 mA</td>
<td>A fraction of this value (based on screen brightness) is added to the
screen.on value to compute the power usage of the screen.</td>
</tr>
@@ -132,44 +134,43 @@ sample file in AOSP, see
<td>wifi.on</td>
<td>Additional power used when Wi-Fi is turned on but not receiving,
transmitting, or scanning.</td>
- <td>2mA</td>
- <td></td>
+ <td>2 mA</td>
+ <td> - </td>
</tr>
<tr>
<td>wifi.active</td>
<td>Additional power used when transmitting or receiving over Wi-Fi.</td>
- <td>31mA</td>
- <td></td>
+ <td>31 mA</td>
+ <td> - </td>
</tr>
<tr>
<td>wifi.scan</td>
<td>Additional power used when Wi-Fi is scanning for access points.</td>
- <td>100mA</td>
- <td></td>
+ <td>100 mA</td>
+ <td> - </td>
</tr>
<tr>
- <td>dsp.audio</td>
+ <td>audio</td>
<td>Additional power used when audio decoding/encoding via DSP.</td>
- <td>14.1mA</td>
- <td>Reserved for future use.</td>
+ <td>around 10 mA</td>
+ <td>Used for DSP audio.</td>
</tr>
-
<tr>
- <td>dsp.video</td>
+ <td>video</td>
<td>Additional power used when video decoding via DSP.</td>
- <td>54mA</td>
- <td>Reserved for future use.</td>
+ <td>around 50 mA</td>
+ <td>Used for DSP video.</td>
</tr>
<tr>
<td>camera.avg</td>
<td>Average power use by the camera subsystem for a typical camera
application.</td>
- <td>600mA</td>
+ <td>600 mA</td>
<td>Intended as a rough estimate for an application running a preview
and capturing approximately 10 full-resolution pictures per minute.</td>
</tr>
@@ -177,37 +178,44 @@ sample file in AOSP, see
<tr>
<td>camera.flashlight</td>
<td>Average power used by the camera flash module when on.</td>
- <td>200mA</td>
- <td></td>
+ <td>200 mA</td>
+ <td> - </td>
</tr>
+<tr>
+ <td>gps.signalqualitybased</td>
+ <td>Additional power used by GPS based on signal strength. This is a multi-value entry,
+ one per signal strength, from weakest to strongest.</td>
+ <td> 30 mA, 10 mA </td>
+ <td> - </td>
+</tr>
<tr>
<td>gps.on</td>
<td>Additional power used when GPS is acquiring a signal.</td>
- <td>50mA</td>
- <td></td>
+ <td>50 mA</td>
+ <td> - </td>
</tr>
<tr>
<td>radio.active</td>
<td>Additional power used when cellular radio is transmitting/receiving.</td>
- <td>100mA-300mA</td>
- <td></td>
+ <td>100 mA-300 mA</td>
+ <td> - </td>
</tr>
<tr>
<td>radio.scanning</td>
<td>Additional power used when cellular radio is paging the tower.</td>
- <td>1.2mA</td>
- <td></td>
+ <td>1.2 mA</td>
+ <td> - </td>
</tr>
<tr>
<td>radio.on</td>
- <td>Additional power used when the cellular radio is on. Multi-value entry,
+ <td>Additional power used when the cellular radio is on. This is a multi-value entry,
one per signal strength (no signal, weak, moderate, strong).</td>
- <td>1.2mA</td>
+ <td>1.2 mA</td>
<td>Some radios boost power when they search for a cell tower and do not
detect a signal. Values can be the same or decrease with increasing signal
strength. If you provide only one value, the same value is used for all
@@ -223,7 +231,7 @@ sample file in AOSP, see
the controller. If there are multiple receive or transmit states, the average
of those states is taken. In addition, the system now collects data for
<a href="#le-bt-scans">Low Energy (LE) and Bluetooth scans</a>.<br><br>Android
- N and later no longer use the Bluetooth power values for bluetooth.active
+ 7.0 and later no longer use the Bluetooth power values for bluetooth.active
(used when playing audio via Bluetooth A2DP) and bluetooth.on (used when
Bluetooth is on but idle).</td>
</tr>
@@ -247,12 +255,19 @@ sample file in AOSP, see
</tr>
<tr>
+ <td>modem.controller.sleep</td>
+ <td> Average current draw (mA) of the modem controller when asleep.</td>
+ <td> 0 mA </td>
+ <td rowspan=5>These values are not estimated, but taken from the data sheet of the controller.
+ If there are multiple receive states, the average of those states is taken. If there are
+ multiple transmit states, specifying a value for each transmit state is supported
+ starting in Android {{ androidPVersionNumber}}.</td>
+</tr>
+
+<tr>
<td>modem.controller.idle</td>
<td>Average current draw (mA) of the modem controller when idle.</td>
<td> - </td>
- <td rowspan=4>These values are not estimated, but taken from the data sheet of
- the controller. If there are multiple receive or transmit states, the average
- of those states is taken.</td>
</tr>
<tr>
@@ -263,8 +278,9 @@ sample file in AOSP, see
<tr>
<td>modem.controller.tx</td>
- <td>Average current draw (mA) of the modem controller when transmitting.</td>
- <td> - </td>
+ <td>Average current draw (mA) of the modem controller when transmitting at different RF power
+ levels. This is a multi-value entry with one value per transmit power level.</td>
+ <td> 100 mA, 200 mA, 300 mA, 400 mA, 500 mA </td>
</tr>
<tr>
@@ -302,8 +318,8 @@ sample file in AOSP, see
<tr>
<td>cpu.speeds</td>
- <td>Multi-value entry that lists each possible CPU speed in KHz.</td>
- <td>125000KHz, 250000KHz, 500000KHz, 1000000KHz, 1500000KHz</td>
+ <td>This is a multi-value entry that lists each possible CPU speed in KHz.</td>
+ <td>125000 KHz, 250000 KHz, 500000 KHz, 1000000 KHz, 1500000 KHz</td>
<td>The number and order of entries must correspond to the mA entries in
cpu.active.</td>
</tr>
@@ -312,15 +328,15 @@ sample file in AOSP, see
<td>cpu.idle</td>
<td>Total power drawn by the system when CPUs (and the SoC) are in system
suspend state.</td>
- <td>3mA</td>
- <td></td>
+ <td>3 mA</td>
+ <td> - </td>
</tr>
<tr>
<td>cpu.awake</td>
<td>Additional power used when CPUs are in scheduling idle state
(kernel idle loop); system is not in system suspend state.</td>
- <td>50mA</td>
+ <td>50 mA</td>
<td>Your platform might have more than one idle state in use with differing
levels of power consumption; choose a representative idle state for longer
periods of scheduler idle (several milliseconds). Examine the power graph on
@@ -331,7 +347,7 @@ sample file in AOSP, see
<tr>
<td>cpu.active</td>
<td>Additional power used by CPUs when running at different speeds.</td>
- <td>100mA, 120mA, 140mA, 160mA, 200mA</td>
+ <td>100 mA, 120 mA, 140 mA, 160 mA, 200 mA</td>
<td>Value represents the power used by the CPU rails when running at different
speeds. Set the max speed in the kernel to each of the allowed speeds and peg
the CPU at that speed. The number and order of entries correspond to the
@@ -352,8 +368,8 @@ sample file in AOSP, see
<tr>
<td>battery.capacity</td>
<td>Total battery capacity in mAh.</td>
- <td>3000mAh</td>
- <td></td>
+ <td>3000 mAh</td>
+ <td> - </td>
</tr>
</table>