• S
    ftrace - fix dynamic ftrace memory leak · 37ad5084
    Steven Rostedt 提交于
    The ftrace dynamic function update allocates a record to store the
    instruction pointers that are being modified. If the modified
    instruction pointer fails to update, then the record is marked as
    failed and nothing more is done.
    
    Worse, if the modification fails, but the record ip function is still
    called, it will allocate a new record and try again. In just a matter
    of time, will this cause a serious memory leak and crash the system.
    
    This patch plugs this memory leak. When a record fails, it is
    included back into the pool of records to be used. Now a record may
    fail over and over again, but the number of allocated records will
    not increase.
    Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
    Signed-off-by: NIngo Molnar <mingo@elte.hu>
    Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
    37ad5084
ftrace.h 3.6 KB