aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/ftrace.c19
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
1746static void
1747update_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
1746static int 1755static int
1747ftrace_match_record(struct dyn_ftrace *rec, char *regex, int len, int type) 1756ftrace_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))