-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime/pprof: improve docs around short-lived processes #20202
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
Comments
What version of OS X? |
How are you exiting your program? If you ^C it the defer in main may not be
able to run.
…On Tue, 2 May 2017, 08:54 Josh Bleecher Snyder ***@***.***> wrote:
What version of OS X?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#20202 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAcAx5ocjTfrXTP7ye4WLZWlb6DPtgqks5r1mKpgaJpZM4NNeYm>
.
|
@josharian Sierra 10.12.4
|
That's pretty much what my github.com/pkg/profile package does. Maybe try
using that instead
…On Tue, 2 May 2017, 10:37 Aaron Wood ***@***.***> wrote:
@josharian <https://github.com/josharian> Sierra 10.12.4
@davecheney <https://github.com/davecheney> I have a signal handler in my
code that catches SIGINT and SIGTERM so it should exit cleanly. It (very
roughly) looks like this:
func (s *MyThing) registerShutdownHandlers() {
sigs := make(chan os.Signal)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
go func() {
<-sigs
// Do my stuff
os.Exit(0)
}()
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20202 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAcA3vWvkbEvoIEhf5NgSgy36fFl2guks5r1nrRgaJpZM4NNeYm>
.
|
Sure, I'll give it a shot tomorrow once I'm back at work. Is this a known issue with OS X? |
Old versions, yes. Yours should be fine. https://research.swtch.com/macpprof |
The deferred statement won't run if |
@davecheney I was able to try out your suggestion just now with no luck:
|
@vcabbage you're right, I removed my signal handler and used @davecheney's package by itself and finally got some (2 KB) data. |
So basically it sounds like I need to do the same thing as what @davecheney is doing in his package if we use the builtin |
By default is everything that would go to the file 100% buffered? No writes would ever occur until the program exits? Or is it that everything is buffered until |
What version of Go are you using (
go version
)?go version go1.8.1 darwin/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
Added basic CPU profiling code to
main()
:Then I ran my program and threw a load tester at it.
What did you expect to see?
Data in
test.prof
after gracefully exiting my program.What did you see instead?
After heavily loading my program with a load testing tool I made I observed that no bytes were ever written to
test.prof
. It seems like there is no sampling being done at all...?The text was updated successfully, but these errors were encountered: