andikleen / pmu-tools

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

Event download fails due to wrong tuple unpacking. #408

Closed dhschall closed 2 years ago

dhschall commented 2 years ago

When starting toplev the first time and the event lists are downloaded the parsing fails in line 146 due to wrong tuple unwrapping

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
leonardvaney commented 2 years ago

This fix still produces an error:

Traceback (most recent call last):
  File "/usr/local/pmu-tools/toplev", line 57, in <module>
    import ocperf
  File "/usr/local/pmu-tools/ocperf.py", line 70, in <module>
    import event_download
  File "/usr/local/pmu-tools/event_download.py", line 146
    cpu, version, name, typ, *_ = n
                             ^
SyntaxError: invalid syntax

However, if I also change the first line of the file pmu-tools/toplev with "python3" instead of "python" it does fix the problem.

ustiugov commented 2 years ago

@leonardvaney which python version do you use? @dhschall and you?

dhschall commented 2 years ago

I use python3 (3.8) Sorry for the late reply @leonardvaney. I was almost supposing that we might use different versions but I did not get the chance to check if with 2.7 it will not work. Thanks for working this out.

leonardvaney commented 2 years ago

I used the the vhive-ubuntu20 profile with cloudlab nodes. This afternoon I tried to launch a new experiment to check the python version of the nodes but the command "python" is no longer recognized. I guess between now and yesterday someone modified the cloudlab profile?

ustiugov commented 2 years ago

@leonardvaney very unlikely

andikleen commented 2 years ago

Thanks for the fix. I fixed it differently because *_ is not compatible with python 2