If CONFIG_MCOUNT is selected and /proc/sys/kernel/mcount_enabled is set to anon-zero value the mcount routine will be called everytime we enter a kernelfunction that is not marked with the "notrace" attribute.

The mcount routine will then call a registered function if a functionhappens to be registered.

[This code has been highly hacked by Steven Rostedt, so don't blame Arnaldo for all of this ;-) ]

Update: It is now possible to register more than one mcount function. If only one mcount function is registered, that will be the function that mcount calls directly. If more than one function is registered, then mcount will call a function that will loop through the functions to call.