-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty CPU Profile #16
Comments
Maybe the program is not running long enough to generate useful profiling information. What happens if you use a program that does real work.
|
Hi @davecheney I have a similar problem. The memory and block profiles work ok for me, but
I don't necessarily have some way to peg the server I'm trying to profile (other than writing an expensive loop/func, but that isn't interesting for me to profile). I was able to instrument some things in the browser (it's a webapp) that caused some spikes up near the 30% mark, but still nothing in the EDIT -- for anyone else that arrives here, on a Mac, check if runtime/pprof has any issues on your platform. I'm guessing that might be the issue with my situation. |
@ianwalter i've not been able to reproduce this issue, and haven't had other reports of it. I'm keen to close this issue if you cannot reproduce it further. |
@davecheney I am able to reproduce this issue with the following package main
import (
"time"
"github.com/pkg/profile"
)
func main() {
defer profile.Start(profile.CPUProfile).Stop()
for i := 0; i < 918231333 i++ {
i *= 2
i /= 2
}
<-time.After(time.Second*3)
for i := 0; i < 9182312232; i++ {
i *= 2
i /= 2
}
} |
What happens if you remove the call to set block profile rate? On Mon, 25 Jul 2016, 00:51 Tamer Tas notifications@github.com wrote:
|
@davecheney sorry for the confusion, but the first draft of my comment had the wrong code, which I fixed immediately. But since you're viewing it by e-mail, you saw the old version. I'm quoting my up-to-date comment here again:
package main
import (
"time"
"github.com/pkg/profile"
)
func main() {
defer profile.Start(profile.CPUProfile).Stop()
for i := 0; i < 918231333 i++ {
i *= 2
i /= 2
}
<-time.After(time.Second*3)
for i := 0; i < 9182312232; i++ {
i *= 2
i /= 2
}
} |
I haven't had a chance to run your sample yet. Which version of Go are you using? Is it possible that the conpiler has On Mon, 25 Jul 2016, 17:51 Tamer Tas notifications@github.com wrote:
|
You are using the old version of this package. Please use On Tue, Jul 26, 2016 at 8:14 AM, Dave Cheney dave@cheney.net wrote:
|
I'm trying to profile a simple application:
But when I look at the
cpu.pprof
file it simply contains'
and nothing else.What am I doing incorrectly?
The text was updated successfully, but these errors were encountered: