[pypy-dev] why doesn't this code dump jit debug info ?

Shubha Ramani shubharamani at yahoo.com
Thu Dec 8 18:21:40 EST 2016


Yes I finally figured it out (what you are saying David).  I did get a binary jit log dump intoa file finally. How do you parse it ? 

    On Thursday, December 8, 2016 2:12 PM, David Malcolm <dmalcolm at redhat.com> wrote:
 

 On Thu, 2016-12-08 at 21:49 +0000, Shubha Ramani via pypy-dev wrote:
> import py                                                            
>                                
> import binary_trees                                                  
>                                
> import os                                                            
>                                
> from rpython.rlib.rjitlog import rjitlog                            
>                                  
>                                                                      
>                                
> def test_binary_trees():                                            
>                                  
>    file = ('./jit.log')                                            
>                                  
>    fileno = os.open(file, os.O_WRONLY | os.O_CREAT)                
>                                  
>    enable_jitlog = lambda: rjitlog.enable_jitlog(fileno)            
>                                
>    os.system("./binary_trees.py 100 100")                          
>                                  
>                                                                      
>                                
>                    



> running it as  /opt/pypy/pytest.py test_shubha.py
> 
> The log gets created but it is empty 

Firstly, are you actually calling test_binary_trees?  If not, you're
just importing some modules, and defining a function, then exiting.

Secondly: os.system will run the binary_trees.py in a separate process,
invoking it via whatever is in the shebang line.  That won't inherit
any of the jitlog settings you've done in this process (and if it's
#!/usr/bin/python, it could be CPython you're invoking).


Hope this is helpful
Dave


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20161208/91559d90/attachment-0001.html>


More information about the pypy-dev mailing list