Red Hat Bugzilla – Bug 459141
Add ftrace boot time nop replacement
Last modified: 2008-10-07 15:21:05 EDT
Created attachment 314335 [details]
patch for mcount record change to nop on boot up
I ported the ftrace nop replacement to the MRG kernel.
Currently the way dynamic ftrace works, is on boot up all calls to mcount are recorded. That is the calling site is recorded in a preallocated hash. Later a daemon wakes up, and if anything was recorded, it calls kstop machine and replaces the calling site to mcount with a nop.
This new approach adds code in the build system to make a table of all calling sites. On boot up, all the sites are converted into nops.
This is a much more reliable way to handle ftrace, and also this means that ftrace has virtually no overhead when configured in. The old daemon ran the risk of latencies when doing the kstop machine. This method does not need to use the daemon.
Kstop_machine is now only executed on enabling and disabling the function tracer.
Note: after adding the attached patch, the file
scripts/recordmcount.pl must be changed to executable.
chmod +x scripts/recordmcount.pl
This may be needed to be done in the spec file.
Queued for -78
Verified that the attached patch (https://bugzilla.redhat.com/attachment.cgi?id=314335) is implemented in mrg-rt-184.108.40.206-81 (mrg-rt.git commit 3073ec96e9608875a83cc57c1522b05f978134b2)
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.