vmprof / vmprof-python

vmprof - a statistical program profiler
http://vmprof.com
Other
433 stars 54 forks source link

Vmprof: "Undefined" in flamegraph, and "No stack trace has been recorded (profile is empty)!" #220

Open shhovhan opened 4 years ago

shhovhan commented 4 years ago

Hello all, Its seems that last changes and udpates on vmprof were in 2019, but I hope someone will help me to setup vmprof for my project. Here are the problems: I have installed vmprof client and server and when I run vmprof

  1. by API like this:
             with open('logs/vmprof.log', 'w+b') as fd:
                vmprof.enable(fd.fileno())
                ..... some code here.....
                ..... some code here.....
                ..... some code here.....
                vmprof.disable()

    it creates vmprof.log file as expected. then I upload it to my local server and as a result I see lot of "undefined" in flamegraph. undefined

QUESTION: What to do with this undefineds. How to solve this problem?

  1. I want to enable and disable profiling by a signal. For that I use SIGUSR signal custom handler: here is the code:
    gevent.signal(signal.SIGUSR1, self.sigusr1_handler)
    def sigusr1_handler(self):
        if not vmprof.is_enabled():
            with open('logs/vmprof.log', 'w+b') as fd:
                vmprof.enable(fd.fileno())
        else:
            vmprof.disable()

    it creates vmprof log, but when I try to open on server there were nothing, infinite loading and preloader. I have tried to see if it works with vmprofshow but I got this message:

WARNING: The profiling completed in less than 1 seconds. Please run your programs longer! No stack trace has been recorded (profile is empty)!

QUESTION: How to solve this problem? Is it possible to enable or disable vmprof by signal?

shhovhan commented 4 years ago

UPDATES: In 2nd case vmprof.log is not empty. Logging information written in file. I can find there all known function names that you can see in flamegraph above. I use Python 2.7, pypy 6.0, vmprof 0.4.15, 0.4.13, 0.4.12