# 概述

Source: [https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html](https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html)

子系统是指在 Qualcomm^®^ Linux 设备 (SoC) 上具有自己的独立执行环境的处理器。本指南介绍了用于对受影响子系统进行故障排除的工具、示例日志和步骤。以下是 Qualcomm SoC 上的不同子系统。 

Table : SoC 上的子系统

| 子系统 | 说明 |
| --- | --- |
| 应用处理器子系统 (APSS) | 这是主子系统。它将 Linux 内核作为 high-level OS (HLOS) 来运行。 |
| aDSP/LPASS | 应用数字信号处理器 (aDSP) 也被称为低功耗音频子系统 (LPASS)。 |
| mDSP/MPSS | Modem 处理器子系统 (Modem processor subsystem) |
| cDSP | Compute DSP |
| WPSS | WLAN 处理器子系统 (WLAN processor subsystem) |
| TrustZone (TZ) | 这是 Qualcomm 受信任执行环境。有关 TrustZone 子系统的更多信息，参见 [Qualcomm Linux 安全指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-11Y)。 |
| Always On 处理器 (AOP) | 该子系统可以调节设备的电源。 |

除了应用处理器，与所有其他子系统相关的软件也称为 non-HLOS。

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

要了解有关芯片组规范和功能框图的更多信息，参见 [QCS6490/QCS5430 Data Sheet](https://docs.qualcomm.com/bundle/publicresource/topics/80-23889-1/device-description.html)。

有关常用术语（如 NoC 和 xPU）的定义，参见[缩略词和术语](https://docs.qualcomm.com/doc/80-70014-12Y/topic/references.html#acronyms_and_terms)。
Note: Qualcomm Linux 平台可用来开发适用于 QCS6490 和 QCS5430 的应用程序。

## 调试工作流

Source: [https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html](https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html)

由于 SoC 中有多个子系统，因此首先需要确定发生问题的子系统，以便对正确的子系统进行调试。

应用处理器为主处理器，可以检测其他子系统何时发生崩溃。例如，如果 modem 处理器子系统崩溃，则内核日志会捕获子系统重启 (SSR) 崩溃错误日志。因此，要确定必须调试的子系统，必须先验证内核调试消息。

下图显示了识别需调试的子系统的调试工作流：
Figure : 识别要调试的子系统的调试工作流
        <?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="11.6458in" height="7.12084in" viewbox="0 0 838.5 512.7" xml:space="preserve" color-interpolation-filters="sRGB" class="st20"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-1 .st1 { fill: #f2f2f2; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st2 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st3 { fill: #000000; font-family: Arial; font-size: 0.833336em; font-weight: bold }
.svg-1 .st4 { font-family: SimHei; font-size: 1em; font-weight: normal }
.svg-1 .st5 { font-size: 1em; font-weight: normal }
.svg-1 .st6 { fill: none; stroke: #3253dc; stroke-width: 2.5 }
.svg-1 .st7 { fill: #000000; font-family: SimHei; font-size: 1.00001em }
.svg-1 .st8 { fill: #000000; font-family: Arial; font-size: 1.00001em }
.svg-1 .st9 { font-family: SimHei; font-size: 1em }
.svg-1 .st10 { font-size: 1em }
.svg-1 .st11 { fill: none; stroke: none; stroke-width: 1 }
.svg-1 .st12 { fill: none }
.svg-1 .st13 { stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.25 }
.svg-1 .st14 { fill: #000000; stroke: none; stroke-width: 1 }
.svg-1 .st15 { stroke: none; stroke-width: 2.25 }
.svg-1 .st16 { font-family: Arial; font-size: 1em }
.svg-1 .st17 { fill: #ffffff; stroke: none; stroke-linecap: butt; stroke-width: 7.2 }
.svg-1 .st18 { stroke: #3253dc; stroke-width: 2.5 }
.svg-1 .st19 { fill: #000000; font-family: SimHei; font-size: 0.75em }
.svg-1 .st20 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>Page-1</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="group142-1" transform="translate(0.75,-0.75)" v:mid="142" v:groupcontext="group">		<title>Sheet.142</title>		<g id="shape1-2" v:mid="1" v:groupcontext="shape">			<title>工作表.166</title>			<rect x="0" y="1.50001" width="837" height="511.2" class="st1"></rect>		</g>		<g id="group3-4" transform="translate(3.501,-3.75015)" v:mid="3" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape26-1</title>			<desc>*The debug features to troubleshoot errors in TrustZone are c...</desc>			<g id="shape4-5" v:mid="4" v:groupcontext="shape">				<title>工作表.4</title>				<desc>*对 TrustZone 中的错误进行故障排除的调试功能目前适用于对 Qualcomm Linux 发布的专有软件具有完全...</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="277.249" cy="506.7" width="554.51" height="12"></v:textrect>				<rect x="0" y="500.7" width="554.499" height="12" class="st2"></rect>				<text x="-0" y="509.95" class="st3" v:langid="2052"><v:paragraph></v:paragraph><v:tablist></v:tablist>*<tspan class="st4">对</tspan><tspan class="st5"> </tspan><tspan class="st5">TrustZone </tspan><tspan class="st4">中的错误进行故障排除的调试功能目前适用于对</tspan><tspan class="st5"> </tspan><tspan class="st5">Qualcomm Linux </tspan><tspan class="st4">发布的专有软件具有完全访问权限的用户</tspan><tspan class="st4">。</tspan></text>				</g>		</g>		<g id="group5-16" transform="translate(379.006,-461.25)" v:mid="5" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape1-8</title>			<desc>Start</desc>			<g id="shape6-17" v:mid="6" v:groupcontext="shape">				<title>工作表.6</title>				<path d="M14.93 512.7 L64.21 512.7 A14.7857 14.7857 -180 0 0 64.21 483.13 L14.93 483.13 A14.7857 14.7857 -180							 1 0 14.93 512.7 Z" class="st6"></path>			</g>			<g id="shape7-19" v:mid="7" v:groupcontext="shape" transform="translate(26.8992,-7.58977)">				<title>工作表.7</title>				<desc>启动</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="12.0001" cy="505.5" width="24.02" height="14.4002"></v:textrect>				<rect x="0" y="498.3" width="24.0003" height="14.4002" class="st2"></rect>				<text x="-0" y="509.1" class="st7" v:langid="2052"><v:paragraph></v:paragraph><v:tablist></v:tablist>启动</text>				</g>		</g>		<g id="group8-22" transform="translate(351.819,-327.021)" v:mid="8" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape2-11</title>			<desc>Panic or Bug in dmesg?</desc>			<g id="shape9-23" v:mid="9" v:groupcontext="shape">				<title>工作表.9</title>				<path d="M0 470.69 L66.69 428.68 L133.37 470.69 L66.69 512.7 L0 470.69 Z" class="st6"></path>			</g>			<g id="shape10-25" v:mid="10" v:groupcontext="shape" transform="translate(19.3849,-27.6098)">				<title>工作表.10</title>				<desc>dmesg 中有 Panic 或 Bug</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="47.5904" cy="496.516" width="95.2" height="32.369"></v:textrect>				<rect x="0" y="480.331" width="95.1808" height="32.369" class="st2"></rect>				<text x="15.91" y="492.62" class="st8" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>dmesg <tspan class="st9">中有</tspan> <tspan x="6.57" dy="1.3em" class="st10">Panic </tspan><tspan class="st9">或</tspan> Bug<tspan class="st9">？</tspan></text>				</g>		</g>		<g id="group11-32" transform="translate(413.771,-411.042)" v:mid="11" v:groupcontext="group">			<title>shape3-15</title>			<g id="group12-33" v:mid="12" v:groupcontext="group">				<title>工作表.12</title>				<g id="group13-34" transform="translate(4.738,-8.348)" v:mid="13" v:groupcontext="group">					<title>工作表.13</title>					<g id="shape14-35" v:mid="14" v:groupcontext="shape">						<title>Sheet.14</title>						<path d="M0.06 470.84 L0.06 488.84 L0 488.84 L0 512.7 L0.06 470.84 Z" class="st11"></path>					</g>					<g id="shape15-37" v:mid="15" v:groupcontext="shape">						<title>Sheet.15</title>						<path d="M0.06 470.84 L0.06 488.84 L0 488.84 L0 512.7 L0.06 470.84 Z" class="st12"></path>						<path d="M0.06 470.84 L0.06 488.84 L0 488.84 L0 512.7" class="st13"></path>					</g>				</g>				<g id="group16-40" transform="translate(512.7,503.16) rotate(90)" v:mid="16" v:groupcontext="group">					<title>mrkr5-20</title>					<g id="group17-41" transform="translate(9.54,1015.89) rotate(180)" v:mid="17" v:groupcontext="group">						<title>工作表.15</title>						<g id="shape18-42" v:mid="18" v:groupcontext="shape">							<title>Sheet.18</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st14"></path>						</g>						<g id="shape19-44" v:mid="19" v:groupcontext="shape">							<title>Sheet.19</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st12"></path>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7" class="st15"></path>						</g>					</g>				</g>			</g>		</g>		<g id="group20-47" transform="translate(159.763,-190.98)" v:mid="20" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape4-21</title>			<desc>Subsystem restart log in dmesg exists?</desc>			<g id="shape21-48" v:mid="21" v:groupcontext="shape">				<title>工作表.17</title>				<path d="M0 466.69 L66.69 420.67 L133.37 466.69 L66.69 512.7 L0 466.69 Z" class="st6"></path>			</g>			<g id="shape22-50" v:mid="22" v:groupcontext="shape" transform="translate(25.5634,-22.8158)">				<title>工作表.18</title>				<desc>子系统重启 日志在 dmesg 中是否存在?</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="41.1134" cy="490.2" width="82.24" height="45"></v:textrect>				<rect x="0" y="467.7" width="82.2269" height="45" class="st2"></rect>				<text x="11.11" y="478.2" class="st7" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>子系统重启<v:lf></v:lf><tspan x="3.44" dy="1.275em" class="st10">日志在</tspan><tspan class="st16"> </tspan><tspan class="st16">dmesg </tspan><tspan x="7.78" dy="1.3em" class="st10">中是否存在</tspan><tspan class="st16">?</tspan></text>				</g>		</g>		<g id="group23-58" transform="translate(551.878,-190.25)" v:mid="23" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape5-26</title>			<desc>Error in TrustZone*?</desc>			<g id="shape24-59" v:mid="24" v:groupcontext="shape">				<title>工作表.20</title>				<path d="M0 466.69 L66.69 420.67 L133.37 466.69 L66.69 512.7 L0 466.69 Z" class="st6"></path>			</g>			<g id="shape25-61" v:mid="25" v:groupcontext="shape" transform="translate(20.4483,-27.2016)">				<title>工作表.21</title>				<desc>TrustZone 中是否存在错误*</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="47.25" cy="497.63" width="94.51" height="30.1401"></v:textrect>				<rect x="0" y="482.56" width="94.5" height="30.1401" class="st2"></rect>				<text x="0.24" y="493.73" class="st8" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>TrustZone <tspan class="st9">中是否</tspan><tspan x="14.91" dy="1.3em" class="st9">存在错误</tspan>*<tspan class="st9">？</tspan></text>				</g>		</g>		<g id="group26-67" transform="translate(220.892,-283.006)" v:mid="26" v:groupcontext="group">			<title>工作表.23</title>			<g id="group27-68" transform="translate(4.738,-8.348)" v:mid="27" v:groupcontext="group">				<title>工作表.24</title>				<g id="shape28-69" v:mid="28" v:groupcontext="shape">					<title>Sheet.28</title>					<path d="M125.37 435.02 L0 435.02 L0 512.7 L125.37 435.02 Z" class="st11"></path>				</g>				<g id="shape29-71" v:mid="29" v:groupcontext="shape">					<title>Sheet.29</title>					<path d="M125.37 435.02 L0 435.02 L0 512.7 L125.37 435.02 Z" class="st12"></path>					<path d="M125.37 435.02 L0 435.02 L0 512.7" class="st13"></path>				</g>			</g>			<g id="group30-74" transform="translate(512.7,503.16) rotate(90)" v:mid="30" v:groupcontext="group">				<title>mrkr5-20</title>				<g id="group31-75" transform="translate(9.54,1015.89) rotate(180)" v:mid="31" v:groupcontext="group">					<title>工作表.26</title>					<g id="shape32-76" v:mid="32" v:groupcontext="shape">						<title>Sheet.32</title>						<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st14"></path>					</g>					<g id="shape33-78" v:mid="33" v:groupcontext="shape">						<title>Sheet.33</title>						<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st12"></path>						<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7" class="st15"></path>					</g>				</g>			</g>		</g>		<g id="shape34-81" v:mid="34" v:groupcontext="shape" transform="translate(234.963,-361.834)">			<title>工作表.27</title>			<rect x="0" y="498.3" width="20.6782" height="14.4001" class="st17"></rect>		</g>		<g id="shape35-83" v:mid="35" v:groupcontext="shape" transform="translate(240.061,-361.834)">			<title>工作表.28</title>			<desc>是</desc>			<v:userdefs></v:userdefs>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="8.52002" cy="505.5" width="17.06" height="14.4002"></v:textrect>			<rect x="0" y="498.3" width="17.0401" height="14.4002" class="st2"></rect>			<text x="-0" y="509.1" class="st7" v:langid="2052"><v:paragraph></v:paragraph><v:tablist></v:tablist>是</text>			</g>		<g id="group36-86" transform="translate(485.192,-282.276)" v:mid="36" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape7-37</title>			<desc>No</desc>			<g id="group37-87" v:mid="37" v:groupcontext="group">				<title>工作表.30</title>				<g id="group38-88" transform="translate(-1.32694E-12,-8.348)" v:mid="38" v:groupcontext="group">					<title>工作表.31</title>					<g id="shape39-89" v:mid="39" v:groupcontext="shape">						<title>Sheet.39</title>						<path d="M0 434.29 L133.37 434.29 L133.37 512.7 L0 434.29 Z" class="st11"></path>					</g>					<g id="shape40-91" v:mid="40" v:groupcontext="shape">						<title>Sheet.40</title>						<path d="M0 434.29 L133.37 434.29 L133.37 512.7 L0 434.29 Z" class="st12"></path>						<path d="M0 434.29 L133.37 434.29 L133.37 512.7" class="st13"></path>					</g>				</g>				<g id="group41-94" transform="translate(641.332,503.16) rotate(90)" v:mid="41" v:groupcontext="group">					<title>mrkr5-20</title>					<g id="group42-95" transform="translate(9.54,1015.89) rotate(180)" v:mid="42" v:groupcontext="group">						<title>工作表.33</title>						<g id="shape43-96" v:mid="43" v:groupcontext="shape">							<title>Sheet.43</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st14"></path>						</g>						<g id="shape44-98" v:mid="44" v:groupcontext="shape">							<title>Sheet.44</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st12"></path>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7" class="st15"></path>						</g>					</g>				</g>			</g>			<g id="shape45-101" v:mid="45" v:groupcontext="shape" transform="translate(102.394,-79.5578)">				<title>工作表.34</title>				<rect x="0" y="498.3" width="15.3399" height="14.4001" class="st17"></rect>			</g>			<g id="shape46-103" v:mid="46" v:groupcontext="shape" transform="translate(103.859,-79.5578)">				<title>工作表.35</title>				<desc>否</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="6.00005" cy="505.5" width="12.02" height="14.4002"></v:textrect>				<rect x="0" y="498.3" width="12.0001" height="14.4002" class="st2"></rect>				<text x="-0" y="509.1" class="st7" v:langid="2052"><v:paragraph></v:paragraph><v:tablist></v:tablist>否</text>				</g>		</g>		<g id="group47-106" transform="translate(53.7986,-59.7026)" v:mid="47" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape8-44</title>			<desc>Debug specific subsystem</desc>			<g id="shape48-107" v:mid="48" v:groupcontext="shape">				<title>工作表.37</title>				<path d="M0 512.7 L98.57 512.7 L98.57 438.77 L0 438.77 L0 512.7 Z" class="st11"></path>			</g>			<g id="shape49-109" v:mid="49" v:groupcontext="shape">				<title>工作表.38</title>				<rect x="0" y="438.77" width="98.57" height="73.93" class="st6"></rect>			</g>			<g id="group50-111" transform="translate(9,5.68434E-13)" v:mid="50" v:groupcontext="group">				<title>工作表.39</title>				<g id="shape51-112" v:mid="51" v:groupcontext="shape">					<title>Sheet.51</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st11"></path>				</g>				<g id="shape52-114" v:mid="52" v:groupcontext="shape">					<title>Sheet.52</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st12"></path>					<path d="M0 512.7 L0 438.77" class="st18"></path>				</g>			</g>			<g id="group53-117" transform="translate(89.57,5.68434E-13)" v:mid="53" v:groupcontext="group">				<title>工作表.40</title>				<g id="shape54-118" v:mid="54" v:groupcontext="shape">					<title>Sheet.54</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st11"></path>				</g>				<g id="shape55-120" v:mid="55" v:groupcontext="shape">					<title>Sheet.55</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st12"></path>					<path d="M0 512.7 L0 438.77" class="st18"></path>				</g>			</g>			<g id="shape56-123" v:mid="56" v:groupcontext="shape" transform="translate(16.732,-3.29757)">				<title>工作表.41</title>				<desc>调试特定的子系统</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="31.5" cy="478.95" width="63.01" height="67.5"></v:textrect>				<rect x="0" y="445.2" width="63" height="67.5" class="st2"></rect>				<text x="1.5" y="475.35" class="st7" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>调试特定的<tspan x="13.5" dy="1.2em" class="st10">子系统</tspan></text>				</g>		</g>		<g id="group57-127" transform="translate(290.37,-59.7026)" v:mid="57" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape10-52</title>			<desc>Debug Application processor</desc>			<g id="shape58-128" v:mid="58" v:groupcontext="shape">				<title>工作表.43</title>				<path d="M0 512.7 L98.57 512.7 L98.57 438.77 L0 438.77 L0 512.7 Z" class="st11"></path>			</g>			<g id="shape59-130" v:mid="59" v:groupcontext="shape">				<title>工作表.44</title>				<rect x="0" y="438.77" width="98.57" height="73.93" class="st6"></rect>			</g>			<g id="group60-132" transform="translate(9,5.68434E-13)" v:mid="60" v:groupcontext="group">				<title>工作表.45</title>				<g id="shape61-133" v:mid="61" v:groupcontext="shape">					<title>Sheet.61</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st11"></path>				</g>				<g id="shape62-135" v:mid="62" v:groupcontext="shape">					<title>Sheet.62</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st12"></path>					<path d="M0 512.7 L0 438.77" class="st18"></path>				</g>			</g>			<g id="group63-138" transform="translate(89.57,5.68434E-13)" v:mid="63" v:groupcontext="group">				<title>工作表.46</title>				<g id="shape64-139" v:mid="64" v:groupcontext="shape">					<title>Sheet.64</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st11"></path>				</g>				<g id="shape65-141" v:mid="65" v:groupcontext="shape">					<title>Sheet.65</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st12"></path>					<path d="M0 512.7 L0 438.77" class="st18"></path>				</g>			</g>			<g id="shape66-144" v:mid="66" v:groupcontext="shape" transform="translate(13.4258,-4.03226)">				<title>工作表.47</title>				<desc>调试应用程序处理器</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="36" cy="478.95" width="72.01" height="67.5"></v:textrect>				<rect x="0" y="445.2" width="72" height="67.5" class="st2"></rect>				<text x="6" y="475.35" class="st7" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>调试应用程<tspan x="12" dy="1.2em" class="st10">序处理器</tspan></text>				</g>		</g>		<g id="group67-148" transform="translate(568.251,-59.7026)" v:mid="67" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape11-60</title>			<desc>Debug Always-on processor</desc>			<g id="shape68-149" v:mid="68" v:groupcontext="shape">				<title>工作表.49</title>				<path d="M0 512.7 L98.57 512.7 L98.57 438.77 L0 438.77 L0 512.7 Z" class="st11"></path>			</g>			<g id="shape69-151" v:mid="69" v:groupcontext="shape">				<title>工作表.50</title>				<rect x="0" y="438.77" width="98.57" height="73.93" class="st6"></rect>			</g>			<g id="group70-153" transform="translate(9,5.68434E-13)" v:mid="70" v:groupcontext="group">				<title>工作表.51</title>				<g id="shape71-154" v:mid="71" v:groupcontext="shape">					<title>Sheet.71</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st11"></path>				</g>				<g id="shape72-156" v:mid="72" v:groupcontext="shape">					<title>Sheet.72</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st12"></path>					<path d="M0 512.7 L0 438.77" class="st18"></path>				</g>			</g>			<g id="group73-159" transform="translate(89.57,5.68434E-13)" v:mid="73" v:groupcontext="group">				<title>工作表.52</title>				<g id="shape74-160" v:mid="74" v:groupcontext="shape">					<title>Sheet.74</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st11"></path>				</g>				<g id="shape75-162" v:mid="75" v:groupcontext="shape">					<title>Sheet.75</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st12"></path>					<path d="M0 512.7 L0 438.77" class="st18"></path>				</g>			</g>			<g id="shape76-165" v:mid="76" v:groupcontext="shape" transform="translate(18.0344,-0.35879)">				<title>工作表.53</title>				<desc>调试 Always-on 处理器</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="31.5" cy="476.7" width="63.01" height="72"></v:textrect>				<rect x="0" y="440.7" width="63" height="72" class="st2"></rect>				<text x="19.5" y="466.2" class="st7" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>调试<tspan class="st16"> </tspan><tspan x="3.82" dy="1.225em" class="st16">Always</tspan><tspan class="st16">-</tspan><tspan class="st16">on </tspan><tspan x="13.5" dy="1.2em" class="st10">处理器</tspan> </text>				</g>		</g>		<g id="group77-173" transform="translate(694.239,-59.7026)" v:mid="77" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape12-68</title>			<desc>Debug NoC</desc>			<g id="shape78-174" v:mid="78" v:groupcontext="shape">				<title>工作表.55</title>				<path d="M0 512.7 L98.57 512.7 L98.57 438.77 L0 438.77 L0 512.7 Z" class="st11"></path>			</g>			<g id="shape79-176" v:mid="79" v:groupcontext="shape">				<title>工作表.56</title>				<rect x="0" y="438.77" width="98.57" height="73.93" class="st6"></rect>			</g>			<g id="group80-178" transform="translate(9,5.68434E-13)" v:mid="80" v:groupcontext="group">				<title>工作表.57</title>				<g id="shape81-179" v:mid="81" v:groupcontext="shape">					<title>Sheet.81</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st11"></path>				</g>				<g id="shape82-181" v:mid="82" v:groupcontext="shape">					<title>Sheet.82</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st12"></path>					<path d="M0 512.7 L0 438.77" class="st18"></path>				</g>			</g>			<g id="group83-184" transform="translate(89.57,5.68434E-13)" v:mid="83" v:groupcontext="group">				<title>工作表.58</title>				<g id="shape84-185" v:mid="84" v:groupcontext="shape">					<title>Sheet.84</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st11"></path>				</g>				<g id="shape85-187" v:mid="85" v:groupcontext="shape">					<title>Sheet.85</title>					<path d="M0 512.7 L0 438.77 L0 512.7 Z" class="st12"></path>					<path d="M0 512.7 L0 438.77" class="st18"></path>				</g>			</g>			<g id="shape86-190" v:mid="86" v:groupcontext="shape" transform="translate(12.7872,-29.7598)">				<title>工作表.59</title>				<desc>调试 NoC</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="36.0004" cy="505.5" width="72.02" height="14.4002"></v:textrect>				<rect x="0" y="498.3" width="72.0008" height="14.4002" class="st2"></rect>				<text x="10.33" y="509.4" class="st7" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>调试<tspan class="st16"> </tspan><tspan class="st16">NoC</tspan></text>				</g>		</g>		<g id="group87-195" transform="translate(92.4923,-133.626)" v:mid="87" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape13-74</title>			<desc>Yes</desc>			<g id="group88-196" transform="translate(5.5997,2.27374E-13)" v:mid="88" v:groupcontext="group">				<title>工作表.61</title>				<g id="group89-197" transform="translate(4.738,-8.348)" v:mid="89" v:groupcontext="group">					<title>工作表.62</title>					<g id="shape90-198" v:mid="90" v:groupcontext="shape">						<title>Sheet.90</title>						<path d="M56.68 417.68 L0 417.68 L0 512.7 L56.68 417.68 Z" class="st11"></path>					</g>					<g id="shape91-200" v:mid="91" v:groupcontext="shape">						<title>Sheet.91</title>						<path d="M56.68 417.68 L0 417.68 L0 512.7 L56.68 417.68 Z" class="st12"></path>						<path d="M56.68 417.68 L0 417.68 L0 512.7" class="st13"></path>					</g>				</g>				<g id="group92-203" transform="translate(512.7,503.16) rotate(90)" v:mid="92" v:groupcontext="group">					<title>mrkr5-20</title>					<g id="group93-204" transform="translate(9.54,1015.89) rotate(180)" v:mid="93" v:groupcontext="group">						<title>工作表.64</title>						<g id="shape94-205" v:mid="94" v:groupcontext="shape">							<title>Sheet.94</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st14"></path>						</g>						<g id="shape95-207" v:mid="95" v:groupcontext="shape">							<title>Sheet.95</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st12"></path>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7" class="st15"></path>						</g>					</g>				</g>			</g>			<g id="shape96-210" v:mid="96" v:groupcontext="shape" transform="translate(9.99201E-14,-72.8248)">				<title>工作表.65</title>				<rect x="0" y="498.3" width="20.6782" height="14.4001" class="st17"></rect>			</g>			<g id="shape97-212" v:mid="97" v:groupcontext="shape" transform="translate(4.40586,-72.8278)">				<title>工作表.66</title>				<desc>是</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="6.00005" cy="505.5" width="12.02" height="14.4002"></v:textrect>				<rect x="0" y="498.3" width="12.0001" height="14.4002" class="st2"></rect>				<text x="-0" y="509.1" class="st7" v:langid="2052"><v:paragraph></v:paragraph><v:tablist></v:tablist>是</text>				</g>		</g>		<g id="group98-215" transform="translate(293.136,-133.626)" v:mid="98" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape14-81</title>			<desc>No</desc>			<g id="group99-216" v:mid="99" v:groupcontext="group">				<title>工作表.68</title>				<g id="group100-217" transform="translate(-3.59712E-14,-8.348)" v:mid="100" v:groupcontext="group">					<title>工作表.69</title>					<g id="shape101-218" v:mid="101" v:groupcontext="shape">						<title>Sheet.101</title>						<path d="M0 417.68 L46.52 417.68 L46.52 512.7 L0 417.68 Z" class="st11"></path>					</g>					<g id="shape102-220" v:mid="102" v:groupcontext="shape">						<title>Sheet.102</title>						<path d="M0 417.68 L46.52 417.68 L46.52 512.7 L0 417.68 Z" class="st12"></path>						<path d="M0 417.68 L46.52 417.68 L46.52 512.7" class="st13"></path>					</g>				</g>				<g id="group103-223" transform="translate(554.482,503.16) rotate(90)" v:mid="103" v:groupcontext="group">					<title>mrkr5-20</title>					<g id="group104-224" transform="translate(9.54,1015.89) rotate(180)" v:mid="104" v:groupcontext="group">						<title>工作表.71</title>						<g id="shape105-225" v:mid="105" v:groupcontext="shape">							<title>Sheet.105</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st14"></path>						</g>						<g id="shape106-227" v:mid="106" v:groupcontext="shape">							<title>Sheet.106</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st12"></path>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7" class="st15"></path>						</g>					</g>				</g>			</g>			<g id="shape107-230" v:mid="107" v:groupcontext="shape" transform="translate(38.8502,-67.7458)">				<title>工作表.72</title>				<rect x="0" y="498.3" width="15.3399" height="14.4001" class="st17"></rect>			</g>			<g id="shape108-232" v:mid="108" v:groupcontext="shape" transform="translate(40.6597,-67.7478)">				<title>工作表.73</title>				<desc>否</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="6.00005" cy="505.5" width="12.02" height="14.4002"></v:textrect>				<rect x="0" y="498.3" width="12.0001" height="14.4002" class="st2"></rect>				<text x="-0" y="509.1" class="st7" v:langid="2052"><v:paragraph></v:paragraph><v:tablist></v:tablist>否</text>				</g>		</g>		<g id="group110-235" transform="translate(388.941,-91.8942)" v:mid="110" v:groupcontext="group">			<title>工作表.75</title>			<g id="group111-236" transform="translate(8.3475,-4.77)" v:mid="111" v:groupcontext="group">				<title>工作表.76</title>				<g id="shape112-237" v:mid="112" v:groupcontext="shape">					<title>Sheet.112</title>					<path d="M154.59 373.1 L32.15 373.1 L32.15 512.7 L0 512.7 L154.59 373.1 Z" class="st11"></path>				</g>				<g id="shape113-239" v:mid="113" v:groupcontext="shape">					<title>Sheet.113</title>					<path d="M154.59 373.1 L32.15 373.1 L32.15 512.7 L0 512.7 L154.59 373.1 Z" class="st12"></path>					<path d="M154.59 373.1 L32.15 373.1 L32.15 512.7 L0 512.7" class="st13"></path>				</g>			</g>			<g id="group114-242" transform="translate(9.54,1015.89) rotate(180)" v:mid="114" v:groupcontext="group">				<title>mrkr5-20</title>				<g id="group115-243" transform="translate(9.54,1015.89) rotate(180)" v:mid="115" v:groupcontext="group">					<title>工作表.78</title>					<g id="shape116-244" v:mid="116" v:groupcontext="shape">						<title>Sheet.116</title>						<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st14"></path>					</g>					<g id="shape117-246" v:mid="117" v:groupcontext="shape">						<title>Sheet.117</title>						<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st12"></path>						<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7" class="st15"></path>					</g>				</g>			</g>		</g>		<g id="shape118-249" v:mid="118" v:groupcontext="shape" transform="translate(388.927,-171)">			<title>工作表.79</title>			<rect x="0" y="449.265" width="81.0264" height="63.435" class="st17"></rect>		</g>		<g id="shape119-251" v:mid="119" v:groupcontext="shape" transform="translate(385.255,-171)">			<title>工作表.80</title>			<desc>非安全看门狗 BiteAHB 超时XPU 错误SMMU 错误 无错误</desc>			<v:userdefs></v:userdefs>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="44.0359" cy="481.764" width="88.09" height="61.8728"></v:textrect>			<rect x="0" y="450.827" width="88.0718" height="61.8728" class="st2"></rect>			<text x="17.04" y="461.73" class="st19" v:langid="2052"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>非安全看门狗<tspan class="st16"> </tspan><tspan x="16.78" dy="1.3em" class="st16">BiteAHB </tspan>超时<v:newlinechar></v:newlinechar><tspan x="25.78" dy="1.3em" class="st16">XPU</tspan>错误<v:newlinechar></v:newlinechar><tspan x="20.04" dy="1.3em" class="st16">SMMU </tspan>错误<v:lf></v:lf><tspan x="30.54" dy="1.225em" class="st10">无错误</tspan></text>			</g>		<g id="group120-259" transform="translate(685.251,-133.626)" v:mid="120" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape18-99</title>			<desc>NoC error</desc>			<g id="group121-260" v:mid="121" v:groupcontext="group">				<title>工作表.82</title>				<g id="group122-261" transform="translate(-9.99201E-14,-8.348)" v:mid="122" v:groupcontext="group">					<title>工作表.83</title>					<g id="shape123-262" v:mid="123" v:groupcontext="shape">						<title>Sheet.123</title>						<path d="M0 418.41 L58.27 418.41 L58.27 512.7 L0 418.41 Z" class="st11"></path>					</g>					<g id="shape124-264" v:mid="124" v:groupcontext="shape">						<title>Sheet.124</title>						<path d="M0 418.41 L58.27 418.41 L58.27 512.7 L0 418.41 Z" class="st12"></path>						<path d="M0 418.41 L58.27 418.41 L58.27 512.7" class="st13"></path>					</g>				</g>				<g id="group125-267" transform="translate(566.232,503.16) rotate(90)" v:mid="125" v:groupcontext="group">					<title>mrkr5-20</title>					<g id="group126-268" transform="translate(9.54,1015.89) rotate(180)" v:mid="126" v:groupcontext="group">						<title>工作表.85</title>						<g id="shape127-269" v:mid="127" v:groupcontext="shape">							<title>Sheet.127</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st14"></path>						</g>						<g id="shape128-271" v:mid="128" v:groupcontext="shape">							<title>Sheet.128</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st12"></path>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7" class="st15"></path>						</g>					</g>				</g>			</g>			<g id="shape129-274" v:mid="129" v:groupcontext="shape" transform="translate(31.9359,-73.2578)">				<title>工作表.86</title>				<rect x="0" y="498.3" width="52.6759" height="14.4001" class="st17"></rect>			</g>			<g id="shape130-276" v:mid="130" v:groupcontext="shape" transform="translate(31.94,-73.2578)">				<title>工作表.87</title>				<desc>NoC 错误</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="36.0004" cy="505.5" width="72.02" height="14.4002"></v:textrect>				<rect x="0" y="498.3" width="72.0008" height="14.4002" class="st2"></rect>				<text x="-0" y="509.4" class="st8" v:langid="2052"><v:paragraph></v:paragraph><v:tablist></v:tablist>NoC <tspan class="st9">错误</tspan></text>				</g>		</g>		<g id="group131-280" transform="translate(592.574,-133.581)" v:mid="131" v:groupcontext="group">			<v:userdefs></v:userdefs>			<title>shape21-106</title>			<desc>AoP error</desc>			<g id="group132-281" transform="translate(20.6301,3.41061E-13)" v:mid="132" v:groupcontext="group">				<title>工作表.89</title>				<g id="group133-282" transform="translate(4.82988,-8.39919)" v:mid="133" v:groupcontext="group">					<title>工作表.90</title>					<g id="shape134-283" v:mid="134" v:groupcontext="shape">						<title>Sheet.134</title>						<path d="M0.53 464.43 L0 512.7 L0.53 464.43 Z" class="st11"></path>					</g>					<g id="shape135-285" v:mid="135" v:groupcontext="shape">						<title>Sheet.135</title>						<path d="M0.53 464.43 L0 512.7 L0.53 464.43 Z" class="st12"></path>						<path d="M0.53 464.43 L0 512.7" class="st13"></path>					</g>				</g>				<g id="group136-288" transform="translate(512.774,508.686) rotate(90.6291)" v:mid="136" v:groupcontext="group">					<title>mrkr5-20</title>					<g id="group137-289" transform="translate(9.54,1015.89) rotate(180)" v:mid="137" v:groupcontext="group">						<title>工作表.92</title>						<g id="shape138-290" v:mid="138" v:groupcontext="shape">							<title>Sheet.138</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st14"></path>						</g>						<g id="shape139-292" v:mid="139" v:groupcontext="shape">							<title>Sheet.139</title>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7 L9.54 512.7 Z" class="st12"></path>							<path d="M9.54 512.7 L0 507.93 L9.45 503.19 C7.97 506.19 7.98 509.71 9.47 512.7" class="st15"></path>						</g>					</g>				</g>			</g>			<g id="shape140-295" v:mid="140" v:groupcontext="shape" transform="translate(0.0041,-21.159)">				<title>工作表.93</title>				<rect x="0" y="498.3" width="51.352" height="14.4001" class="st17"></rect>			</g>			<g id="shape141-297" v:mid="141" v:groupcontext="shape" transform="translate(-1.83853E-13,-21.159)">				<title>工作表.94</title>				<desc>AoP 错误</desc>				<v:userdefs></v:userdefs>				<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>				<v:textrect cx="36.0004" cy="505.5" width="72.02" height="14.4002"></v:textrect>				<rect x="0" y="498.3" width="72.0008" height="14.4002" class="st2"></rect>				<text x="-0" y="509.4" class="st8" v:langid="2052"><v:paragraph></v:paragraph><v:tablist></v:tablist>AoP <tspan class="st9">错误</tspan></text>				</g>		</g>	</g></g>
</svg>

当内核 dmesg 日志中没有 panic 标识特征时，去验证 TrustZone 诊断 (diag) 日志是否存在诸如 Non-secure watchdog bite、NoC error 等错误。下面是一些指示 panic、bug 和子系统崩溃问题的内核消息示例。

### 识别内核 panic 和 bug

根据内核 dmesg 日志，可以确定该复位是内核 panic 还是 bug。下面是指示内核 panic 或 bug 的一些示例日志：

- Panic （模式 1：一般错误）

        18.800936: <6> Kernel panic - not syncing: Fatal exception
        18.800938: <6> SMP: stopping secondary CPUs
        18.800947: <6> CPU0: stopping
        Kernel panic - not syncing: Apps watchdog Bark received!Copy to clipboard
- Bug（模式 1）

        12.899532: <6> BUG kmalloc-128 (Not tainted): Redzone overwritten
        12.905418: <6> -----------------------------------------------------------------------------Copy to clipboard
- Bug（模式 2）

        320.510769: <6> ------------[ cut here ]------------
        320.510781: <6> 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!Copy to clipboard
- 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!Copy to clipboard

Note: 大多数 bug 之后都会发生内核 panic。

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

确定重启的原因是否为子系统崩溃，验证内核 dmesg 日志。例如，以下日志表明，根据 qcm6490.dtsi（节点：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 rejectedCopy to clipboard

### 根据 TrustZone 日志识别系统问题

此功能目前可用于对随 Qualcomm Linux 一同发布的专有软件具有完全访问权限的用户。有关 TrustZone 中指示错误的示例日志，参见 [Qualcomm Linux Debug Guide - Addendum](https://docs.qualcomm.com/bundle/resource/topics/80-70014-12A/identify_subsystem_to_be_debugged.html#identify_and_debug_errors_in_tz)。

如果 TrustZone 诊断日志没有错误，则很可能是 secure watchdog bite 问题。有关看门狗问题的更多信息，参见[硬件复位](https://docs.qualcomm.com/doc/80-70014-12Y/topic/general_system_debugging.html#reset_hardware)。

有关 TrustZone 中调试问题的信息，参见 [Qualcomm Linux 安全指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-11Y/debug.html)。

## 调试功能

Source: [https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html](https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html)

有两种调试方法：

- **目标上调试**
    目标上调试是调试软件问题的基本方式。这种方法十分强大，因为可以从实时设备访问大部分信息。但是，这种方法要求问题易于复现，并且还需要附加的硬件组件，例如主机 PC、调试器。

    SSH 是连接主机与设备的主要工具。要使用 SSH，必须遵循[此处](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254Y/how_to.html#how-to-ssh-)所述的步骤来启用 SELinux Permissive 模式。
- **目标外调试**

    这种调试方法需要日志而不是实际设备，因此是一种方便、高效的调试方法。使用内存 dump 或日志工具完成调试。离线调试可使用各种类型的日志。您也可以使用保存在嵌入式文件系统中的日志文件。由于 RAM dump 会捕获大部分内存区域，但获取的硬件寄存器信息有限，因此调试硬件相关问题是一大挑战。

## 目标上调试功能

Source: [https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html](https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html)

设备上提供了以下调试功能，可以在运行时使用。

### Perf 工具

Perf 是 Linux 生态系统中一个功能强大的工具，它可以简化性能分析。Linux 内核的 tools/perf 目录中包括此工具。

Perf 工具可以帮助调试系统行为的各个方面，包括 CPU 性能计数器、跟踪点、kprobe 和 uprobe（用于动态跟踪）。下面是 Perf 工具的主要功能：
- **CPU 性能计数器**：这些 CPU 硬件寄存器用于跟踪已执行指令、缓存未命中和分支误预测等事件。这些事件构成了分析应用程序和识别性能瓶颈的基础。
- **TracePoint**：这些跟踪点放置在代码中的逻辑位置。例如，系统调用、网络事件、文件系统操作。这些跟踪点以最小的开销提供时间戳和堆栈跟踪等信息。
- **动态跟踪**：Perf 可利用 kprobe 和 uprobe 框架动态创建跟踪点。因此，可以在内核和用户空间中进行跟踪。

有关 Perf 工具的详细信息，参见以下内容：
- [https://docs.kernel.org/trace/coresight/coresight-perf.html](https://docs.kernel.org/trace/coresight/coresight-perf.html)
- [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://perf.wiki.kernel.org/index.php/Tutorial](https://perf.wiki.kernel.org/index.php/Tutorial)

### 子系统重启

子系统可在崩溃时单独重启，无需设备重启。这种从端重启的功能称为子系统重启 (SSR)。建议仅在商用设备上使用 SSR 功能，不要在开发阶段使用。此功能可通过上游 Linux 内核中提供的 remoteproc 框架来实现。

默认情况下，禁用 SSR 来启用完整内存 dump 以调试问题。有关 SSR 功能的详细信息，参见 [Remoteproc 子系统](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-3Y/features.html#Toc187817603)。

SSR dump 可作为 SSR 操作的一部分启用。SSR dump 在子系统重启时生成（如果已启用 SSR dump）。由于 SSR dump 的大小小于完整内存 dump 的大小，因此您可能倾向于使用 SSR dump 进行调试。但是，调试某些子系统崩溃需要整个 RAM dump。

有关如何启用和捕获子系统 dump 的信息，参见[子系统 dump](https://docs.qualcomm.com/doc/80-70014-12Y/topic/debugging_linux_kernel.html#subsystem_ram_dumps)。

### 强制子系统复位

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

此功能目前适用于对随 Qualcomm Linux 一同发布的专有软件具有完全访问权限的用户。要强制复位子系统，可以使用 QXDM 工具运行诊断命令。有关 QXDM 工具命令及其用法的信息，参见 [Qualcomm Linux Debug Guide - Addendum](https://docs.qualcomm.com/bundle/resource/topics/80-70014-12A/debug-non-hlos-subsystems.html#qxdm_professional)。

## 目标外调试功能

Source: [https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html](https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html)

以下功能和工具可用于离线调试。

### RAM dump

RAM dump 是故障发生时整个内存 (RAM) 的快照。可使用各种工具（包括 QCAP、RAM parser 和 TRACE32 仿真器）来分析 RAM dump。有关如何收集和解析 RAM dump 的信息，参见[收集并解析 RAM dump](https://docs.qualcomm.com/doc/80-70014-12Y/topic/debugging_linux_kernel.html#collect_and_parse_ram_dumps)。

### QXDM Professional™

QXDM Professional 工具可用于调试各种子系统。

此工具目前适用于对随 Qualcomm Linux 一同发布的专有软件具有完全访问权限的用户。有关 QXDM 工具命令及其用法的信息，参见 [Qualcomm Linux Debug Guide - Addendum](https://docs.qualcomm.com/bundle/resource/topics/80-70014-12A/debug-non-hlos-subsystems.html#qxdm_professional)。

## 常见问题

Source: [https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html](https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html)

系统故障可分类为以下情况之一：

- [Linux 内核空间问题](https://docs.qualcomm.com/doc/80-70014-12Y/topic/debugging_linux_kernel.html)
- [系统问题](https://docs.qualcomm.com/doc/80-70014-12Y/topic/general_system_debugging.html)
    - [看门狗问题](https://docs.qualcomm.com/doc/80-70014-12Y/topic/general_system_debugging.html#watchdog_timeout)
    - [总线 hang 和超时问题](https://docs.qualcomm.com/doc/80-70014-12Y/topic/general_system_debugging.html#erroneous_transaction_on_bus_error_and_timeout)
    - [硬件复位问题](https://docs.qualcomm.com/doc/80-70014-12Y/topic/general_system_debugging.html#reset_hardware)

## 其他问题

Source: [https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html](https://docs.qualcomm.com/doc/80-70014-12Y/topic/Debug-overview.html)

以下是您可能遇到的其他问题：
- 软件 bug 导致设备冻结问题
- Linux 应用程序相关问题
- 由于 PCB 相关硬件问题导致的随机复位

要调试 Linux 内核相关问题，参见[调试 Linux 内核空间](https://docs.qualcomm.com/doc/80-70014-12Y/topic/debugging_linux_kernel.html)。

要调试 Linux 应用程序相关问题，参见[调试 Linux 用户空间](https://docs.qualcomm.com/doc/80-70014-12Y/topic/using_open_source_debug_tools.html)。

Last Published: Aug 22, 2024

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