Merge tag 'trace-v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[sfrench/cifs-2.6.git] / kernel / trace / ftrace.c
index 76973a70ab9d8b8e0b8f511b4c54f4b339028af0..76466846715588c304bc9f14c17c7d341f7a6b21 100644 (file)
@@ -46,7 +46,8 @@
 #include "trace_stat.h"
 
 /* Flags that do not get reset */
-#define FTRACE_NOCLEAR_FLAGS   (FTRACE_FL_DISABLED | FTRACE_FL_TOUCHED)
+#define FTRACE_NOCLEAR_FLAGS   (FTRACE_FL_DISABLED | FTRACE_FL_TOUCHED | \
+                                FTRACE_FL_MODIFIED)
 
 #define FTRACE_INVALID_FUNCTION                "__ftrace_invalid_address__"
 
@@ -2273,6 +2274,10 @@ static int ftrace_check_record(struct dyn_ftrace *rec, bool enable, bool update)
                                        rec->flags &= ~FTRACE_FL_TRAMP_EN;
                        }
 
+                       /* Keep track of anything that modifies the function */
+                       if (rec->flags & (FTRACE_FL_DIRECT | FTRACE_FL_IPMODIFY))
+                               rec->flags |= FTRACE_FL_MODIFIED;
+
                        if (flag & FTRACE_FL_DIRECT) {
                                /*
                                 * If there's only one user (direct_ops helper)
@@ -3866,12 +3871,13 @@ static int t_show(struct seq_file *m, void *v)
        if (iter->flags & (FTRACE_ITER_ENABLED | FTRACE_ITER_TOUCHED)) {
                struct ftrace_ops *ops;
 
-               seq_printf(m, " (%ld)%s%s%s%s",
+               seq_printf(m, " (%ld)%s%s%s%s%s",
                           ftrace_rec_count(rec),
                           rec->flags & FTRACE_FL_REGS ? " R" : "  ",
                           rec->flags & FTRACE_FL_IPMODIFY ? " I" : "  ",
                           rec->flags & FTRACE_FL_DIRECT ? " D" : "  ",
-                          rec->flags & FTRACE_FL_CALL_OPS ? " O" : "  ");
+                          rec->flags & FTRACE_FL_CALL_OPS ? " O" : "  ",
+                          rec->flags & FTRACE_FL_MODIFIED ? " M " : "   ");
                if (rec->flags & FTRACE_FL_TRAMP_EN) {
                        ops = ftrace_find_tramp_ops_any(rec);
                        if (ops) {