andikleen / pmu-tools

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

toplev failing to parse CPUs from sysfs #461

Closed samkhn closed 1 year ago

samkhn commented 1 year ago

toplev, regardless of parameters passed (including no parameters), throws an error with the following stack trace:

Traceback (most recent call last):
  File "toplev.py", line 3722, in <module>
    runner_list = init_runner_list()
                  ^^^^^^^^^^^^^^^^^^
  File "toplev.py", line 3699, in init_runner_list
    cpu_list = get_cpu_list(j)
               ^^^^^^^^^^^^^^^
  File "toplev.py", line 3671, in get_cpu_list
    return [k for k in read_cpus(fn) if use_cpu(k)]
                       ^^^^^^^^^^^^^
  File "toplev.py", line 3660, in read_cpus
    return parse_cpu_list(cpus.readline())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "toplev.py", line 3651, in parse_cpu_list
    if m.group(2):
       ^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'

Some notes:

Commit d0cbe52 added this section.

Related bug: https://github.com/andikleen/pmu-tools/issues/451

andikleen commented 1 year ago

So what does

grep . /sys/devices/cpu*/cpus

output?

andikleen commented 1 year ago

I pushed ab497ac5d43f256bd67f21bcde5f2901226cac64 to avoid the error, but does toplev actually work after that?

samkhn commented 1 year ago

So what does

grep . /sys/devices/cpu*/cpus

output?

Outputs:

/sys/devices/cpu_core/cpus:0-11
andikleen commented 1 year ago

Thanks and does it work with latest master?

andikleen commented 1 year ago

Should be fixed. Please re-open if it does not work.