<pre class="notranslate">What steps will reproduce the problem?

$ cat k.c
#include &lt;stdio.h&gt;
int main(int argc, char* argv[]) {
        printf("hello\n");
        return 0;
}

$ cat k.go
package main
func main() {
        println("hello")
}

$ rm -f *.o *.gc* k

$ /opt/gccgo/bin/gcc -o k k.c --coverage

k.gcno is created

$ ./k
hello

k.gcda is created

$ gcov k
File 'k.c'
Lines executed:100.00% of 3
Creating 'k.c.gcov'

looks good

now with go:

$ rm -f *.o *.gc* k

$ /opt/gccgo/bin/gccgo -o k k.go --coverage

k.gcno is created

$ ./k
hello

k.gcna is not created

Which compiler are you using (5g, 6g, 8g, gccgo)?

gccgo

Which operating system are you using?

linux

Which revision are you using?  (hg identify)

tip</pre>
<pre class="notranslate">Problem description on golang-nuts:
<a href="https://groups.google.com/d/msg/golang-nuts/mWXsJJMdL0M/wioVT04ye7UJ" rel="nofollow">https://groups.google.com/d/msg/golang-nuts/mWXsJJMdL0M/wioVT04ye7UJ</a>

In short, pprof misses 7.5% of samples in newstack/oldstack (perf reports them
properly). This happens because the profiler ignores samples on g0 (where
newstack/oldstack are executed). We need to figure out a way to attribute the samples to
the running goroutine.</pre>