On Sun, Jan 15, 2017 at 1:04 AM, Yucong Sun <sunyuc...@gmail.com> wrote: > > Sorry for replying late. > > 1: operating system is linux > 2. golang 1.7 > 3. I'm statically linking Go with C++ code, so I guess that is > -buildmode=c-archive.
With 1.7, if your program spends most of its time in C code that runs in threads created by C code, then most of the profiling information will be discarded. This is fixed in 1.8 (https://golang.org/cl/30252). So my first suggestion is that you try the 1.8 release candidate to see if it fixes the problem. Ian > On Tue, Jan 10, 2017 at 1:21 PM Ian Lance Taylor <i...@golang.org> wrote: >> >> On Tue, Jan 10, 2017 at 12:52 PM, Yucong Sun <sunyuc...@gmail.com> wrote: >> > >> > I've successfully compile and staticlly linked my C++ project and CGO , >> > I >> > was trying to get on demand CPU profling to work, but it keeps >> > generating >> > empty outputs. >> > >> > The CPU profiling page mentioned that if code built in C mode, i need to >> > do >> > something with SIGPROF , but no examples were given, could anyone >> > enlighten >> > me? >> >> What operating system? >> >> What version of Go? >> >> What is the "CPU profiling page"? Do you mean >> https://golang.org/pkg/runtime/pprof? The references there to SIGPROF >> are specific to using -buildmode=c-archive or -buildmode=c-shared. >> Are you using one of those build modes? >> >> Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.