Skip to content

Running ocperf toplev when not on the internet

bangfengXia edited this page Jan 11, 2024 · 6 revisions

Running ocperf/toplev when not on the internet

ocperf, and in extension toplev and other tools relying on it, do not contain own CPU event lists but download them on demand from 01.org. This is normally fine, and gives you more uptodate lists, but can be a problem when the test system is not connected to the internet.

  • Usually it's enough to download once.

  • In many corporate environment it is enough to set up the internet proxy correctly:

      export https_proxy=https://proxyname...
    
  • You can also download all available event lists with event_download.py -a and then again copy ~/.cache/pmu-events to the target system. If disk space is a concern it is sufficient to only copy the files for the target system's model number.

  • An alternative is to clone the event files from github:

    git clone https://github.com/intel/perfmon
    

and set the PERFMONDIR file to the cloned directory

  export PERFMONDIR=file:///path/to/perfmon

All downloads will be resolved locally from that directory. For example could run event_download -a to download the cache directory of event files, or run toplev this way.

  • When you run the tool as a different user you can copy ~/.cache/pmu-events to the home directory of the new user. For example to run with sudo you would need to copy it to root's home directory (normally /root).

  • Alternatively it is also possible to point the event maps manually to the right files.

      export EVENTMAP=/path/to/GenuineIntel...-core.json 
      export OFFCORE=... 
      export UNCORE=...
    

The last two settings are optional. Alternatively the names can be set to a CPU identifier (GenuineIntel-FAM-MODEL), this overrides the current CPU.

Another way is to explicitly set up the cache directory. The events are stored in a pmu-events directory relative to it.

    export XDG_CACHE_HOME=~/.cache