]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'tip/x86/ftrace' of git://git.kernel.org/pub/scm/linux/kernel/git/rosted...
authorIngo Molnar <mingo@elte.hu>
Sun, 22 Feb 2009 17:12:01 +0000 (18:12 +0100)
committerIngo Molnar <mingo@elte.hu>
Sun, 22 Feb 2009 17:12:01 +0000 (18:12 +0100)
Conflicts:
include/linux/ftrace.h
kernel/trace/ftrace.c

1  2 
arch/x86/kernel/ftrace.c
include/linux/ftrace.h
kernel/trace/ftrace.c

Simple merge
index 915f4723fc8b3e5fa1b68ac1cbc0ee6ada593a76,fdb2a89ae54347331cae40473ae842c4837d9317..847bb3c48dd09edd49ddc0c42f8a835a5a084639
@@@ -106,30 -99,9 +106,33 @@@ struct ftrace_func_command 
  /* asm/ftrace.h must be defined for archs supporting dynamic ftrace */
  #include <asm/ftrace.h>
  
+ int ftrace_arch_code_modify_prepare(void);
+ int ftrace_arch_code_modify_post_process(void);
 +struct seq_file;
 +
 +struct ftrace_probe_ops {
 +      void                    (*func)(unsigned long ip,
 +                                      unsigned long parent_ip,
 +                                      void **data);
 +      int                     (*callback)(unsigned long ip, void **data);
 +      void                    (*free)(void **data);
 +      int                     (*print)(struct seq_file *m,
 +                                       unsigned long ip,
 +                                       struct ftrace_probe_ops *ops,
 +                                       void *data);
 +};
 +
 +extern int
 +register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
 +                            void *data);
 +extern void
 +unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
 +                              void *data);
 +extern void
 +unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
 +extern void unregister_ftrace_function_probe_all(char *glob);
 +
  enum {
        FTRACE_FL_FREE          = (1 << 0),
        FTRACE_FL_FAILED        = (1 << 1),
index cf59f4c547452cd46b230abc756140257e0ce26a,11ad796ca0495ee9ab0bb47a99f40e86bcfc1d43..5a3a06b21eeee97fd8c527deaf1bd57887402b7b
@@@ -530,37 -531,44 +530,40 @@@ __ftrace_replace_code(struct dyn_ftrac
  
  static void ftrace_replace_code(int enable)
  {
 -      int i, failed;
        struct dyn_ftrace *rec;
        struct ftrace_page *pg;
 +      int failed;
  
 -      for (pg = ftrace_pages_start; pg; pg = pg->next) {
 -              for (i = 0; i < pg->index; i++) {
 -                      rec = &pg->records[i];
 -
 -                      /*
 -                       * Skip over free records and records that have
 -                       * failed.
 -                       */
 -                      if (rec->flags & FTRACE_FL_FREE ||
 -                          rec->flags & FTRACE_FL_FAILED)
 -                              continue;
 +      do_for_each_ftrace_rec(pg, rec) {
 +              /*
 +               * Skip over free records and records that have
 +               * failed.
 +               */
 +              if (rec->flags & FTRACE_FL_FREE ||
 +                  rec->flags & FTRACE_FL_FAILED)
 +                      continue;
  
 -                      /* ignore updates to this record's mcount site */
 -                      if (get_kprobe((void *)rec->ip)) {
 -                              freeze_record(rec);
 -                              continue;
 -                      } else {
 -                              unfreeze_record(rec);
 -                      }
 +              /* ignore updates to this record's mcount site */
 +              if (get_kprobe((void *)rec->ip)) {
 +                      freeze_record(rec);
 +                      continue;
 +              } else {
 +                      unfreeze_record(rec);
 +              }
  
 -                      failed = __ftrace_replace_code(rec, enable);
 -                      if (failed && (rec->flags & FTRACE_FL_CONVERTED)) {
 -                              rec->flags |= FTRACE_FL_FAILED;
 -                              if ((system_state == SYSTEM_BOOTING) ||
 -                                  !core_kernel_text(rec->ip)) {
 -                                      ftrace_free_rec(rec);
 +              failed = __ftrace_replace_code(rec, enable);
 +              if (failed && (rec->flags & FTRACE_FL_CONVERTED)) {
 +                      rec->flags |= FTRACE_FL_FAILED;
 +                      if ((system_state == SYSTEM_BOOTING) ||
 +                          !core_kernel_text(rec->ip)) {
 +                              ftrace_free_rec(rec);
-                       } else
+                               } else {
 -                                      ftrace_bug(failed, rec->ip);
 +                              ftrace_bug(failed, rec->ip);
+                                       /* Stop processing */
+                                       return;
+                               }
 -                      }
                }
 -      }
 +      } while_for_each_ftrace_rec();
  }
  
  static int