On Mon, Jul 5, 2021 at 4:24 PM 'Tal Lichtenstein' via golang-nuts <golang-nuts@googlegroups.com> wrote: > > I am trying to pinpoint a performance issue with a go package that uses a > large 3rd party C++ library we interface with using CGO. > > Tried these options: > > 1. Go profiler - doesn't see anything beyond function runtime.cgocall. This > has already been discussed here and as far as I understand is not going to be > supported. > > 2. gperftools - it seems the Go runtime is interfering with the operation of > gperftools in some way: When starting the program with the CPUPROFILE > variable or using explicit ProfilerStart() calls, the output file gets > created but nothing is written to it until the program ends. My guess is the > Go runtime is somehow preventing gperftools from receiving sampling events. > > 3. Linux perf - this works, but requires converting the data to pprof format > (using perf_data_converter) or analyzing it using another tool like hotspot. > > Currently our best bet is to stick to perf. Anyone have other suggestions? > > It would be awesome if Go supported profiling a mixed C/Go application with > the built-in tools...
It may work if you import github.com/ianlancetaylor/cgosymbolizer. One of the goals of that package is to support CPU profiling for C++ code called by a Go program. 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUHKuJcyiPg4TQ1P-gCARurNWU8JWq2Ty6j2EYLEdOCZQ%40mail.gmail.com.