summaryrefslogtreecommitdiffstats
path: root/include/linux/ftrace.h
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-05-12 21:20:48 +0200
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 20:54:04 +0200
commit37ad508419f0fdfda7b378756eb1f35cfd26d96d (patch)
tree53db6e201e605c1926adc74fa965b1a615066da8 /include/linux/ftrace.h
parent088b1e427dbba2af93cb6a7d39258c10ff58dd27 (diff)
ftrace - fix dynamic ftrace memory leak
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: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r--include/linux/ftrace.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index a842d96c634..61e757bd235 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -43,9 +43,10 @@ extern void mcount(void);
# define FTRACE_HASHSIZE (1<<FTRACE_HASHBITS)
enum {
- FTRACE_FL_FAILED = (1 << 0),
- FTRACE_FL_FILTER = (1 << 1),
- FTRACE_FL_ENABLED = (1 << 2),
+ FTRACE_FL_FREE = (1 << 0),
+ FTRACE_FL_FAILED = (1 << 1),
+ FTRACE_FL_FILTER = (1 << 2),
+ FTRACE_FL_ENABLED = (1 << 3),
};
struct dyn_ftrace {