parthtamu/rag-code-assistant
0
1<!DOCTYPE html>2 3<html lang="en" data-content_root="../">4 <head>5 <meta charset="utf-8" />6 <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />7<meta property="og:title" content="Debugging and profiling" />8<meta property="og:type" content="website" />9<meta property="og:url" content="https://docs.python.org/3/library/debug.html" />10<meta property="og:site_name" content="Python documentation" />11<meta property="og:description" content="These libraries help you with Python development: the debugger enables you to step through code, analyze stack frames and set breakpoints etc., and the profilers run code and give you a detailed br..." />12<meta property="og:image:width" content="1146" />13<meta property="og:image:height" content="600" />14<meta property="og:image" content="https://docs.python.org/3.15/_images/social_previews/summary_library_debug_c9b4915a.png" />15<meta property="og:image:alt" content="These libraries help you with Python development: the debugger enables you to step through code, analyze stack frames and set breakpoints etc., and the profilers run code and give you a detailed br..." />16<meta name="description" content="These libraries help you with Python development: the debugger enables you to step through code, analyze stack frames and set breakpoints etc., and the profilers run code and give you a detailed br..." />17<meta name="twitter:card" content="summary_large_image" />18<meta name="theme-color" content="#3776ab">19 20 <title>Debugging and profiling — Python 3.15.0a6 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0">21 22 <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />23 <link rel="stylesheet" type="text/css" href="../_static/classic.css?v=234b1a7c" />24 <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=89a2f22a" />25 <link rel="stylesheet" type="text/css" href="../_static/profiling-sampling-visualization.css?v=0c2600ae" />26 <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css?v=5349f25f" />27 28 <script src="../_static/documentation_options.js?v=6b7c9ff5"></script>29 <script src="../_static/doctools.js?v=9bcbadda"></script>30 <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>31 <script src="../_static/profiling-sampling-visualization.js?v=9811ed04"></script>32 33 <script src="../_static/sidebar.js"></script>34 35 <link rel="search" type="application/opensearchdescription+xml"36 title="Search within Python 3.15.0a6 documentation"37 href="../_static/opensearch.xml"/>38 <link rel="author" title="About these documents" href="../about.html" />39 <link rel="index" title="Index" href="../genindex.html" />40 <link rel="search" title="Search" href="../search.html" />41 <link rel="copyright" title="Copyright" href="../copyright.html" />42 <link rel="next" title="Audit events table" href="audit_events.html" />43 <link rel="prev" title="test — Regression tests package for Python" href="test.html" />44 45 46 <script defer file-types="bz2,epub,zip" data-domain="docs.python.org" src="https://analytics.python.org/js/script.file-downloads.outbound-links.js"></script>47 48 <link rel="canonical" href="https://docs.python.org/3/library/debug.html">49 50 51 52 53 <style>54 @media only screen {55 table.full-width-table {56 width: 100%;57 }58 }59 </style>60<link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">61 <link rel="shortcut icon" type="image/png" href="../_static/py.svg">62 <script type="text/javascript" src="../_static/copybutton.js"></script>63 <script type="text/javascript" src="../_static/menu.js"></script>64 <script type="text/javascript" src="../_static/search-focus.js"></script>65 <script type="text/javascript" src="../_static/themetoggle.js"></script> 66 <script type="text/javascript" src="../_static/rtd_switcher.js"></script>67 <meta name="readthedocs-addons-api-version" content="1">68 69 </head>70<body>71<div class="mobile-nav">72 <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"73 aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu">74 <nav class="nav-content" role="navigation">75 <label for="menuToggler" class="toggler__label">76 <span></span>77 </label>78 <span class="nav-items-wrapper">79 <a href="https://www.python.org/" class="nav-logo">80 <img src="../_static/py.svg" alt="Python logo">81 </a>82 <span class="version_switcher_placeholder"></span>83 <form role="search" class="search" action="../search.html" method="get">84 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">85 <path fill-rule="nonzero" fill="currentColor" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>86 </svg>87 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q">88 <input type="submit" value="Go">89 </form>90 </span>91 </nav>92 <div class="menu-wrapper">93 <nav class="menu" role="navigation" aria-label="main navigation">94 <div class="language_switcher_placeholder"></div>95 96<label class="theme-selector-label">97 Theme98 <select class="theme-selector" oninput="activateTheme(this.value)">99 <option value="auto" selected>Auto</option>100 <option value="light">Light</option>101 <option value="dark">Dark</option>102 </select>103</label>104 <div>105 <h4>Previous topic</h4>106 <p class="topless"><a href="test.html"107 title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">test</span></code> — Regression tests package for Python</a></p>108 </div>109 <div>110 <h4>Next topic</h4>111 <p class="topless"><a href="audit_events.html"112 title="next chapter">Audit events table</a></p>113 </div>114 <script>115 document.addEventListener('DOMContentLoaded', () => {116 const title = document.querySelector('meta[property="og:title"]').content;117 const elements = document.querySelectorAll('.improvepage');118 const pageurl = window.location.href.split('?')[0];119 elements.forEach(element => {120 const url = new URL(element.href.split('?')[0].replace("-nojs", ""));121 url.searchParams.set('pagetitle', title);122 url.searchParams.set('pageurl', pageurl);123 url.searchParams.set('pagesource', "library/debug.rst");124 element.href = url.toString();125 });126 });127 </script>128 <div role="note" aria-label="source link">129 <h3>This page</h3>130 <ul class="this-page-menu">131 <li><a href="../bugs.html">Report a bug</a></li>132 <li><a class="improvepage" href="../improve-page-nojs.html">Improve this page</a></li>133 <li>134 <a href="https://github.com/python/cpython/blob/main/Doc/library/debug.rst?plain=1"135 rel="nofollow">Show source136 </a>137 </li>138 139 </ul>140 </div>141 </nav>142 </div>143</div>144 145 146 <div class="related" role="navigation" aria-label="Related">147 <h3>Navigation</h3>148 <ul>149 <li class="right" style="margin-right: 10px">150 <a href="../genindex.html" title="General Index"151 accesskey="I">index</a></li>152 <li class="right" >153 <a href="../py-modindex.html" title="Python Module Index"154 >modules</a> |</li>155 <li class="right" >156 <a href="audit_events.html" title="Audit events table"157 accesskey="N">next</a> |</li>158 <li class="right" >159 <a href="test.html" title="test — Regression tests package for Python"160 accesskey="P">previous</a> |</li>161 162 <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"></li>163 <li><a href="https://www.python.org/">Python</a> »</li>164 <li class="switchers">165 <div class="language_switcher_placeholder"></div>166 <div class="version_switcher_placeholder"></div>167 </li>168 <li>169 170 </li>171 <li id="cpython-language-and-version">172 <a href="../index.html">3.15.0a6 Documentation</a> »173 </li>174 175 <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Python Standard Library</a> »</li>176 <li class="nav-item nav-item-this"><a href="">Debugging and profiling</a></li>177 <li class="right">178 179 180 <div class="inline-search" role="search">181 <form class="inline-search" action="../search.html" method="get">182 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box">183 <input type="submit" value="Go">184 </form>185 </div>186 |187 </li>188 <li class="right">189<label class="theme-selector-label">190 Theme191 <select class="theme-selector" oninput="activateTheme(this.value)">192 <option value="auto" selected>Auto</option>193 <option value="light">Light</option>194 <option value="dark">Dark</option>195 </select>196</label> |</li>197 198 </ul>199 </div> 200 201 <div class="document">202 <div class="documentwrapper">203 <div class="bodywrapper">204 <div class="body" role="main">205 206 <section id="debugging-and-profiling">207<h1>Debugging and profiling<a class="headerlink" href="#debugging-and-profiling" title="Link to this heading">¶</a></h1>208<p>These libraries help you with Python development: the debugger enables you to209step through code, analyze stack frames and set breakpoints etc., and the210profilers run code and give you a detailed breakdown of execution times,211allowing you to identify bottlenecks in your programs. Auditing events212provide visibility into runtime behaviors that would otherwise require213intrusive debugging or patching.</p>214<div class="toctree-wrapper compound">215<ul>216<li class="toctree-l1"><a class="reference internal" href="audit_events.html">Audit events table</a></li>217<li class="toctree-l1"><a class="reference internal" href="bdb.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bdb</span></code> — Debugger framework</a></li>218<li class="toctree-l1"><a class="reference internal" href="faulthandler.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">faulthandler</span></code> — Dump the Python traceback</a><ul>219<li class="toctree-l2"><a class="reference internal" href="faulthandler.html#dumping-the-traceback">Dumping the traceback</a></li>220<li class="toctree-l2"><a class="reference internal" href="faulthandler.html#dumping-the-c-stack">Dumping the C stack</a><ul>221<li class="toctree-l3"><a class="reference internal" href="faulthandler.html#c-stack-compatibility">C Stack Compatibility</a></li>222</ul>223</li>224<li class="toctree-l2"><a class="reference internal" href="faulthandler.html#fault-handler-state">Fault handler state</a></li>225<li class="toctree-l2"><a class="reference internal" href="faulthandler.html#dumping-the-tracebacks-after-a-timeout">Dumping the tracebacks after a timeout</a></li>226<li class="toctree-l2"><a class="reference internal" href="faulthandler.html#dumping-the-traceback-on-a-user-signal">Dumping the traceback on a user signal</a></li>227<li class="toctree-l2"><a class="reference internal" href="faulthandler.html#issue-with-file-descriptors">Issue with file descriptors</a></li>228<li class="toctree-l2"><a class="reference internal" href="faulthandler.html#example">Example</a></li>229</ul>230</li>231<li class="toctree-l1"><a class="reference internal" href="pdb.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pdb</span></code> — The Python Debugger</a><ul>232<li class="toctree-l2"><a class="reference internal" href="pdb.html#command-line-interface">Command-line interface</a></li>233<li class="toctree-l2"><a class="reference internal" href="pdb.html#debugger-commands">Debugger commands</a></li>234</ul>235</li>236<li class="toctree-l1"><a class="reference internal" href="profiling.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">profiling</span></code> — Python profilers</a><ul>237<li class="toctree-l2"><a class="reference internal" href="profiling.html#introduction-to-profiling">Introduction to profiling</a></li>238<li class="toctree-l2"><a class="reference internal" href="profiling.html#choosing-a-profiler">Choosing a profiler</a><ul>239<li class="toctree-l3"><a class="reference internal" href="profiling.html#when-to-use-statistical-sampling">When to use statistical sampling</a></li>240<li class="toctree-l3"><a class="reference internal" href="profiling.html#when-to-use-deterministic-tracing">When to use deterministic tracing</a></li>241</ul>242</li>243<li class="toctree-l2"><a class="reference internal" href="profiling.html#quick-start">Quick start</a><ul>244<li class="toctree-l3"><a class="reference internal" href="profiling.html#statistical-profiling">Statistical profiling</a></li>245<li class="toctree-l3"><a class="reference internal" href="profiling.html#deterministic-profiling">Deterministic profiling</a></li>246</ul>247</li>248<li class="toctree-l2"><a class="reference internal" href="profiling.html#understanding-profile-output">Understanding profile output</a></li>249<li class="toctree-l2"><a class="reference internal" href="profiling.html#legacy-compatibility">Legacy compatibility</a><ul>250<li class="toctree-l3"><a class="reference internal" href="profiling.tracing.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">profiling.tracing</span></code> — Deterministic profiler</a><ul>251<li class="toctree-l4"><a class="reference internal" href="profiling.tracing.html#what-is-deterministic-profiling">What is deterministic profiling?</a></li>252<li class="toctree-l4"><a class="reference internal" href="profiling.tracing.html#command-line-interface">Command-line interface</a></li>253<li class="toctree-l4"><a class="reference internal" href="profiling.tracing.html#programmatic-usage-examples">Programmatic usage examples</a><ul>254<li class="toctree-l5"><a class="reference internal" href="profiling.tracing.html#basic-profiling">Basic profiling</a></li>255<li class="toctree-l5"><a class="reference internal" href="profiling.tracing.html#using-the-profile-class">Using the <code class="xref py py-class docutils literal notranslate"><span class="pre">Profile</span></code> class</a></li>256</ul>257</li>258<li class="toctree-l4"><a class="reference internal" href="profiling.tracing.html#module-reference">Module reference</a></li>259<li class="toctree-l4"><a class="reference internal" href="profiling.tracing.html#using-a-custom-timer">Using a custom timer</a></li>260<li class="toctree-l4"><a class="reference internal" href="profiling.tracing.html#limitations">Limitations</a></li>261</ul>262</li>263<li class="toctree-l3"><a class="reference internal" href="profiling.sampling.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">profiling.sampling</span></code> — Statistical profiler</a><ul>264<li class="toctree-l4"><a class="reference internal" href="profiling.sampling.html#what-is-statistical-profiling">What is statistical profiling?</a><ul>265<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#how-time-is-estimated">How time is estimated</a></li>266<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#when-to-use-a-different-approach">When to use a different approach</a></li>267</ul>268</li>269<li class="toctree-l4"><a class="reference internal" href="profiling.sampling.html#quick-examples">Quick examples</a></li>270<li class="toctree-l4"><a class="reference internal" href="profiling.sampling.html#commands">Commands</a><ul>271<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#the-run-command">The <code class="docutils literal notranslate"><span class="pre">run</span></code> command</a></li>272<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#the-attach-command">The <code class="docutils literal notranslate"><span class="pre">attach</span></code> command</a></li>273<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#the-replay-command">The <code class="docutils literal notranslate"><span class="pre">replay</span></code> command</a></li>274<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#profiling-in-production">Profiling in production</a></li>275<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#platform-requirements">Platform requirements</a></li>276<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#version-compatibility">Version compatibility</a></li>277</ul>278</li>279<li class="toctree-l4"><a class="reference internal" href="profiling.sampling.html#sampling-configuration">Sampling configuration</a><ul>280<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#sampling-rate-and-duration">Sampling rate and duration</a></li>281<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#thread-selection">Thread selection</a></li>282<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#blocking-mode">Blocking mode</a></li>283<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#special-frames">Special frames</a></li>284<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#opcode-aware-profiling">Opcode-aware profiling</a></li>285<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#real-time-statistics">Real-time statistics</a></li>286<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#subprocess-profiling">Subprocess profiling</a></li>287<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#sampling-efficiency">Sampling efficiency</a></li>288</ul>289</li>290<li class="toctree-l4"><a class="reference internal" href="profiling.sampling.html#profiling-modes">Profiling modes</a><ul>291<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#wall-clock-mode">Wall-clock mode</a></li>292<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#cpu-mode">CPU mode</a></li>293<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#comparing-wall-clock-and-cpu-profiles">Comparing wall-clock and CPU profiles</a></li>294<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#gil-mode">GIL mode</a></li>295<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#exception-mode">Exception mode</a></li>296</ul>297</li>298<li class="toctree-l4"><a class="reference internal" href="profiling.sampling.html#output-formats">Output formats</a><ul>299<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#pstats-format">pstats format</a></li>300<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#collapsed-stacks-format">Collapsed stacks format</a></li>301<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#flame-graph-format">Flame graph format</a></li>302<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#gecko-format">Gecko format</a></li>303<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#heatmap-format">Heatmap format</a></li>304<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#binary-format">Binary format</a></li>305</ul>306</li>307<li class="toctree-l4"><a class="reference internal" href="profiling.sampling.html#record-and-replay-workflow">Record and replay workflow</a></li>308<li class="toctree-l4"><a class="reference internal" href="profiling.sampling.html#live-mode">Live mode</a><ul>309<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#keyboard-commands">Keyboard commands</a></li>310</ul>311</li>312<li class="toctree-l4"><a class="reference internal" href="profiling.sampling.html#async-aware-profiling">Async-aware profiling</a><ul>313<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#async-modes">Async modes</a></li>314<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#task-markers-and-stack-reconstruction">Task markers and stack reconstruction</a></li>315<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#option-restrictions">Option restrictions</a></li>316</ul>317</li>318<li class="toctree-l4"><a class="reference internal" href="profiling.sampling.html#command-line-interface">Command-line interface</a><ul>319<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#global-options">Global options</a></li>320<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#sampling-options">Sampling options</a></li>321<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#mode-options">Mode options</a></li>322<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#output-options">Output options</a></li>323<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#pstats-display-options">pstats display options</a></li>324<li class="toctree-l5"><a class="reference internal" href="profiling.sampling.html#run-command-options">Run command options</a></li>325</ul>326</li>327</ul>328</li>329</ul>330</li>331</ul>332</li>333<li class="toctree-l1"><a class="reference internal" href="pstats.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pstats</span></code> — Statistics for profilers</a><ul>334<li class="toctree-l2"><a class="reference internal" href="pstats.html#reading-and-displaying-profile-data">Reading and displaying profile data</a><ul>335<li class="toctree-l3"><a class="reference internal" href="pstats.html#working-with-statistics">Working with statistics</a></li>336<li class="toctree-l3"><a class="reference internal" href="pstats.html#filtering-output">Filtering output</a></li>337<li class="toctree-l3"><a class="reference internal" href="pstats.html#analyzing-call-relationships">Analyzing call relationships</a></li>338<li class="toctree-l3"><a class="reference internal" href="pstats.html#combining-multiple-profiles">Combining multiple profiles</a></li>339</ul>340</li>341<li class="toctree-l2"><a class="reference internal" href="pstats.html#the-stats-class">The <code class="xref py py-class docutils literal notranslate"><span class="pre">Stats</span></code> class</a></li>342<li class="toctree-l2"><a class="reference internal" href="pstats.html#command-line-interface">Command-line interface</a></li>343</ul>344</li>345<li class="toctree-l1"><a class="reference internal" href="timeit.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">timeit</span></code> — Measure execution time of small code snippets</a><ul>346<li class="toctree-l2"><a class="reference internal" href="timeit.html#basic-examples">Basic Examples</a></li>347<li class="toctree-l2"><a class="reference internal" href="timeit.html#python-interface">Python Interface</a></li>348<li class="toctree-l2"><a class="reference internal" href="timeit.html#command-line-interface">Command-Line Interface</a></li>349<li class="toctree-l2"><a class="reference internal" href="timeit.html#examples">Examples</a></li>350</ul>351</li>352<li class="toctree-l1"><a class="reference internal" href="trace.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">trace</span></code> — Trace or track Python statement execution</a><ul>353<li class="toctree-l2"><a class="reference internal" href="trace.html#command-line-usage">Command-Line Usage</a><ul>354<li class="toctree-l3"><a class="reference internal" href="trace.html#main-options">Main options</a></li>355<li class="toctree-l3"><a class="reference internal" href="trace.html#modifiers">Modifiers</a></li>356<li class="toctree-l3"><a class="reference internal" href="trace.html#filters">Filters</a></li>357</ul>358</li>359<li class="toctree-l2"><a class="reference internal" href="trace.html#programmatic-interface">Programmatic Interface</a></li>360</ul>361</li>362<li class="toctree-l1"><a class="reference internal" href="tracemalloc.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">tracemalloc</span></code> — Trace memory allocations</a><ul>363<li class="toctree-l2"><a class="reference internal" href="tracemalloc.html#examples">Examples</a><ul>364<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#display-the-top-10">Display the top 10</a></li>365<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#compute-differences">Compute differences</a></li>366<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#get-the-traceback-of-a-memory-block">Get the traceback of a memory block</a></li>367<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#pretty-top">Pretty top</a><ul>368<li class="toctree-l4"><a class="reference internal" href="tracemalloc.html#record-the-current-and-peak-size-of-all-traced-memory-blocks">Record the current and peak size of all traced memory blocks</a></li>369</ul>370</li>371</ul>372</li>373<li class="toctree-l2"><a class="reference internal" href="tracemalloc.html#api">API</a><ul>374<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#functions">Functions</a></li>375<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#domainfilter">DomainFilter</a></li>376<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#filter">Filter</a></li>377<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#frame">Frame</a></li>378<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#snapshot">Snapshot</a></li>379<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#statistic">Statistic</a></li>380<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#statisticdiff">StatisticDiff</a></li>381<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#trace">Trace</a></li>382<li class="toctree-l3"><a class="reference internal" href="tracemalloc.html#traceback">Traceback</a></li>383</ul>384</li>385</ul>386</li>387</ul>388</div>389</section>390 391 392 <div class="clearer"></div>393 </div>394 </div>395 </div>396 <div class="sphinxsidebar" role="navigation" aria-label="Main">397 <div class="sphinxsidebarwrapper">398 <div>399 <h4>Previous topic</h4>400 <p class="topless"><a href="test.html"401 title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">test</span></code> — Regression tests package for Python</a></p>402 </div>403 <div>404 <h4>Next topic</h4>405 <p class="topless"><a href="audit_events.html"406 title="next chapter">Audit events table</a></p>407 </div>408 <script>409 document.addEventListener('DOMContentLoaded', () => {410 const title = document.querySelector('meta[property="og:title"]').content;411 const elements = document.querySelectorAll('.improvepage');412 const pageurl = window.location.href.split('?')[0];413 elements.forEach(element => {414 const url = new URL(element.href.split('?')[0].replace("-nojs", ""));415 url.searchParams.set('pagetitle', title);416 url.searchParams.set('pageurl', pageurl);417 url.searchParams.set('pagesource', "library/debug.rst");418 element.href = url.toString();419 });420 });421 </script>422 <div role="note" aria-label="source link">423 <h3>This page</h3>424 <ul class="this-page-menu">425 <li><a href="../bugs.html">Report a bug</a></li>426 <li><a class="improvepage" href="../improve-page-nojs.html">Improve this page</a></li>427 <li>428 <a href="https://github.com/python/cpython/blob/main/Doc/library/debug.rst?plain=1"429 rel="nofollow">Show source430 </a>431 </li>432 433 </ul>434 </div>435 </div>436<div id="sidebarbutton" title="Collapse sidebar">437<span>«</span>438</div>439 440 </div>441 <div class="clearer"></div>442 </div> 443 <div class="related" role="navigation" aria-label="Related">444 <h3>Navigation</h3>445 <ul>446 <li class="right" style="margin-right: 10px">447 <a href="../genindex.html" title="General Index"448 >index</a></li>449 <li class="right" >450 <a href="../py-modindex.html" title="Python Module Index"451 >modules</a> |</li>452 <li class="right" >453 <a href="audit_events.html" title="Audit events table"454 >next</a> |</li>455 <li class="right" >456 <a href="test.html" title="test — Regression tests package for Python"457 >previous</a> |</li>458 459 <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"></li>460 <li><a href="https://www.python.org/">Python</a> »</li>461 <li class="switchers">462 <div class="language_switcher_placeholder"></div>463 <div class="version_switcher_placeholder"></div>464 </li>465 <li>466 467 </li>468 <li id="cpython-language-and-version">469 <a href="../index.html">3.15.0a6 Documentation</a> »470 </li>471 472 <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>473 <li class="nav-item nav-item-this"><a href="">Debugging and profiling</a></li>474 <li class="right">475 476 477 <div class="inline-search" role="search">478 <form class="inline-search" action="../search.html" method="get">479 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box">480 <input type="submit" value="Go">481 </form>482 </div>483 |484 </li>485 <li class="right">486<label class="theme-selector-label">487 Theme488 <select class="theme-selector" oninput="activateTheme(this.value)">489 <option value="auto" selected>Auto</option>490 <option value="light">Light</option>491 <option value="dark">Dark</option>492 </select>493</label> |</li>494 495 </ul>496 </div> 497 <div class="footer">498 © <a href="../copyright.html">Copyright</a> 2001 Python Software Foundation.499 <br>500 This page is licensed under the Python Software Foundation License Version 2.501 <br>502 Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.503 <br>504 505 See <a href="/license.html">History and License</a> for more information.<br>506 507 508 <br>509 510 The Python Software Foundation is a non-profit corporation.511<a href="https://www.python.org/psf/donations/">Please donate.</a>512<br>513 <br>514 Last updated on Mar 10, 2026 (08:58 UTC).515 516 <a href="/bugs.html">Found a bug</a>?517 518 <br>519 520 Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.2.3.521 </div>522 523 </body>524</html>