aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ftrace.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 9e60ae423af9..340f88b68d9e 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1153,8 +1153,6 @@ static void ftrace_match_records(char *buff, int len, int enable)
1153 1153
1154 /* should not be called from interrupt context */ 1154 /* should not be called from interrupt context */
1155 spin_lock(&ftrace_lock); 1155 spin_lock(&ftrace_lock);
1156 if (enable)
1157 ftrace_filtered = 1;
1158 do_for_each_ftrace_rec(pg, rec) { 1156 do_for_each_ftrace_rec(pg, rec) {
1159 1157
1160 if (rec->flags & FTRACE_FL_FAILED) 1158 if (rec->flags & FTRACE_FL_FAILED)
@@ -1166,7 +1164,12 @@ static void ftrace_match_records(char *buff, int len, int enable)
1166 else 1164 else
1167 rec->flags |= flag; 1165 rec->flags |= flag;
1168 } 1166 }
1169 1167 /*
1168 * Only enable filtering if we have a function that
1169 * is filtered on.
1170 */
1171 if (enable && (rec->flags & FTRACE_FL_FILTER))
1172 ftrace_filtered = 1;
1170 } while_for_each_ftrace_rec(); 1173 } while_for_each_ftrace_rec();
1171 spin_unlock(&ftrace_lock); 1174 spin_unlock(&ftrace_lock);
1172} 1175}
@@ -1217,9 +1220,6 @@ static void ftrace_match_module_records(char *buff, char *mod, int enable)
1217 1220
1218 /* should not be called from interrupt context */ 1221 /* should not be called from interrupt context */
1219 spin_lock(&ftrace_lock); 1222 spin_lock(&ftrace_lock);
1220 if (enable)
1221 ftrace_filtered = 1;
1222
1223 do_for_each_ftrace_rec(pg, rec) { 1223 do_for_each_ftrace_rec(pg, rec) {
1224 1224
1225 if (rec->flags & FTRACE_FL_FAILED) 1225 if (rec->flags & FTRACE_FL_FAILED)
@@ -1232,6 +1232,8 @@ static void ftrace_match_module_records(char *buff, char *mod, int enable)
1232 else 1232 else
1233 rec->flags |= flag; 1233 rec->flags |= flag;
1234 } 1234 }
1235 if (enable && (rec->flags & FTRACE_FL_FILTER))
1236 ftrace_filtered = 1;
1235 1237
1236 } while_for_each_ftrace_rec(); 1238 } while_for_each_ftrace_rec();
1237 spin_unlock(&ftrace_lock); 1239 spin_unlock(&ftrace_lock);