se the combination of "-source_path" and "-trim_path" still not work
my project dir tree macbookpro:tejia_analysis fredlee$ pwd /Users/fredlee/Documents/xxx/tool/tejia_analysis macbookpro:tejia_analysis fredlee$ tree util util ├── analysis.go ├── configure.go ├── cron.go ├── job_discount.go ├── kv_bolt.go ├── mongo_client.go ├── mongo_globalairport.go ├── mysql_aircompany.go ├── mysql_client.go ├── mysql_convertcode.go ├── mysql_icmmgt_top_route.go └── redis_client.go 0 directories, 12 files go mod name macbookpro:tejia_analysis fredlee$ cat go.mod module app_server go 1.14 在 2020年7月31日星期五 UTC+8下午8:00:02,Vladimir Varankin写道: > > Hey, > > In your example, "~/Documents/tool/tejia_analysis" is your module's source > root, right? Could you show where "app_server/util/analysis.go" is on the > FS and what is the name of the module? > > pprof has a coupe flags to manipulate with the path, helping it to search > for the source code. I used to use the combination of "-source_path" and > "-trim_path" to map my local source code to the paths that were embedded > into the app's binary. > > On Thursday, July 30, 2020 at 8:09:29 AM UTC+2 blade...@gmail.com wrote: > >> hi, i create a project, directory name and module name not same, and i >> profile it , use list command to print code and profile, it tips me not >> find the file, how to make it works? >> >> >> macbookpro:tejia_analysis fredlee$ go tool pprof >> http://ip:6065/debug/pprof/heap >> >> Fetching profile over HTTP from http://ip:6065/debug/pprof/heap >> >> Saved profile in >> /Users/fredlee/pprof/pprof.tejia_analysis.alloc_objects.alloc_space.inuse_objects.inuse_space.006.pb.gz >> >> File: tejia_analysis >> >> Type: inuse_space >> >> Time: Jul 30, 2020 at 2:03pm (CST) >> >> Entering interactive mode (type "help" for commands, "o" for options) >> >> (pprof) top20 -cum >> >> Showing nodes accounting for 2509.12MB, 98.97% of 2535.11MB total >> >> Dropped 37 nodes (cum <= 12.68MB) >> >> flat flat% sum% cum cum% >> >> 0 0% 0% 2533.11MB 99.92% >> app_server/util.(*Analysis).Job >> >> 0 0% 0% 2533.11MB 99.92% >> app_server/util.(*Analysis).Start >> >> 1007.72MB 39.75% 39.75% 2523.10MB 99.53% >> app_server/util.(*Analysis).LoadSearchLog >> >> 0 0% 39.75% 1466.37MB 57.84% >> go.mongodb.org/mongo-driver/bson.(*Decoder).Decode >> >> 0 0% 39.75% 1466.37MB 57.84% >> go.mongodb.org/mongo-driver/bson.UnmarshalWithRegistry >> >> 0 0% 39.75% 1466.37MB 57.84% >> go.mongodb.org/mongo-driver/bson.unmarshalFromReader >> >> 0 0% 39.75% 1466.37MB 57.84% >> go.mongodb.org/mongo-driver/bson/bsoncodec.(*StructCodec).DecodeValue >> >> 0 0% 39.75% 1466.37MB 57.84% >> go.mongodb.org/mongo-driver/mongo.(*Cursor).Decode (inline) >> >> 0 0% 39.75% 1457.37MB 57.49% >> go.mongodb.org/mongo-driver/bson/bsoncodec.(*StringCodec).DecodeValue >> >> 0 0% 39.75% 1457.37MB 57.49% >> go.mongodb.org/mongo-driver/bson/bsonrw.(*valueReader).ReadString >> >> 1457.37MB 57.49% 97.24% 1457.37MB 57.49% >> go.mongodb.org/mongo-driver/bson/bsonrw.(*valueReader).readString >> <http://www.google.com/url?q=http%3A%2F%2Fgo.mongodb.org%2Fmongo-driver%2Fbson%2Fbsonrw.(*valueReader).readString&sa=D&sntz=1&usg=AFQjCNEFgoyDS3su0TjEWaW75tpb9XCCMw> >> >> 0 0% 97.24% 44.03MB 1.74% net/url.ParseQuery (inline) >> >> 44.03MB 1.74% 98.97% 44.03MB 1.74% net/url.parseQuery >> >> (pprof) list LoadSearchLog >> >> Total: 2.48GB >> >> ROUTINE ======================== >> app_server/util.(*Analysis).LoadSearchLog in app_server/util/analysis.go >> >> 1007.72MB 2.46GB (flat, cum) 99.53% of Total >> >> Error: could not find file app_server/util/analysis.go on path >> /Users/fredlee/Documents/tool/tejia_analysis >> >> >> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/91c42518-f47c-471b-b32c-767a0a0e3225o%40googlegroups.com.