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
>
>          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/720fbe94-a27b-457c-8be8-30b28b5fbd2fn%40googlegroups.com.

Reply via email to