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

goroutine 堆栈回溯咨询 #4

Open
zdyj3170101136 opened this issue Jun 25, 2024 · 0 comments
Open

goroutine 堆栈回溯咨询 #4

zdyj3170101136 opened this issue Jun 25, 2024 · 0 comments

Comments

@zdyj3170101136
Copy link

目前我在尝试通过 fp backtrace 的方式回溯每个 goroutine 的调用栈,遇到一些问题。

在 time.sleep,g.sched.pc 可以表示 goroutine 当前的执行函数。

但是如果 goroutine 执行的是一个 for 循环的函数,g.sched.pc 就是 runtime.systemstack_switch。

如何才能获取到该 goroutine 正在执行的函数呢?

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

No branches or pull requests

1 participant