[PATCH] D85254: [llvm-exegesis] Add option to check the hardware support for a given feature before benchmarking.

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 20:26:36 PDT 2020


hliao added a comment.

This change is reverted as, on hosts without LBR supported but with LIBPFM installed and used, this change makes `llvm/test/tools/llvm-exegesis/X86/lbr/mov-add.s` failed. On that host, `perf_event_open` fails with `EOPNOTSUPP` on LBR config. That change's basic assumption

> If this is run on a non-supported hardware, it will produce all zeroes for latency.

      

could not stand as `perf_event_open` system call will fail if the underlying hardware really doesn't have LBR supported.

Here's the output from

  llvm-lit -v llvm/test/tools/llvm-exegesis/X86/lbr/mov-add.s
  -- Testing: 1 tests, 1 workers --
  FAIL: LLVM :: tools/llvm-exegesis/X86/lbr/mov-add.s (1 of 1)
  ******************** TEST 'LLVM :: tools/llvm-exegesis/X86/lbr/mov-add.s' FAILED ********************
  Script:
  --
  : 'RUN: at line 1';   llvm-exegesis -mode=latency --repetition-mode=loop --x86-lbr-sample-period=521 --snippets-file=llvm/test/tools/llvm-exegesis/X86/lbr/Inputs/mov_add.att
  --
  Exit Code: 134
  
  Command Output (stderr):
  --
  Unable to open event. ERRNO: Operation not supported. Make sure your kernel allows user space perf monitoring.
  You may want to try:
  $ sudo sh -c 'echo -1 > /proc/sys/kernel/perf_event_paranoid'
  llvm-exegesis: llvm/tools/llvm-exegesis/lib/PerfHelper.cpp:111: llvm::exegesis::pfm::Counter::Counter(llvm::exegesis::pfm::PerfEvent&&): Assertion `FileDescriptor != -1 && "Unable to open event"' failed.
  test/tools/llvm-exegesis/X86/lbr/Output/mov-add.s.script: line 1: 34962 Aborted                 llvm-exegesis -mode=latency --repetition-mode=loop --x86-lbr-sample-period=521 --snippets-file=llvm/test/tools/llvm-exegesis/X86/lbr/Inputs/mov_add.att
  
  --
  
  ********************
  ********************
  Failed Tests (1):
    LLVM :: tools/llvm-exegesis/X86/lbr/mov-add.s
  
  
  Testing Time: 0.11s
    Failed: 1

Please note `perf_event_open` returns `ERRNO: Operation not supported.`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85254/new/

https://reviews.llvm.org/D85254



More information about the llvm-commits mailing list