# 调试概述

子系统在 Qualcomm^®^ SoC 上的其自己的执行环境中独立处理。本节介绍受影响子系统的工具、示例日志和故障排查方法。了解子系统中的差异和检查错误的方法对于诊断和排查此类异常很有用。

下表列出了SoC上的重要子系统。

表：SoC上的子系统

| 子系统 (Subsystem) | 说明 |
| --- | --- |
| 应用处理器子系统 (APSS) | 该主要子系统将 Qualcomm Linux 内核作为高级操作系统 (HLOS) 执行。 |
| 应用数字信号处理器 (aDSP) | 该子系统称为低功耗音频子系统 (LPASS)，处理数字信号处理任务，例如音频编码/解码和语音识别。 |
| 计算数字信号处理器 (cDSP) | 该子系统称为计算 DSP，执行计算密集型任务，例如与神经网络相关的计算。 |
| Qualcomm^®^ 受信任执行环境 (TEE)/TrustZone (TZ) | 该子系统执行安全操作并利用 Arm® TrustZone® 架构。有关详细信息，请参见 [Qualcomm Linux 安全指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-11)。 |
| 无线局域网处理器子系统 (WPSS) | 该子系统连接到 Wi-Fi 网络，传输和接收数据包，处理安全协议并确保稳定的网络性能。有关更多信息，请参阅 [Qualcomm Linux Wi-Fi 指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-14/introduction.html)。 |
| Always On 处理器 (AOP) | 该子系统可以调节设备的电源。 |

除应用处理器外，所有子系统的软件都称为非 HLOS。

要了解子系统的启动流程，参见 [Qualcomm Linux 启动指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-4)。

Note

请参阅 Qualcomm^®^ Linux^®^ 支持的[硬件 SoCs](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-115/soc.html)。

## 调试工作流

由于 Qualcomm SoC 上有许多子系统，因此请先确定问题首先发生的子系统。这有助于您调试相关子系统。

应用处理器作为主要子系统，可检测其他子系统何时崩溃。例如，如果 aDSP 处理器子系统崩溃，则内核日志会捕获子系统重启 (SSR) 崩溃错误日志。因此，要识别需要调试的子系统，首先要验证内核调试消息。

下图显示了识别错误和需要调试的组件的工作流程。

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export Debug-workflow.svg Page-1 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="12.0417in" height="7.57292in" viewbox="0 0 867 545.25" xml:space="preserve" color-interpolation-filters="sRGB" class="st12" aria-label="../../_images/Debug-workflow.svg"><v:documentproperties v:langid="1033" v:viewmarkup="false">	<v:userdefs>		<v:ud v:nameu="msvNoAutoConnect" v:val="VT0(0):26"></v:ud>	</v:userdefs></v:documentproperties>
<style>.svg-1 .st1 { fill: #fafafa; marker-end: url("#mrkr5-4"); stroke: #d2d7e1; stroke-width: 2 }
.svg-1 .st2 { fill: #d2d7e1; fill-opacity: 1; stroke: #d2d7e1; stroke-opacity: 1; stroke-width: 0.44247787610619 }
.svg-1 .st3 { fill: #d2d7e1; stroke: #d2d7e1; stroke-width: 2.5 }
.svg-1 .st4 { fill: #000000; font-family: sans-serif; font-size: 1.00001em }
.svg-1 .st5 { font-size: 1em }
.svg-1 .st6 { marker-end: url("#mrkr4-17"); stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75 }
.svg-1 .st7 { fill: #000000; fill-opacity: 1; stroke: #000000; stroke-opacity: 1; stroke-width: 0.49295774647887 }
.svg-1 .st8 { fill: none }
.svg-1 .st9 { stroke: #7c8aa3; stroke-width: 2.5 }
.svg-1 .st10 { fill: #fafafa; stroke: none; stroke-width: 0.25 }
.svg-1 .st11 { fill: #000000; font-family: sans-serif; font-size: 0.75em }
.svg-1 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<defs id="Markers">	<g id="lend5">		<path d="M 2 1 L 0 0 L 1.98117 -0.993387 C 1.67173 -0.364515 1.67301 0.372641 1.98465 1.00043 " style="stroke:none"></path>	</g>	<marker id="mrkr5-4" class="st2" v:arrowtype="5" v:arrowsize="2" v:setback="3.955" refx="-3.955" orient="auto" markerunits="strokeWidth" overflow="visible">		<use xlink:href="#lend5" transform="scale(-2.26,-2.26) "></use>	</marker>	<g id="lend4">		<path d="M 2 1 L 0 0 L 2 -1 L 2 1 " style="stroke:none"></path>	</g>	<marker id="mrkr4-17" class="st7" v:arrowtype="4" v:arrowsize="1" v:setback="4.05714" refx="-4.0571428571429" orient="auto" markerunits="strokeWidth" overflow="visible">		<use xlink:href="#lend4" transform="scale(-2.0285714285714,-2.0285714285714) "></use>	</marker></defs><g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<v:userdefs>		<v:ud v:nameu="msvThemeOrder" v:val="VT0(0):26"></v:ud>	</v:userdefs>	<title>Page-1</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="0" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<v:layer v:name="Flowchart" v:index="0"></v:layer>	<v:layer v:name="Connector" v:index="1"></v:layer>	<g id="shape26-1" v:mid="26" v:groupcontext="shape" transform="translate(33.75,-31.5)">		<title>Sheet.26</title>		<rect x="0" y="63.75" width="801" height="481.5" rx="2.88" ry="2.88" class="st1"></rect>	</g>	<g id="shape1-5" v:mid="1" v:groupcontext="shape" v:layermember="0" transform="translate(394.893,-460.929)">		<title>Start/End</title>		<desc>Start</desc>		<v:custprops>			<v:cp v:nameu="Cost" v:lbl="Cost" v:prompt="" v:type="7" v:format="@" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="ProcessNumber" v:lbl="Process Number" v:prompt="" v:type="2" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Owner" v:lbl="Owner" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Function" v:lbl="Function" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>			<v:cp v:nameu="StartDate" v:lbl="Start Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="EndDate" v:lbl="End Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Status" v:lbl="Status" v:prompt="" v:type="4" v:format=";Not Started;In Progress;Completed;Deferred;Waiting on Input" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>		</v:custprops>		<v:userdefs>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>			<v:ud v:nameu="DefaultWidth" v:prompt="" v:val="VT0(1):0"></v:ud>			<v:ud v:nameu="DefaultHeight" v:prompt="" v:val="VT0(0.375):0"></v:ud>			<v:ud v:nameu="ResizeTxtHeight" v:prompt="" v:val="VT0(0.375):0"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="39.4286" cy="530.464" width="78.86" height="29.5714"></v:textrect>		<path d="M14.79 545.25 L64.07 545.25 A14.7857 14.7857 -180 0 0 64.07 515.68 L14.79 515.68 A14.7857 14.7857 -180 1 0 14.79					 545.25 Z" class="st3"></path>		<text x="26.76" y="534.06" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>起始</text>		</g>	<g id="shape2-8" v:mid="2" v:groupcontext="shape" v:layermember="0" transform="translate(367.568,-326.7)">		<title>Decision</title>		<desc>Panic or Bug in dmesg?</desc>		<v:custprops>			<v:cp v:nameu="Cost" v:lbl="Cost" v:prompt="" v:type="7" v:format="@" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="ProcessNumber" v:lbl="Process Number" v:prompt="" v:type="2" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Owner" v:lbl="Owner" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Function" v:lbl="Function" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>			<v:cp v:nameu="StartDate" v:lbl="Start Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="EndDate" v:lbl="End Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Status" v:lbl="Status" v:prompt="" v:type="4" v:format=";Not Started;In Progress;Completed;Deferred;Waiting on Input" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>		</v:custprops>		<v:userdefs>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>			<v:ud v:nameu="DefaultWidth" v:prompt="" v:val="VT0(1):0"></v:ud>			<v:ud v:nameu="DefaultHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>			<v:ud v:nameu="ResizeTxtHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="66.6863" cy="503.238" width="111.15" height="63.0186"></v:textrect>		<path d="M0 503.24 L66.69 461.23 L133.37 503.24 L66.69 545.25 L0 503.24 Z" class="st3"></path>		<text x="22.33" y="505.64" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>dmesg 中有 Panic<v:lf></v:lf><tspan x="45" dy="1.2em" class="st5">或 Bug？</tspan></text>		</g>	<g id="shape3-12" v:mid="3" v:groupcontext="shape" v:layermember="1" transform="translate(425.255,-458.866)">		<title>Dynamic connector</title>		<path d="M9 545.25 L9 586.29" class="st6"></path>	</g>	<g id="shape4-18" v:mid="4" v:groupcontext="shape" v:layermember="0" transform="translate(175.512,-190.659)">		<title>Decision.4</title>		<desc>Subsystem restart log in dmesg exists?</desc>		<v:custprops>			<v:cp v:nameu="Cost" v:lbl="Cost" v:prompt="" v:type="7" v:format="@" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="ProcessNumber" v:lbl="Process Number" v:prompt="" v:type="2" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Owner" v:lbl="Owner" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Function" v:lbl="Function" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>			<v:cp v:nameu="StartDate" v:lbl="Start Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="EndDate" v:lbl="End Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Status" v:lbl="Status" v:prompt="" v:type="4" v:format=";Not Started;In Progress;Completed;Deferred;Waiting on Input" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>		</v:custprops>		<v:userdefs>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>			<v:ud v:nameu="DefaultWidth" v:prompt="" v:val="VT0(1):0"></v:ud>			<v:ud v:nameu="DefaultHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>			<v:ud v:nameu="ResizeTxtHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>			<v:ud v:nameu="ResizeTxtHeight" v:prompt="" v:val="VT0(1):1"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="66.6863" cy="499.236" width="111.15" height="69.021"></v:textrect>		<path d="M0 499.24 L66.69 453.22 L133.37 499.24 L66.69 545.25 L0 499.24 Z" class="st3"></path>		<text x="40.01" y="488.44" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>在 dmesg <v:lf></v:lf><tspan x="30" dy="1.2em" class="st5">中查看子系统 </tspan><tspan x="40.01" dy="1.2em" class="st5">重启日志？</tspan></text>		</g>	<g id="shape5-23" v:mid="5" v:groupcontext="shape" v:layermember="0" transform="translate(567.627,-189.929)">		<title>Decision.5</title>		<desc>Error in TrustZone*?</desc>		<v:custprops>			<v:cp v:nameu="Cost" v:lbl="Cost" v:prompt="" v:type="7" v:format="@" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="ProcessNumber" v:lbl="Process Number" v:prompt="" v:type="2" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Owner" v:lbl="Owner" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Function" v:lbl="Function" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>			<v:cp v:nameu="StartDate" v:lbl="Start Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="EndDate" v:lbl="End Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Status" v:lbl="Status" v:prompt="" v:type="4" v:format=";Not Started;In Progress;Completed;Deferred;Waiting on Input" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>		</v:custprops>		<v:userdefs>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>			<v:ud v:nameu="DefaultWidth" v:prompt="" v:val="VT0(1):0"></v:ud>			<v:ud v:nameu="DefaultHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>			<v:ud v:nameu="ResizeTxtHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="66.6863" cy="499.236" width="111.15" height="69.021"></v:textrect>		<path d="M0 499.24 L66.69 453.22 L133.37 499.24 L66.69 545.25 L0 499.24 Z" class="st3"></path>		<text x="40.02" y="495.64" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>TrustZone* <tspan x="25.67" dy="1.2em" class="st5">中是否存在错误？</tspan></text>		</g>	<g id="shape6-27" v:mid="6" v:groupcontext="shape" v:layermember="1" transform="translate(367.568,-368.712)">		<title>Dynamic connector.6</title>		<path d="M0 545.25 L-125.37 545.25 L-125.37 624.18" class="st6"></path>	</g>	<g id="shape7-32" v:mid="7" v:groupcontext="shape" v:layermember="1" transform="translate(500.941,-368.712)">		<title>Dynamic connector.7</title>		<path d="M0 545.25 L133.37 545.25 L133.37 624.91" class="st6"></path>	</g>	<g id="shape8-37" v:mid="8" v:groupcontext="shape" v:layermember="0" transform="translate(69.5476,-59.3809)">		<title>Subprocess</title>		<desc>Debug specific subsystem</desc>		<v:custprops>			<v:cp v:nameu="Cost" v:lbl="Cost" v:prompt="" v:type="7" v:format="@" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="ProcessNumber" v:lbl="Process Number" v:prompt="" v:type="2" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Owner" v:lbl="Owner" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Function" v:lbl="Function" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>			<v:cp v:nameu="StartDate" v:lbl="Start Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="EndDate" v:lbl="End Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Status" v:lbl="Status" v:prompt="" v:type="4" v:format=";Not Started;In Progress;Completed;Deferred;Waiting on Input" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>		</v:custprops>		<v:userdefs>			<v:ud v:nameu="AntiScale" v:val="VT0(1):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>			<v:ud v:nameu="DefaultWidth" v:prompt="" v:val="VT0(1):0"></v:ud>			<v:ud v:nameu="DefaultHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>			<v:ud v:nameu="ResizeTxtHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="49.2857" cy="508.286" width="80.58" height="73.9286"></v:textrect>		<path d="M0 545.25 L98.57 545.25 L98.57 471.32 L0 471.32 L0 545.25 Z" class="st8"></path>		<path d="M0 545.25 L98.57 545.25 L98.57 471.32 L0 471.32 L0 545.25" class="st9"></path>		<path d="M9 545.25 L9 471.32" class="st9"></path>		<path d="M89.57 545.25 L89.57 471.32" class="st9"></path>		<text x="20.6" y="505.49" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>调试特定的 <tspan x="29.28" dy="1.2em" class="st5">子系统 </tspan><tspan x="20.61" dy="1.2em" class="st5"></tspan></text>		</g>	<g id="shape10-45" v:mid="10" v:groupcontext="shape" v:layermember="0" transform="translate(306.119,-59.3809)">		<title>Subprocess.10</title>		<desc>Debug application processor</desc>		<v:custprops>			<v:cp v:nameu="Cost" v:lbl="Cost" v:prompt="" v:type="7" v:format="@" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="ProcessNumber" v:lbl="Process Number" v:prompt="" v:type="2" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Owner" v:lbl="Owner" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Function" v:lbl="Function" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>			<v:cp v:nameu="StartDate" v:lbl="Start Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="EndDate" v:lbl="End Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Status" v:lbl="Status" v:prompt="" v:type="4" v:format=";Not Started;In Progress;Completed;Deferred;Waiting on Input" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>		</v:custprops>		<v:userdefs>			<v:ud v:nameu="AntiScale" v:val="VT0(1):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>			<v:ud v:nameu="DefaultWidth" v:prompt="" v:val="VT0(1):0"></v:ud>			<v:ud v:nameu="DefaultHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>			<v:ud v:nameu="ResizeTxtHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="49.2857" cy="508.286" width="80.58" height="73.9286"></v:textrect>		<path d="M0 545.25 L98.57 545.25 L98.57 471.32 L0 471.32 L0 545.25 Z" class="st8"></path>		<path d="M0 545.25 L98.57 545.25 L98.57 471.32 L0 471.32 L0 545.25" class="st9"></path>		<path d="M9 545.25 L9 471.32" class="st9"></path>		<path d="M89.57 545.25 L89.57 471.32" class="st9"></path>		<text x="26.6" y="505.49" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>调试应用 <tspan x="30.6" dy="1.2em" class="st5">处理器 </tspan><tspan x="22.94" dy="1.2em" class="st5"></tspan></text>		</g>	<g id="shape11-53" v:mid="11" v:groupcontext="shape" v:layermember="0" transform="translate(585.028,-58.9018)">		<title>Subprocess.11</title>		<desc>Debug Always-on processor</desc>		<v:custprops>			<v:cp v:nameu="Cost" v:lbl="Cost" v:prompt="" v:type="7" v:format="@" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="ProcessNumber" v:lbl="Process Number" v:prompt="" v:type="2" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Owner" v:lbl="Owner" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Function" v:lbl="Function" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>			<v:cp v:nameu="StartDate" v:lbl="Start Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="EndDate" v:lbl="End Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Status" v:lbl="Status" v:prompt="" v:type="4" v:format=";Not Started;In Progress;Completed;Deferred;Waiting on Input" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>		</v:custprops>		<v:userdefs>			<v:ud v:nameu="AntiScale" v:val="VT0(1):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>			<v:ud v:nameu="DefaultWidth" v:prompt="" v:val="VT0(1):0"></v:ud>			<v:ud v:nameu="DefaultHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>			<v:ud v:nameu="ResizeTxtHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="49.2857" cy="508.286" width="80.58" height="73.9286"></v:textrect>		<path d="M0 545.25 L98.57 545.25 L98.57 471.32 L0 471.32 L0 545.25 Z" class="st8"></path>		<path d="M0 545.25 L98.57 545.25 L98.57 471.32 L0 471.32 L0 545.25" class="st9"></path>		<path d="M9 545.25 L9 471.32" class="st9"></path>		<path d="M89.57 545.25 L89.57 471.32" class="st9"></path>		<text x="35.6" y="497.49" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>调试 <v:lf></v:lf><tspan x="21.61" dy="1.2em" class="st5">Always</tspan>-on <tspan x="29.94" dy="1.2em" class="st5">处理器 </tspan> </text>		</g>	<g id="shape12-61" v:mid="12" v:groupcontext="shape" v:layermember="0" transform="translate(709.988,-59.3809)">		<title>Subprocess.12</title>		<desc>Debug NoC</desc>		<v:custprops>			<v:cp v:nameu="Cost" v:lbl="Cost" v:prompt="" v:type="7" v:format="@" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="ProcessNumber" v:lbl="Process Number" v:prompt="" v:type="2" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Owner" v:lbl="Owner" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Function" v:lbl="Function" v:prompt="" v:type="0" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>			<v:cp v:nameu="StartDate" v:lbl="Start Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="EndDate" v:lbl="End Date" v:prompt="" v:type="5" v:format="" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0"></v:cp>			<v:cp v:nameu="Status" v:lbl="Status" v:prompt="" v:type="4" v:format=";Not Started;In Progress;Completed;Deferred;Waiting on Input" v:sortkey="" v:invis="false" v:ask="false" v:langid="1033" v:cal="0" v:val="VT4()"></v:cp>		</v:custprops>		<v:userdefs>			<v:ud v:nameu="AntiScale" v:val="VT0(1):26"></v:ud>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>			<v:ud v:nameu="DefaultWidth" v:prompt="" v:val="VT0(1):0"></v:ud>			<v:ud v:nameu="DefaultHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>			<v:ud v:nameu="ResizeTxtHeight" v:prompt="" v:val="VT0(0.75):0"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="49.2857" cy="508.286" width="80.58" height="73.9286"></v:textrect>		<path d="M0 545.25 L98.57 545.25 L98.57 471.32 L0 471.32 L0 545.25 Z" class="st8"></path>		<path d="M0 545.25 L98.57 545.25 L98.57 471.32 L0 471.32 L0 545.25" class="st9"></path>		<path d="M9 545.25 L9 471.32" class="st9"></path>		<path d="M89.57 545.25 L89.57 471.32" class="st9"></path>		<text x="20.93" y="511.89" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>调试 NoC</text>		</g>	<g id="shape13-67" v:mid="13" v:groupcontext="shape" v:layermember="1" transform="translate(175.512,-236.673)">		<title>Dynamic connector.13</title>		<path d="M0 545.25 L-56.68 545.25 L-56.68 641.51" class="st6"></path>	</g>	<g id="shape14-72" v:mid="14" v:groupcontext="shape" v:layermember="1" transform="translate(308.885,-236.673)">		<title>Dynamic connector.14</title>		<path d="M0 545.25 L46.52 545.25 L46.52 641.51" class="st6"></path>	</g>	<g id="shape16-77" v:mid="16" v:groupcontext="shape" v:layermember="1" transform="translate(567.627,-235.943)">		<title>Dynamic connector.16</title>		<path d="M0 545.25 L-122.44 545.25 L-122.44 684.85 L-155.84 684.85" class="st6"></path>	</g>	<g id="shape18-82" v:mid="18" v:groupcontext="shape" v:layermember="1" transform="translate(701,-235.943)">		<title>Dynamic connector.18</title>		<path d="M0 545.25 L58.27 545.25 L58.27 640.78" class="st6"></path>	</g>	<g id="shape21-87" v:mid="21" v:groupcontext="shape" v:layermember="1" transform="translate(625.314,-189.929)">		<title>Dynamic connector.21</title>		<path d="M9 545.25 L9 596.21" class="st6"></path>	</g>	<g id="shape34-92" v:mid="34" v:groupcontext="shape" transform="translate(725.119,-179.679)">		<title>Sheet.34</title>		<desc>NoC error</desc>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="34.1548" cy="536.25" width="68.31" height="18"></v:textrect>		<rect x="0" y="527.25" width="68.3095" height="18" class="st10"></rect>		<text x="7.82" y="539.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>NoC 错误</text>		</g>	<g id="shape36-95" v:mid="36" v:groupcontext="shape" transform="translate(600.159,-157.179)">		<title>Sheet.36</title>		<desc>AoP error</desc>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="34.1548" cy="536.25" width="68.31" height="18"></v:textrect>		<rect x="0" y="527.25" width="68.3095" height="18" class="st10"></rect>		<text x="8.48" y="539.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>AoP 错误</text>		</g>	<g id="shape37-98" v:mid="37" v:groupcontext="shape" transform="translate(411.75,-148.179)">		<title>Sheet.37</title>		<desc>Non-secure WD bite AHB timeout XPU error SMMU error No error</desc>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="34.1548" cy="510.938" width="68.31" height="68.625"></v:textrect>		<rect x="0" y="476.625" width="68.3095" height="68.625" class="st10"></rect>		<text x="2.15" y="486.64" class="st11" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>非安全看门狗 bite<tspan x="14.15" dy="1.2em" class="st5">AHB 超时<v:lf></v:lf></tspan><tspan x="14.15" dy="1.2em" class="st5">XPU 错误<v:lf></v:lf></tspan><tspan x="9.66" dy="1.2em" class="st5">SMMU 错误<v:lf></v:lf></tspan><tspan x="18.65" dy="1.2em" class="st5">无错误</tspan></text>		</g>	<g id="shape39-106" v:mid="39" v:groupcontext="shape" transform="translate(312.75,-240.75)">		<title>Sheet.39</title>		<desc>No</desc>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="15.125" cy="536.25" width="30.26" height="18"></v:textrect>		<rect x="0" y="527.25" width="30.25" height="18" class="st10"></rect>		<text x="7.46" y="539.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>否</text>		</g>	<g id="shape43-109" v:mid="43" v:groupcontext="shape" transform="translate(137.869,-240.75)">		<title>Sheet.43</title>		<desc>Yes</desc>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="15.125" cy="536.25" width="30.26" height="18"></v:textrect>		<rect x="0" y="527.25" width="30.25" height="18" class="st10"></rect>		<text x="4.79" y="539.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>是</text>		</g>	<g id="shape46-112" v:mid="46" v:groupcontext="shape" transform="translate(293.75,-375.75)">		<title>Sheet.46</title>		<desc>Yes</desc>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="15.125" cy="538.5" width="30.26" height="13.5"></v:textrect>		<rect x="0" y="531.75" width="30.25" height="13.5" class="st10"></rect>		<text x="4.79" y="542.1" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>是</text>		</g>	<g id="shape47-115" v:mid="47" v:groupcontext="shape" transform="translate(544.51,-375.75)">		<title>Sheet.47</title>		<desc>No</desc>		<v:textblock v:margins="rect(2,2,2,2)"></v:textblock>		<v:textrect cx="15.125" cy="536.25" width="30.26" height="18"></v:textrect>		<rect x="0" y="527.25" width="30.25" height="18" class="st10"></rect>		<text x="7.46" y="539.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>否</text>		</g></g>
</svg>

**图 ：识别受影响子系统的工作流程**

当内核 dmesg 日志未显示任何 panic 特征时，请验证 Qualcomm TEE 诊断 (diag) 日志中是否存在错误，例如非安全看门狗 bite 和片上网络 (NoC) 错误。以下部分描述了指示内核 panic、bug 和子系统崩溃问题的示例内核消息。

### 识别内核 panic 和 bug

从内核 dmesg 日志中，您可以确定重置是内核 panic 还是 bug。以下是一些指示内核 panic 或 bug 的示例日志：

- Panic（模式：一般错误）

18.800936: &lt;6&gt; Kernel panic - not syncing: Fatal exception

18.800938: &lt;6&gt; SMP: stopping secondary CPUs

18.800947: &lt;6&gt; CPU0: stopping

Kernel panic - not syncing: Apps watchdog Bark received!
- Bug（模式 1：由于内存损坏而强制崩溃）

12.899532: &lt;6&gt; BUG kmalloc-128 (Not tainted): Redzone overwritten

12.905418: &lt;6&gt; -----------------------------------------------------------------------------
- Bug（模式 2：驱动程序强制崩溃）

320.510769: &lt;6&gt; ------------[ cut here ]------------

320.510781: &lt;6&gt; kernel BUG at /local/mnt/workspace/lnxbuild/project/trees\_in\_use/free\_tree\_platform\_manifest\_refs\_tags/drivers/platform/msm/ipa/ipa\_v3/ipa\_qmi\_service.c:955!
- Bug（模式 3：由于锁定问题而强制崩溃）

[ 180.993861] BUG: spinlock lockup suspected on CPU#0, swapper/0/0

[ 180.993883] lock: stop\_lock+0x0/0x18, .magic: dead4ead, .owner: swapper/6/0, .owner\_cpu: 6

[ 181.015629] Causing a watchdog bite!

Note

大多数 bug 通常会导致内核 panic。有关调试内核问题的更多信息，请参阅 [Qualcomm Linux 内核指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-3/overview.html)。

### 识别子系统崩溃问题

您可以验证内核 dmesg 日志以确定重启是否是由于子系统崩溃造成的。例如，根据 `qcm6490.dtsi`（node：remoteproc\_adsp：remoteproc@3000000），以下日志表明aDSP子系统崩溃。

0x000000000A27652C |   5198.790423:   qcom\_q6v5\_pas 3000000.remoteproc: fatal error received: err\_inject\_crash.c:413:Crash injected via Diag

0x000000000A276689 |   5198.801061:   remoteproc remoteproc2: crash detected in 3000000.remoteproc: type fatal error

0x000000000A2767A1 |   5198.809602:   remoteproc remoteproc2: handling crash #1 in 3000000.remoteproc

0x000000000A27688E |   5198.816837:   remoteproc remoteproc2: recovering 3000000.remoteproc

0x000000000A276971 |   5198.823784:   qcom\_q6v5\_pas 8a00000.remoteproc: subsystem event rejected

### 从 Qualcomm TEE 日志中识别系统问题

此功能可供具有授权访问权限的许可开发者使用。关于指示 Qualcomm TEE 中错误的示例日志，请参阅 [Qualcomm Linux Debug Guide - Addendum](https://docs.qualcomm.com/bundle/resource/topics/80-70018-12A/identify_subsystem_to_be_debugged.html#identify_and_debug_errors_in_tz)。

如果 Qualcomm TEE 诊断日志未显示任何错误，则问题可能是由于安全看门狗 bite 问题造成的。有关看门狗问题的更多信息，请参阅[硬件重置](https://docs.qualcomm.com/doc/80-70018-12SC/topic/general_system_debugging.html#reset-hardware)。

有关 Qualcomm TEE 中调试问题的更多信息，请参阅 [Qualcomm Linux 安全指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-11/debug.html)。

## 调试方法

以下是两种调试方法：

- **目标上调试**

    目标上调试可解决软件问题。这种方法允许直接从实时设备访问大部分信息。使用 SSH 将 Linux 主机连接到实时设备。要设置 SSH，请参阅[使用 SSH 登录](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-254/how_to.html#use-ssh)。

    关于各种目标上调试功能的更多信息，请参阅[目标上调试功能](https://docs.qualcomm.com/doc/80-70018-12SC/topic/Debug-overview.html#on-target-debug-features)。
- **目标外调试**

    这种方法使用日志而非实际设备，使其成为一种高效的调试方法。您可以使用内存 dump 或日志记录工具进行调试，并可以使用各类日志进行离线调试。由于 RAM dump 可采集大部分内存区域，但只能采集有限的硬件寄存器信息，因此，调试与硬件相关的问题可能是一个挑战。

    关于各种目标外调试功能的更多信息，请参阅[目标外调试功能](https://docs.qualcomm.com/doc/80-70018-12SC/topic/Debug-overview.html#off-target-debug-features)。

## 目标上调试功能

您可以在 runtime 在设备上使用以下调试功能：

- Perf 工具
- 子系统重启
- 强制子系统复位
- [使用 OpenOCD 进行调试](https://docs.qualcomm.com/doc/80-70018-12SC/topic/debugging_linux_kernel.html#debug-using-openocd)

### Perf 工具

Linux 中的 Perf 工具可辅助进行性能分析。Linux 内核在 `tools/perf` 目录中包含此工具。

您可以使用 Perf 工具调试系统行为的各个方面，包括 CPU 性能计数器、跟踪点、kprobe 和 uprobe（用于动态跟踪）。下表列出了 Perf 工具的主要功能。

表：Perf 工具的主要功能

| 功能 | 说明 |
| --- | --- |
| CPU 性能计数器 | 这些 CPU 硬件寄存器用于跟踪已执行指令、缓存未命中和分支误预测等事件。这些事件构成了分析应用程序和识别性能瓶颈的基础。 |
| 跟踪点 | 您可将这些跟踪点放置在代码的逻辑位置，例如系统调用、网络事件和文件系统操作处。这些跟踪点以最小的开销提供时间戳和堆栈跟踪等信息。 |
| 动态跟踪 | 此功能使用 kprobe 和 uprobe 框架动态创建跟踪点，从而允许在内核空间和用户空间进行跟踪。 |

有关 Perf 工具的更多信息，请参阅以下资源：

- [https://perf.wiki.kernel.org/index.php/Main_Page](https://perf.wiki.kernel.org/index.php/Main_Page)
- [https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md](https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md)
- [https://docs.kernel.org/trace/coresight/index.html](https://docs.kernel.org/trace/coresight/index.html)
- [https://docs.kernel.org/trace/coresight/coresight-perf.html](https://docs.kernel.org/trace/coresight/coresight-perf.html)

### 子系统重启 (Subsystem restart)

子系统崩溃时可独立重启而无需设备重启，这称为子系统重启 (SSR)。SSR 功能使用 Linux 内核中可用的 remoteproc 框架。

若要为调试目的启用完整内存 dump，需默认禁用 SSR 功能。建议在商用设备上使用 SSR 功能，不要在开发阶段使用。有关 SSR 功能的更多信息，请参阅 [Remoteproc 子系统](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-3/features.html#remoteproc-subsystem)。

启用 SSR 功能可在子系统重启时生成 SSR dump。由于 SSR dump 的大小小于完整内存 dump 的大小，建议使用 SSR dump 进行调试。然而，调试某些子系统崩溃时仍需完整 RAM dump。

有关如何启用和采集子系统 dump 的更多信息，请参阅[子系统 dump](https://docs.qualcomm.com/doc/80-70018-12SC/topic/debugging_linux_kernel.html#subsystem-ram-dumps)。

### 强制子系统复位

使用此功能调试需要重启子系统的用例。

此功能可供具有授权访问权限的许可开发者使用。要强制重置子系统，可以使用 QXDM Professional^™^ 运行 `diag` 命令。有关 QXDM Professional 命令及其用法的更多信息，请参阅 [Qualcomm Linux Debug Guide - Addendum](https://docs.qualcomm.com/bundle/resource/topics/80-70018-12A/debug-non-hlos-subsystems.html#qxdm_professional)。

## 目标外调试功能

用户可以使用 RAM dump 或 QXDM Professional 进行离线调试。

### RAM dump

RAM dump 是发生故障时整个内存的拍照。您可使用多种工具分析 RAM dump，包括 Qualcomm^®^ Crash Analysis Portal (QCAP)、RAMParser、Lauterbach TRACE32 模拟器和 Crash utility。

有关如何收集和解析 RAM dump 的更多信息，请参阅[收集和解析 RAM dump](https://docs.qualcomm.com/doc/80-70018-12SC/topic/debugging_linux_kernel.html#collect-and-parse-ram-dumps)。

### QXDM Professional

使用 QXDM Professional 调试各种子系统。

该工具可供具有授权访问权限的许可开发者使用。有关 QXDM Professional 命令及其用法的更多信息，请参阅 [Qualcomm Linux Debug Guide - Addendum](https://docs.qualcomm.com/bundle/resource/topics/80-70018-12A/debug-non-hlos-subsystems.html#qxdm_professional)。

## 常见系统问题

您可将系统问题分为以下类型之一：

> 
> 
> - [Linux 内核空间问题](https://docs.qualcomm.com/doc/80-70018-12SC/topic/debugging_linux_kernel.html#debugging-linux-kernel)
> - [系统问题](https://docs.qualcomm.com/doc/80-70018-12SC/topic/general_system_debugging.html#general-system-debugging)
> 
> 
> 
> > 
> > 
> > - [看门狗问题](https://docs.qualcomm.com/doc/80-70018-12SC/topic/general_system_debugging.html#watchdog-timeout)
> >     - [总线 hang 和超时问题](https://docs.qualcomm.com/doc/80-70018-12SC/topic/general_system_debugging.html#erroneous-transaction-on-bus-error-and-timeout)
> >     - [硬件复位问题](https://docs.qualcomm.com/doc/80-70018-12SC/topic/general_system_debugging.html#reset-hardware)

## 其他问题

可能遇到的其他各类问题如下：

- 由于软件 bug 导致设备冻结问题
- Linux应用程序相关问题
- 由于 PCB 相关硬件问题导致的随机复位

要调试 Linux 内核相关问题，请参阅[调试 Linux 内核空间问题](https://docs.qualcomm.com/doc/80-70018-12SC/topic/debugging_linux_kernel.html#debugging-linux-kernel)。

要调试 Linux 应用程序相关问题，请参阅[调试 Linux 用户空间问题](https://docs.qualcomm.com/doc/80-70018-12SC/topic/using_open_source_debug_tools.html#using-open-source-debug-tools)。

Last Published: May 12, 2025

[Next Topic
调试 Linux 用户空间问题](https://docs.qualcomm.com/bundle/publicresource/80-70018-12SC/topics/using_open_source_debug_tools.md)