conditional gcov instrumentation

Hayawardh V hayawardh@gmail.com
Mon Sep 7 19:51:00 GMT 2009


Hi,
I have been working on a conditional gcov patch, that calls a function
everytime the gcov counter is to be modified, so the function can
decide how to increment the counter.
The function's prototype is :

void __gcov_ctr(gcov_type*) ;

where gcov_type would be, for example, long long depending on the architecture.

This would be useful for kernel coverage instrumentation (eg) tracking
the coverage of only a particular pid, or for implementing atomic
counters per cpu, and probably for many others.
The libgcov could have a weak default implementation which increments
the counter by 1 as usual, and those wanting to add their own
implementation could do so. (Suggested by Peter Oberparleiter).

I am attaching a patch. Please comment.

Regards,
Hayawardh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-4.4.0-gcov-ctr-ptr.patch
Type: application/octet-stream
Size: 1487 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20090907/e17a0c2a/attachment.obj>


More information about the Gcc mailing list