Re: [PATCH 3/4] gcov: add gcov profiling infrastructure

Peter Oberparleiter
2009-05-22T08:55:54Z

Ingo Molnar wrote:
> * Peter Oberparleiter <oberpar@linux.vnet.ibm.com> wrote:
>
>> +int __gcov_execve(const char *path, char *const argv[], char *const envp[])
>> +{
>> + return kernel_execve(path, argv, envp);
>> +}
>> +EXPORT_SYMBOL(__gcov_execve);
>
> Looks weird, why is this needed?

When compiling with -fprofile-arcs, gcc will turn execve calls into a
builtin which calls __gcov_execve(). This is needed in userspace to
ensure that data for the calling process is correctly saved.

Back when kernel_execve() used to be called execve(), this function was
required to prevent linker errors. If it's generally agreed not to name
kernel functions execve(), this one might as well be removed (not sure
about such an agreement though).