{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/15102","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/15102/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/15102/comments","events_url":"https://api.github.com/repos/golang/go/issues/15102/events","html_url":"https://github.com/golang/go/issues/15102","id":145707151,"number":15102,"title":"runtime/trace: generated timestamps have a jump in them","user":{"login":"mbertschler","id":3779568,"avatar_url":"https://avatars.githubusercontent.com/u/3779568?v=3","gravatar_id":"","url":"https://api.github.com/users/mbertschler","html_url":"https://github.com/mbertschler","followers_url":"https://api.github.com/users/mbertschler/followers","following_url":"https://api.github.com/users/mbertschler/following{/other_user}","gists_url":"https://api.github.com/users/mbertschler/gists{/gist_id}","starred_url":"https://api.github.com/users/mbertschler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbertschler/subscriptions","organizations_url":"https://api.github.com/users/mbertschler/orgs","repos_url":"https://api.github.com/users/mbertschler/repos","events_url":"https://api.github.com/users/mbertschler/events{/privacy}","received_events_url":"https://api.github.com/users/mbertschler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"dvyukov","id":1095328,"avatar_url":"https://avatars.githubusercontent.com/u/1095328?v=3","gravatar_id":"","url":"https://api.github.com/users/dvyukov","html_url":"https://github.com/dvyukov","followers_url":"https://api.github.com/users/dvyukov/followers","following_url":"https://api.github.com/users/dvyukov/following{/other_user}","gists_url":"https://api.github.com/users/dvyukov/gists{/gist_id}","starred_url":"https://api.github.com/users/dvyukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvyukov/subscriptions","organizations_url":"https://api.github.com/users/dvyukov/orgs","repos_url":"https://api.github.com/users/dvyukov/repos","events_url":"https://api.github.com/users/dvyukov/events{/privacy}","received_events_url":"https://api.github.com/users/dvyukov/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/31","html_url":"https://github.com/golang/go/milestones/Go1.7","labels_url":"https://api.github.com/repos/golang/go/milestones/31/labels","id":1414133,"number":31,"title":"Go1.7","description":"","creator":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"open_issues":296,"closed_issues":198,"state":"open","created_at":"2015-11-16T16:57:07Z","updated_at":"2016-04-07T15:57:27Z","due_on":"2016-07-31T07:00:00Z","closed_at":null},"comments":1,"created_at":"2016-04-04T14:51:21Z","updated_at":"2016-04-07T17:22:05Z","closed_at":null,"body":"I discovered a problem with a trace file that was generated on a `linux/arm` device (Beaglebone Black ARMv7). The program was cross-compiled on my laptop  `go version go1.6 darwin/amd64` with `GOOS=linux GOARCH=arm GOARM=7`.\r\n\r\nI generated the trace file with `runtime/trace` packages Start/Stop functions.\r\nThen I transfered the file to my laptop and ran `go tool trace`. Web browser opened, but when clicking on something it produced the error `failed to parse trace: time stamps out of order`.\r\nThe check that produces this error is here: [internal/trace/parser.go](https://golang.org/src/internal/trace/parser.go#L568)\r\n\r\nI modified the source code to print the index and timestamps of the relevant events in the tracefile:\r\n\r\n```\r\nindex= 1191701   ev.Ts=  147573700100\r\nindex= 1191702   ev.Ts=  147573703108\r\nindex= 1191703   ev.Ts=  147573707524\r\nindex= 1191704   ev.Ts=  147573711028\r\nindex= 1191705   ev.Ts=  147573735572\r\nindex= 1191706   ev.Ts=  147573865188\r\nindex= 1191707   ev.Ts=  147573867444\r\nindex= 1191708   ev.Ts=  147573888900\r\nindex= 1191709   ev.Ts=  147573893780\r\nindex= 1191710   ev.Ts= -147573193487\r\nindex= 1191711   ev.Ts= -147573190607\r\nindex= 1191712   ev.Ts= -147573186191\r\nindex= 1191713   ev.Ts= -147573182815\r\nindex= 1191714   ev.Ts= -147573158159\r\nindex= 1191715   ev.Ts= -147573029439\r\nindex= 1191716   ev.Ts= -147573027279\r\nindex= 1191717   ev.Ts= -147573005983\r\nindex= 1191718   ev.Ts= -147573001071\r\nindex= 1191719   ev.Ts= -147572190527\r\n```\r\n\r\nThis is the tracefile: [trace_1.zip](https://github.com/golang/go/files/202651/trace_1.zip)\r\nDo you also need the code? It is <200LOC but dependent on 32bit Linux system calls.\r\n\r\nSo except one jump, that looks like just the switch of the sign, everything is consistent.\r\nI was not able to reproduce this. What could have happened here?"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/207006102","html_url":"https://github.com/golang/go/issues/15102#issuecomment-207006102","issue_url":"https://api.github.com/repos/golang/go/issues/15102","id":207006102,"user":{"login":"dvyukov","id":1095328,"avatar_url":"https://avatars.githubusercontent.com/u/1095328?v=3","gravatar_id":"","url":"https://api.github.com/users/dvyukov","html_url":"https://github.com/dvyukov","followers_url":"https://api.github.com/users/dvyukov/followers","following_url":"https://api.github.com/users/dvyukov/following{/other_user}","gists_url":"https://api.github.com/users/dvyukov/gists{/gist_id}","starred_url":"https://api.github.com/users/dvyukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvyukov/subscriptions","organizations_url":"https://api.github.com/users/dvyukov/orgs","repos_url":"https://api.github.com/users/dvyukov/repos","events_url":"https://api.github.com/users/dvyukov/events{/privacy}","received_events_url":"https://api.github.com/users/dvyukov/received_events","type":"User","site_admin":false},"created_at":"2016-04-07T17:22:05Z","updated_at":"2016-04-07T17:22:05Z","body":"Please try the following patch:\r\n```\r\ndiff --git a/src/runtime/os_linux_arm.go b/src/runtime/os_linux_arm.go\r\nindex 8fdfb58..f483b33 100644\r\n--- a/src/runtime/os_linux_arm.go\r\n+++ b/src/runtime/os_linux_arm.go\r\n@@ -71,5 +71,5 @@ func cputicks() int64 {\r\n        // Currently cputicks() is used in blocking profiler and to seed fastrand1().\r\n        // nanotime() is a poor approximation of CPU ticks that is enough for the profiler.\r\n        // randomNumber provides better seeding of fastrand1.\r\n-       return nanotime() + int64(randomNumber)\r\n+       return nanotime()// + int64(randomNumber)\r\n }\r\n```"}}