//导入包 import ( "net/http" _ "net/http/pprof" ) //增加如下代码 go func() { fmt.Println(http.ListenAndServe(":5567",nil)) }()@H_404_0@2)执行curl 127.0.0.1:5567/debug/pprof/trace?seconds=10 > trace.data,获取到trace.data数据 @H_404_0@3) 执行 go tool trace -http=':8888' your_app_bin trace.data。会跳转到浏览器查看trace到数据.