diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-04-26 16:11:03 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-04-29 22:53:08 -0400 |
commit | 996e87be7f537fb34638875dd37083166c733425 (patch) | |
tree | 0d961a4870b39450470b117cde45c3c2c1931959 /kernel/trace/ftrace.c | |
parent | d2c8c3eafbf715306ec891e7ca52d3d999acbe31 (diff) |
ftrace: Move record update for normal and modules into a separate function
The updating of a function record is moved to a single function. This will allow
us to add specific changes in one location for both modules and kernel
functions.
Later patches will determine if the function record itself needs to be updated
(which enables the mcount caller), or just the ftrace_ops needs the update.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 9abaaf46f212..5b758ea344ce 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1743,6 +1743,15 @@ static int ftrace_match(char *str, char *regex, int len, int type) | |||
1743 | return matched; | 1743 | return matched; |
1744 | } | 1744 | } |
1745 | 1745 | ||
1746 | static void | ||
1747 | update_record(struct dyn_ftrace *rec, unsigned long flag, int not) | ||
1748 | { | ||
1749 | if (not) | ||
1750 | rec->flags &= ~flag; | ||
1751 | else | ||
1752 | rec->flags |= flag; | ||
1753 | } | ||
1754 | |||
1746 | static int | 1755 | static int |
1747 | ftrace_match_record(struct dyn_ftrace *rec, char *regex, int len, int type) | 1756 | ftrace_match_record(struct dyn_ftrace *rec, char *regex, int len, int type) |
1748 | { | 1757 | { |
@@ -1772,10 +1781,7 @@ static int ftrace_match_records(char *buff, int len, int enable) | |||
1772 | do_for_each_ftrace_rec(pg, rec) { | 1781 | do_for_each_ftrace_rec(pg, rec) { |
1773 | 1782 | ||
1774 | if (ftrace_match_record(rec, search, search_len, type)) { | 1783 | if (ftrace_match_record(rec, search, search_len, type)) { |
1775 | if (not) | 1784 | update_record(rec, flag, not); |
1776 | rec->flags &= ~flag; | ||
1777 | else | ||
1778 | rec->flags |= flag; | ||
1779 | found = 1; | 1785 | found = 1; |
1780 | } | 1786 | } |
1781 | /* | 1787 | /* |
@@ -1846,10 +1852,7 @@ static int ftrace_match_module_records(char *buff, char *mod, int enable) | |||
1846 | 1852 | ||
1847 | if (ftrace_match_module_record(rec, mod, | 1853 | if (ftrace_match_module_record(rec, mod, |
1848 | search, search_len, type)) { | 1854 | search, search_len, type)) { |
1849 | if (not) | 1855 | update_record(rec, flag, not); |
1850 | rec->flags &= ~flag; | ||
1851 | else | ||
1852 | rec->flags |= flag; | ||
1853 | found = 1; | 1856 | found = 1; |
1854 | } | 1857 | } |
1855 | if (enable && (rec->flags & FTRACE_FL_FILTER)) | 1858 | if (enable && (rec->flags & FTRACE_FL_FILTER)) |