Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGPROF does not work on Windows #62

Closed
adrientetar opened this issue Nov 21, 2016 · 6 comments
Closed

SIGPROF does not work on Windows #62

adrientetar opened this issue Nov 21, 2016 · 6 comments

Comments

@adrientetar
Copy link

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32
PS C:\Users\Admin\Downloads\trufont> vprof -c c Lib/trufont
Running FlameGraphProfiler...
Traceback (most recent call last):
  File "C:\Python35\Scripts\vprof-script.py", line 9, in <module>
    load_entry_point('vprof==0.34', 'console_scripts', 'vprof')()
  File "c:\python35\lib\site-packages\vprof\__main__.py", line 88, in main
    source, config, verbose=True)
  File "c:\python35\lib\site-packages\vprof\runner.py", line 78, in run_profilers
    run_stats[option] = curr_profiler.run()
  File "c:\python35\lib\site-packages\vprof\flame_graph.py", line 169, in run
    prof = run_dispatcher()
  File "c:\python35\lib\site-packages\vprof\flame_graph.py", line 142, in run_as_package
    with _StatProfiler() as prof:
  File "c:\python35\lib\site-packages\vprof\flame_graph.py", line 29, in __enter__
    signal.signal(signal.SIGPROF, self.sample)
AttributeError: module 'signal' has no attribute 'SIGPROF'
@adrientetar
Copy link
Author

Apparently SIGPROF isn't present on Windows:

On Windows, signal() can only be called with SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, or SIGTERM. A ValueError will be raised in any other case. Note that not all systems define the same set of signal names; an AttributeError will be raised if a signal name is not defined as SIG* module level constant.

https://docs.python.org/3/library/signal.html

@adrientetar adrientetar changed the title AttributeError: module 'signal' has no attribute 'SIGPROF' SIGPROF does not work on Windows Nov 21, 2016
@nvdv
Copy link
Owner

nvdv commented Nov 21, 2016

Thanks for reporting!
I am aware that some of the signals do not exist in Windows, but current implementation of flame graph profiling should work under Windows Subsystem for Linux.
I haven't done any extensive testing on Windows though.

@Zireael07
Copy link

Why close? Do the flame graphs work on Windows now?

@nvdv
Copy link
Owner

nvdv commented Oct 27, 2017

Flame graphs don't work on Windows, because signal module is partially supported on Windows and I can't do much about that.

@RDCH106
Copy link
Contributor

RDCH106 commented Feb 7, 2019

@nvdv A note warning about this problem could be good.

imagen

@rrousselot
Copy link

Why not just ignore the c config, throw a warning and go on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants