Comments (8)
Hi @davecheney I have a similar problem. The memory and block profiles work ok for me, but
$ls -al cpu.pprof
-rw-r--r-- 1 davisford staff 64 Apr 5 13:49 cpu.pprof
$cat cpu.pprof
~/$
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 cpu.pprof
file. Is it possible to tune the threshold where it starts recording like you can with the memory?
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.
from profile.
"github.com/davecheney/profile"
You are using the old version of this package. Please use
github.com/pkg/profile.
On Tue, Jul 26, 2016 at 8:14 AM, Dave Cheney [email protected] wrote:
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
optimised away those loops leaving you with just the sleep?On Mon, 25 Jul 2016, 17:51 Tamer Tas [email protected] wrote:
@davecheney https://github.com/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:@davecheney https://github.com/davecheney I am able to reproduce this
issue with the following main.go and go 1.6.2 in OSX 10.11 (contains the
kernel fix for pprof) and Ubuntu 16.04package main
import (
"time"
"github.com/davecheney/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 }
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#16 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAcA9abAqHYSoNgEYspQHWKy1q-lt27ks5qZGsAgaJpZM4Gq83x
.
from profile.
Maybe the program is not running long enough to generate useful profiling information. What happens if you use a program that does real work.
On 29 Nov 2015, at 17:37, Ian Walter [email protected] wrote:
I'm trying to profile a simple application:
package main
import (
"github.com/pkg/profile"
"github.com/spf13/cobra"
"strings"
)/*
Tokenize TODO
*/
func Tokenize(text string) []string {
return strings.Split(text, "\n")
}func main() {
profileCommand := &cobra.Command{
Use: "profile",
Run: func(cmd *cobra.Command, args []string) {
defer profile.Start(profile.CPUProfile, profile.ProfilePath(".")).Stop()Tokenize("Hello\nWorld") }, } rootCommand := &cobra.Command{Use: "bern"} rootCommand.AddCommand(profileCommand) rootCommand.Execute()
}
But when I look at the cpu.pprof file it simply contains ' and nothing else.
What am I doing incorrectly?—
Reply to this email directly or view it on GitHub.
from profile.
@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.
from profile.
@davecheney I am able to reproduce this issue with the following main.go
and go 1.6.2 in OSX 10.11 (contains the kernel fix for pprof) and Ubuntu 16.04
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
}
}
from profile.
What happens if you remove the call to set block profile rate?
On Mon, 25 Jul 2016, 00:51 Tamer Tas [email protected] wrote:
@davecheney https://github.com/davecheney I am able to reproduce this
issue with the following main.go and go 1.6.2package main
import (
"runtime"
"github.com/davecheney/profile"
)
func main() {
runtime.SetBlockProfileRate(1)defer profile.Start(profile.CPUProfile).Stop() for i := 0; i < 9182319231998989889; i++ { i *= 2 i /= 2 }
}
—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
#16 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAcA9oQgfBnncRToJApyCSRRnBAYMEZks5qY3vqgaJpZM4Gq83x
.
from profile.
@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:
@davecheney I am able to reproduce this issue with the following
main.go
and go 1.6.2 in OSX 10.11 (contains the kernel fix for pprof) and Ubuntu 16.04
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
}
}
from profile.
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
optimised away those loops leaving you with just the sleep?
On Mon, 25 Jul 2016, 17:51 Tamer Tas [email protected] wrote:
@davecheney https://github.com/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:@davecheney https://github.com/davecheney I am able to reproduce this
issue with the following main.go and go 1.6.2 in OSX 10.11 (contains the
kernel fix for pprof) and Ubuntu 16.04package main
import (
"time"
"github.com/davecheney/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 }
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#16 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAcA9abAqHYSoNgEYspQHWKy1q-lt27ks5qZGsAgaJpZM4Gq83x
.
from profile.
Related Issues (20)
- Source of memory increase
- Add mutex profile support HOT 1
- Is it possible to enable two profiles at the same time. HOT 1
- TestProfile fails HOT 5
- parsing profile: unrecognized profile format under MacOs Sierra 10.12.5 HOT 11
- Error in running with profile package HOT 1
- parsing profile: unrecognized profile format in ubuntu HOT 2
- Multi-modal profiling HOT 11
- How to profile loading of libraries ? HOT 4
- 0 Byte files when attempting to generate CPU and Memory profiles HOT 4
- Add ProfileFilename HOT 2
- Using MemProfileAllocs sample in the readme HOT 1
- 10 byte profile file can't be opened HOT 7
- Timing profiling? HOT 7
- Versioning and breaking change in `MemProfile{Heap,Allocs}` signatures HOT 4
- Named interface for Stop() HOT 10
- No support to run multiple profile HOT 6
- Doesn't releases the file even after calling profile.Stop() HOT 1
- Failing tests: profile_test.go:258: error: expected nil, got exit status 1
- Avoid profile.*Profile* stutter in API
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from profile.