google / starlark-go

Starlark in Go: the Starlark configuration language, implemented in Go
BSD 3-Clause "New" or "Revised" License
2.34k stars 212 forks source link

starlark: profiler records incorrect Profile.time (Jan 1 1970) #186

Closed alandonovan closed 5 years ago

alandonovan commented 5 years ago

Most likely a consequence of using the MONOTONIC not REALTIME clock.

josharian commented 5 years ago

I haven't had a chance to fully grok through the original PR or the subsequent one, but I did see a comment along the lines of "CLOCK_GETTIME is not available". But I believe it should be, in golang.org/x/sys. I added it recently for darwin (https://github.com/golang/sys/commit/3b5209105503162ded1863c307ac66fec31120dd) and it was there already for linux.

Please ignore this comment if it is unhelpful. :)

alandonovan commented 5 years ago

Thanks. I've noted this in the comment.