nvdv / vprof

Visual profiler for Python
BSD 2-Clause "Simplified" License
3.95k stars 154 forks source link

Flame graph gives error in WSL. #87

Open mchels opened 5 years ago

mchels commented 5 years ago
Description

Flame graph gives error in WSL.

How to reproduce

For file foo.py containing

bar = 123

run

vprof -c c foo.py
Actual results

Error

$ vprof -c c foo.py
Running FlameGraphProfiler...
Traceback (most recent call last):
  File "/home/mchels/anaconda3/bin/vprof", line 11, in <module>
    sys.exit(main())
  File "/home/mchels/anaconda3/lib/python3.6/site-packages/vprof/__main__.py", line 87, in main
    program_stats = runner.run_profilers(source, config, verbose=True)
  File "/home/mchels/anaconda3/lib/python3.6/site-packages/vprof/runner.py", line 78, in run_profilers
    run_stats[option] = curr_profiler.run()
  File "/home/mchels/anaconda3/lib/python3.6/site-packages/vprof/base_profiler.py", line 172, in run
    return self.profile()
  File "/home/mchels/anaconda3/lib/python3.6/site-packages/vprof/flame_graph.py", line 167, in profile_module
    return base_profiler.run_in_separate_process(self._profile_module)
  File "/home/mchels/anaconda3/lib/python3.6/site-packages/vprof/base_profiler.py", line 79, in run_in_separate_process
    raise exc
signal.ItimerError: [Errno 22] Invalid argument
Expected results

No error.

Version and platform

Gives error: Python version: Python 3.6.5 :: Anaconda, Inc. vprof version: 0.37.6 OS: Ubuntu 16.04 in WSL (Windows Subsystem for Linux)

Does not give error: Python version: Python 3.6.6 :: Anaconda, Inc. vprof version: 0.37.6 OS: Ubuntu 18.04 native (that is, not WSL)

The code heatmap is more important than the flame graph for me, but it might be interesting to know that this error exists anyway.

Thank you for building this awesome piece of software :)