andikleen / pmu-tools

Intel PMU profiling tools
GNU General Public License v2.0
1.98k stars 331 forks source link

event_download: Allow specifying path to perfmon dir #439

Closed StephanDollberg closed 1 year ago

StephanDollberg commented 1 year ago

With the event defintions now hosted on Github it is now fairly simple to download all CPU definitions in one go.

This patch allows overriding the download prefix url via an env var allowing an easier offline workflow:

Some offline version of this, e.g.: download the zips from github

/tmp/offline$ git clone https://github.com/intel/perfmon
/tmp/offline$ git clone https://github.com/andikleen/pmu-tools

followed by

/tmp/offline$ PERFMONDIR=file:///tmp/offline/perfmon ./pmu-tools/event_download.py
Downloading file:///tmp/offline/perfmon/mapfile.csv to mapfile.csv
Downloading file:///tmp/offline/perfmon/ADL/events/alderlake_gracemont_core.json to GenuineIntel-6-97-hybridcore.json
Downloading file:///tmp/offline/perfmon/ADL/events/alderlake_goldencove_core.json to GenuineIntel-6-97-hybridcore.json
Downloading file:///tmp/offline/perfmon/ADL/events/alderlake_uncore.json to GenuineIntel-6-97-uncore.json
Downloading file:///tmp/offline/perfmon/ADL/events/alderlake_uncore_experimental.json to GenuineIntel-6-97-uncoreexperimental.json
Downloading file:///tmp/offline/perfmon/README.md to README.md
Downloading file:///tmp/offline/perfmon/LICENSE to LICENSE

This avoids two issues related to using toplev offline:

andikleen commented 1 year ago

I believe what you want to do can be already done with event_download -a. I guess should update the wiki to mention that.

I'm ok with having a env variable override, provided it is documented like all the other environment variables for ocperf.

StephanDollberg commented 1 year ago

I believe what you want to do can be already done with event_download -a. I guess should update the wiki to mention that.

Right, that creates the symlinks at least for everything but you still need a machine you can run python on?

I'm ok with having a env variable override, provided it is documented like all the other environment variables for ocperf.

Surely happy to update accordingly.

I assume you mean at the top of event_download.py? Any other spots where I should add something?

I think there is also https://github.com/andikleen/pmu-tools/wiki/Running-ocperf-toplev-when-not-on-the-internet but not sure I have perms for that.

andikleen commented 1 year ago

Thanks!