<html>
    <head>
      <base href="http://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Test failing because cycleFrequency unable to determine CPU frequency for TSC accounting"
   href="http://bugs.llvm.org/show_bug.cgi?id=32620">32620</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Test failing because cycleFrequency unable to determine CPU frequency for TSC accounting
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>XRay
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Runtime
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dberris@google.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>douglas_yung@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>On my machine, an x86_64 Linux VM that does not expose support for rdtscp, the
timestamp emulation is unable to determine the CPU frequency causing the test "
XRay-x86_64-linux :: TestCases/Linux/fdr-mode.cc" to fail.

When trying to run the xray instrumented binary, here is the output generated:

Command: XRAY_OPTIONS="patch_premain=false xray_naive_log=false
xray_logfile_base=fdr-logging-test- xray_fdr_log=true verbosity=1
xray_fdr_log_func_duration_threshold_us=0" 
/home/dyung/src/git/merge/build/projects/compiler-rt/test/xray/X86_64LinuxConfig/TestCases/Linux/Output/fdr-mode.cc.tmp

Output:
==32513==Missing rdtscp support.
==32513==WARNING: Required CPU features missing for XRay instrumentation, using
emulation instead.
Logging before init.
==32513==XRay FDR init successful.
Init status 2
Patching...
==32513==Missing rdtscp support.
==32513==Unable to determine CPU frequency for TSC accounting.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Unable to determine CPU frequency for TSC accounting.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
Joined
Finalize status 4
==32513==Missing rdtscp support.
==32513==Missing rdtscp support.
Main execution var = 6
==32513==XRay: Log file in 'fdr-logging-test-fdr-mode.cc.tmp.njhGht'
==32513==Unable to determine CPU frequency for TSC accounting.
Flush status 2


Then when the resulting file is run through llvm-xray:

Command: /home/dyung/src/git/merge/build/./bin/llvm-xray convert --symbolize
--output-format=yaml
-instr_map=/home/dyung/src/git/merge/build/projects/compiler-rt/test/xray/X86_64LinuxConfig/TestCases/Linux/Output/fdr-mode.cc.tmp
"`ls fdr-unwrite-test-* | head -1`"

Output:
header:
  version:         1
  type:            1
  constant-tsc:    true
  nonstop-tsc:     true
  cycle-frequency: 0
records:
  - { type: 0, func-id: 3, function: 'fA()', cpu: 0, thread: 32513, kind:
function-enter, tsc: 1491898914518840766 }
...

On my Linux VM, here is the output of /proc/cpuinfo:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 60
model name      : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
stepping        : 3
microcode       : 0xffffffff
cpu MHz         : 3201.432
cache size      : 8192 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 8
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good
nopl eagerfpu pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave
avx f16c rdrand hypervisor lahf_lm abm fsgsbase bmi1 avx2 smep bmi2 erms
xsaveopt
bugs            :
bogomips        : 6402.86
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:


Additionally, neither of the files that cycleFrequency() is looking for to find
the CPU frequency are present on my system.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>