vhive-serverless / vHive

vHive: Open-source framework for serverless experimentation
MIT License
281 stars 86 forks source link

Profiler instructions from the doc produce an error when installing pmutools #440

Closed michaelpaper closed 2 years ago

michaelpaper commented 2 years ago

I am trying to use VHive's profiler. I followed each step of the quick start guide (cloning version 1.4.1) on a CloudLab cluster with the "vHive-cluster-env" profile with 2 nodes. Then I followed the steps described in docs/profiling.md, but when running scripts/install_pmutools.sh, I get the following error:

Traceback (most recent call last):
  File "/usr/local/pmu-tools/toplev", line 3781, in <module>
    version = runner_emaps()
  File "/usr/local/pmu-tools/toplev", line 3771, in runner_emaps
    runner.ectx.emap = ocperf.find_emap(pmu=runner.pmu if runner.pmu else "cpu")
  File "/usr/local/pmu-tools/ocperf.py", line 979, in find_emap
    return json_with_extra(el, eventmap_is_file, pmu)
  File "/usr/local/pmu-tools/ocperf.py", line 877, in json_with_extra
    name = event_download.eventlist_name(el, pmu_to_type[pmu])
  File "/usr/local/pmu-tools/event_download.py", line 232, in eventlist_name
    files = parse_map_file(name, key, acceptfile=True)
  File "/usr/local/pmu-tools/event_download.py", line 146, in parse_map_file
    cpu, version, name, typ = n
ValueError: too many values to unpack

Do you know why this happens and how to fix it ?

Thanks in advance !

ustiugov commented 2 years ago

thanks for reporting this issue. @amohoste also noticed the same error few days ago

@dhschall as you are an active user of PMU tools, could you please take a look at why it fails in our script?

dhschall commented 2 years ago

Hey, @michaelpaper yes I also encountered this problem and it seems to come from a bug in the upstream repo. I fixed it by adding a , *_ in the tuple unpacking of line 146

index b3afd96..3f06549 100755
--- a/event_download.py
+++ b/event_download.py
@@ -143,7 +143,7 @@ def parse_map_file(match, key=None, link=True, onlyprint=False, acceptfile=False
                 if len(n) > 0:
                     print("Cannot parse", n)
                 continue
-            cpu, version, name, typ = n
+            cpu, version, name, typ, *_ = n
             if not (fnmatch(cpu, match) or fnmatch(cpu, match2) or
                     fnmatch(match2, cpu) or fnmatch(match, cpu)):
                 continue
ustiugov commented 2 years ago

@dhschall could you please submit a bug fix to upstream?

dhschall commented 2 years ago

Created issue and pull request in upstream repo.

dhschall commented 2 years ago

I pushed now my changes also to our own fork

ustiugov commented 2 years ago

@dhschall please open a PR in this repo as well, changing the branch and the repo to the ones in our fork.

ustiugov commented 2 years ago

fixed by #445