How can I dump all a Go process's stacks? -


A go process is in progress

  • By adding anything to its source code without adding < / Li>
  • Dump a stack trace for every goritanine from the outside
  • without killing it.
  • How can I do this?

    It should be easy - the facility was requested: and, according to the findings of that formula, it was implemented. It was two years ago. But neither the issue thread nor any sign of how to implement this feature.

    The feature request mentions that SIGQUIT invokes this feature on JVM, but it is not; At least 1/2, SIGQUIT # 1 and # 2 does, but it also kills the process.

    Someone asked a related question one time ago: But he did not explicitly ask for # 2 or # 3, no one in the answer does not meet # 2, and he accepted the answer Which does not meet # 2, then this is a different question.

    If you are using pure / http, then you can login through goroutines debug Handler If you see the following source

    You will see the profile, goroutineProfile , on line 62. The profile writing groutin If gorotin is written with debug> = 2 then it will write all the goratians.

    To dump all code to you curl http: // localhost: . Unfortunately, I did not find any reference to the signal handlers, which would be called code but you can see the references about how PPProf has the runtime Stack is used in the above source so that it can be easily applied.


    Comments

    Popular posts from this blog

    import - Python ImportError: No module named wmi -

    Editing Python Class in Shell and SQLAlchemy -

    c# - MySQL Parameterized Select Query joining tables issue -