{"action":"created","issue":{"url":"https://api.github.com/repos/google/pprof/issues/415","repository_url":"https://api.github.com/repos/google/pprof","labels_url":"https://api.github.com/repos/google/pprof/issues/415/labels{/name}","comments_url":"https://api.github.com/repos/google/pprof/issues/415/comments","events_url":"https://api.github.com/repos/google/pprof/issues/415/events","html_url":"https://github.com/google/pprof/issues/415","id":356842401,"node_id":"MDU6SXNzdWUzNTY4NDI0MDE=","number":415,"title":"Discrepency between pprof list and weblist","user":{"login":"ardan-bkennedy","id":2280005,"node_id":"MDQ6VXNlcjIyODAwMDU=","avatar_url":"https://avatars3.githubusercontent.com/u/2280005?v=4","gravatar_id":"","url":"https://api.github.com/users/ardan-bkennedy","html_url":"https://github.com/ardan-bkennedy","followers_url":"https://api.github.com/users/ardan-bkennedy/followers","following_url":"https://api.github.com/users/ardan-bkennedy/following{/other_user}","gists_url":"https://api.github.com/users/ardan-bkennedy/gists{/gist_id}","starred_url":"https://api.github.com/users/ardan-bkennedy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardan-bkennedy/subscriptions","organizations_url":"https://api.github.com/users/ardan-bkennedy/orgs","repos_url":"https://api.github.com/users/ardan-bkennedy/repos","events_url":"https://api.github.com/users/ardan-bkennedy/events{/privacy}","received_events_url":"https://api.github.com/users/ardan-bkennedy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-09-04T14:41:37Z","updated_at":"2018-09-11T15:09:48Z","closed_at":null,"author_association":"NONE","body":"### What version of Go are you using (`go version`)?\r\n```go version go1.11 darwin/amd64```\r\n\r\n### Does this issue reproduce with the latest release?\r\nYES\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\n```\r\nGOARCH=\"amd64\"\r\nGOBIN=\"\"\r\nGOCACHE=\"/Users/bill/Library/Caches/go-build\"\r\nGOEXE=\"\"\r\nGOFLAGS=\"\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"darwin\"\r\nGOOS=\"darwin\"\r\nGOPATH=\"/Users/bill/code/go\"\r\nGOPROXY=\"\"\r\nGORACE=\"\"\r\nGOROOT=\"/usr/local/go\"\r\nGOTMPDIR=\"\"\r\nGOTOOLDIR=\"/usr/local/go/pkg/tool/darwin_amd64\"\r\nGCCGO=\"gccgo\"\r\nCC=\"clang\"\r\nCXX=\"clang++\"\r\nCGO_ENABLED=\"1\"\r\nGOMOD=\"\"\r\nCGO_CFLAGS=\"-g -O2\"\r\nCGO_CPPFLAGS=\"\"\r\nCGO_CXXFLAGS=\"-g -O2\"\r\nCGO_FFLAGS=\"-g -O2\"\r\nCGO_LDFLAGS=\"-g -O2\"\r\nPKG_CONFIG=\"pkg-config\"\r\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/p6/l5y36lvx3zvdc3gtfh0g_43w0000gn/T/go-build393058492=/tmp/go-build -gno-record-gcc-switches -fno-common\"\r\n```\r\n\r\n### What did you do?\r\n\r\nUsing this code:\r\nhttps://github.com/ardanlabs/gotraining/tree/master/topics/go/profiling/memcpu\r\n\r\nI ran this set of commands:\r\n```\r\n$ go test -gcflags \"-m -m\" -run none -bench . -benchtime 3s -benchmem -memprofile p.out  \r\n$ go tool pprof p.out  \r\n(pprof) weblist algOne  \r\n```\r\n\r\n### What did you expect to see?\r\n\r\nI saw the `weblist` view was different (and more accurate) then the `list` view\r\n\r\n**weblist view**\r\n```\r\nType: alloc_space\r\nTime: Sep 3, 2018 at 10:39am (PDT)\r\nTotal: 325.53MB\r\ngithub.com/ardanlabs/gotraining/topics/go/profiling/memcpu.algOne\r\n/Users/bill/code/go/src/github.com/ardanlabs/gotraining/topics/go/profiling/memcpu/stream.go\r\n\r\n  Total:    325.53MB   325.53MB (flat, cum)   100%\r\n     78            .          .            \r\n     79            .          .           // algOne is one way to solve the problem. \r\n     80            .          .           func algOne(data []byte, find []byte, repl []byte, output *bytes.Buffer) { \r\n     81            .          .            \r\n     82            .          .           \t// Use a bytes Buffer to provide a stream to process. \r\n     83     311.03MB   311.03MB           \tinput := bytes.NewBuffer(data) \r\n     84            .          .            \r\n     85            .          .           \t// The number of bytes we are looking for. \r\n     86            .          .           \tsize := len(find) \r\n     87            .          .            \r\n     88            .          .           \t// Declare the buffers we need to process the stream. \r\n     89      14.50MB    14.50MB           \tbuf := make([]byte, size) \r\n     90            .          .           \tend := size - 1 \r\n     91            .          .            \r\n     92            .          .           \t// Read in an initial number of bytes we need to get started. \r\n     93            .          .           \tif n, err := io.ReadFull(input, buf[:end]); err != nil { \r\n     94            .          .           \t\toutput.Write(buf[:n]) \r\n```\r\n\r\n**list view** . \r\n```\r\nROUTINE ======================== github.com/ardanlabs/gotraining/topics/go/profiling/memcpu.algOne in /Users/bill/code/go/src/github.com/ardanlabs/gotraining/topics/go/profiling/memcpu/stream.go\r\n   14.50MB   325.53MB (flat, cum)   100% of Total\r\n         .          .     78:\r\n         .          .     79:// algOne is one way to solve the problem.\r\n         .          .     80:func algOne(data []byte, find []byte, repl []byte, output *bytes.Buffer) {\r\n         .          .     81:\r\n         .          .     82:\t// Use a bytes Buffer to provide a stream to process.\r\n         .   311.03MB     83:\tinput := bytes.NewBuffer(data)\r\n         .          .     84:\r\n         .          .     85:\t// The number of bytes we are looking for.\r\n         .          .     86:\tsize := len(find)\r\n         .          .     87:\r\n         .          .     88:\t// Declare the buffers we need to process the stream.\r\n   14.50MB    14.50MB     89:\tbuf := make([]byte, size)\r\n         .          .     90:\tend := size - 1\r\n```\r\n\r\n### What did you see instead?\r\n\r\nNotice the `weblist` view is showing the allocation is flat, which is correct since the call to NewBuffer is inlined. Maybe more important the views are different. Please keep the allocation `flat` on the report, because it is more accurate with what the compiler chose to do."},"comment":{"url":"https://api.github.com/repos/google/pprof/issues/comments/420308645","html_url":"https://github.com/google/pprof/issues/415#issuecomment-420308645","issue_url":"https://api.github.com/repos/google/pprof/issues/415","id":420308645,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDMwODY0NQ==","user":{"login":"ardan-bkennedy","id":2280005,"node_id":"MDQ6VXNlcjIyODAwMDU=","avatar_url":"https://avatars3.githubusercontent.com/u/2280005?v=4","gravatar_id":"","url":"https://api.github.com/users/ardan-bkennedy","html_url":"https://github.com/ardan-bkennedy","followers_url":"https://api.github.com/users/ardan-bkennedy/followers","following_url":"https://api.github.com/users/ardan-bkennedy/following{/other_user}","gists_url":"https://api.github.com/users/ardan-bkennedy/gists{/gist_id}","starred_url":"https://api.github.com/users/ardan-bkennedy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardan-bkennedy/subscriptions","organizations_url":"https://api.github.com/users/ardan-bkennedy/orgs","repos_url":"https://api.github.com/users/ardan-bkennedy/repos","events_url":"https://api.github.com/users/ardan-bkennedy/events{/privacy}","received_events_url":"https://api.github.com/users/ardan-bkennedy/received_events","type":"User","site_admin":false},"created_at":"2018-09-11T15:09:48Z","updated_at":"2018-09-11T15:09:48Z","author_association":"NONE","body":"Is there a way to specify the granuarily on the `list` call? I can't figure out how to set this. This would solve my problems if I could choose the granularity I wanted."}}
{"actor":{"display_login":"ardan-bkennedy"}}