<p dir="auto">Current implementation of cputicks on ARM is very low precision which hurts block profile and tracer.</p>
<p dir="auto"><a href="http://gperftools.googlecode.com/svn/trunk/src/base/cycleclock.h" rel="nofollow">http://gperftools.googlecode.com/svn/trunk/src/base/cycleclock.h</a><br>
contains lots of goodness, and in particular cputicks implementation for arm:</p>
<div class="highlight highlight-source-c notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#elif defined(ARMV3)
#if defined(ARMV6)  // V6 is the earliest arch that has a standard cyclecount
    uint32 pmccntr;
    uint32 pmuseren;
    uint32 pmcntenset;
    // Read the user mode perf monitor counter access permissions.
    asm volatile (&quot;mrc p15, 0, %0, c9, c14, 0&quot; : &quot;=r&quot; (pmuseren));
    if (pmuseren &amp; 1) {  // Allows reading perfmon counters for user mode code.
      asm volatile (&quot;mrc p15, 0, %0, c9, c12, 1&quot; : &quot;=r&quot; (pmcntenset));
      if (pmcntenset &amp; 0x80000000ul) {  // Is it counting?
        asm volatile (&quot;mrc p15, 0, %0, c9, c13, 0&quot; : &quot;=r&quot; (pmccntr));
        // The counter is set up to count every 64th cycle
        return static_cast&lt;int64&gt;(pmccntr) * 64;  // Should optimize to &lt;&lt; 6
      }
    }
#endif"><pre class="notranslate"><span class="pl-k">#elif</span> defined(ARMV3)
<span class="pl-k">#if</span> defined(<span class="pl-c1">ARMV6</span>)  <span class="pl-c">// V6 is the earliest arch that has a standard cyclecount</span>
    <span class="pl-smi">uint32</span> <span class="pl-s1">pmccntr</span>;
    <span class="pl-smi">uint32</span> <span class="pl-s1">pmuseren</span>;
    <span class="pl-smi">uint32</span> <span class="pl-s1">pmcntenset</span>;
    <span class="pl-c">// Read the user mode perf monitor counter access permissions.</span>
    <span class="pl-smi">asm</span> <span class="pl-k">volatile</span> (<span class="pl-s">"mrc p15, 0, %0, c9, c14, 0"</span> : <span class="pl-s">"=r"</span> (<span class="pl-s1">pmuseren</span>));
    <span class="pl-k">if</span> (<span class="pl-s1">pmuseren</span> <span class="pl-c1">&amp;</span> <span class="pl-c1">1</span>) {  <span class="pl-c">// Allows reading perfmon counters for user mode code.</span>
      <span class="pl-smi">asm</span> <span class="pl-k">volatile</span> (<span class="pl-s">"mrc p15, 0, %0, c9, c12, 1"</span> : <span class="pl-s">"=r"</span> (<span class="pl-s1">pmcntenset</span>));
      <span class="pl-k">if</span> (<span class="pl-s1">pmcntenset</span> <span class="pl-c1">&amp;</span> <span class="pl-c1">0x80000000ul</span>) {  <span class="pl-c">// Is it counting?</span>
        <span class="pl-smi">asm</span> <span class="pl-k">volatile</span> (<span class="pl-s">"mrc p15, 0, %0, c9, c13, 0"</span> : <span class="pl-s">"=r"</span> (<span class="pl-s1">pmccntr</span>));
        <span class="pl-c">// The counter is set up to count every 64th cycle</span>
        <span class="pl-k">return</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-s1">int64</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pmccntr</span>) <span class="pl-c1">*</span> <span class="pl-c1">64</span>;  <span class="pl-c">// Should optimize to &lt;&lt; 6</span>
      }
    }
<span class="pl-k">#endif</span></pre></div>
<p dir="auto">Should consider switching to it.</p>
<p dir="auto">There is also an impl for power processors.</p>
<p dir="auto">Please answer these questions before submitting your issue. Thanks!</p>
<ol dir="auto">
<li>What version of Go are you using (<code class="notranslate">go version</code>)?<br>
go version devel +c63dbd8 Thu Mar 10 18:35:10 2016 +0000 linux/ppc64le<br>
Doesn't work on any earlier versions either.</li>
<li>What operating system and processor architecture are you using (<code class="notranslate">go env</code>)?<br>
ppc64le</li>
<li>What did you do?<br>
If possible, provide a recipe for reproducing the error.<br>
A complete runnable program is good.<br>
A link on play.golang.org is best.<br>
go tool objdump a.out</li>
<li>What did you expect to see?<br>
A disassembly of the program.</li>
<li>What did you see instead?<br>
objdump: disassemble a.out: unsupported architecture</li>
</ol>
<p dir="auto">I've seen a CL for this from Minux a while ago but haven't seen any recent updates.<br>
If this was started but needs finishing I could help with that.</p>