Re: gcov: enable GCOV_PROFILE_ALL for x86_64

From: Ingo Molnar
Date: Mon Jun 22 2009 - 06:56:24 EST



Another thing i was thinking about:

the GCOV code cannot be enabled in distros right now, due to the
high compiler-generated overhead, and due to the fact that the gcov
data structures used are single threaded. (which makes a gcov
enabled kernel very slow on SMP, due to the global cacheline
bounces)

IMO it would be _much_ better to implement hardware-assisted
call-graph tracking:

- Use the BTS (Branch Trace Store) facilities to hardware-sample
all branches+calls (optionally, dynamically enable-able)

- Post-process the raw branch trace information (in the kernel
BTS-overflow irq handler) to calculate call-coverage information.

Unlike the unconditional GCC based GCOV stuff that is currently
upstream, BTS tracing is supported by a large range of hardware and
it can be enabled _transparently_, so it could be built in and
enabled by distros too, to test code coverage.

Would you be interested in looking at (and implementing) this?

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/