]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'tracing/ftrace' into auto-ftrace-next
authorIngo Molnar <mingo@elte.hu>
Thu, 10 Jul 2008 09:43:00 +0000 (11:43 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 10 Jul 2008 09:43:00 +0000 (11:43 +0200)
1  2 
Makefile
arch/x86/Kconfig
arch/x86/mm/init_64.c
kernel/printk.c
kernel/sched.c

diff --combined Makefile
index 6315424a00b9fb2634f38f17833d7f302968a664,ff2c681fb5dd6bc61efe62490d4e2b0702ddd5f2..8e519953d2db955d7f78ae01fa5b6197c17fd90c
+++ b/Makefile
@@@ -1,7 -1,7 +1,7 @@@
  VERSION = 2
  PATCHLEVEL = 6
  SUBLEVEL = 26
 -EXTRAVERSION = -rc8
 +EXTRAVERSION = -rc9
  NAME = Rotary Wombat
  
  # *DOCUMENTATION*
@@@ -528,6 -528,10 +528,10 @@@ KBUILD_CFLAGS    += -
  KBUILD_AFLAGS += -gdwarf-2
  endif
  
+ ifdef CONFIG_FTRACE
+ KBUILD_CFLAGS += -pg
+ endif
  # We trigger additional mismatches with less inlining
  ifdef CONFIG_DEBUG_SECTION_MISMATCH
  KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
diff --combined arch/x86/Kconfig
index bf07b6f50fa178268f9d81388a615a7a8abff32b,400135148555e0fa8109ee836dc49d483c2ffd4c..c3a4c03c08003e23b373456e57f7dc17c08534dd
@@@ -23,6 -23,8 +23,8 @@@ config X8
        select HAVE_OPROFILE
        select HAVE_KPROBES
        select HAVE_KRETPROBES
+       select HAVE_DYNAMIC_FTRACE
+       select HAVE_FTRACE
        select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
        select HAVE_ARCH_KGDB if !X86_VOYAGER
  
@@@ -966,8 -968,8 +968,8 @@@ config NUMA_EM
          number of nodes. This is only useful for debugging.
  
  config NODES_SHIFT
 -      int "Max num nodes shift(1-15)"
 -      range 1 15  if X86_64
 +      int "Max num nodes shift(1-9)"
 +      range 1 9  if X86_64
        default "6" if X86_64
        default "4" if X86_NUMAQ
        default "3"
diff --combined arch/x86/mm/init_64.c
index 819dad973b1375bc5da5a90297c5c41788d2a652,a5fd2e06f5c994b0f6874e1be4d739f5d91bb897..17c0a6138a53bd0bc84f7a2504bd85a612733c91
@@@ -135,7 -135,7 +135,7 @@@ static __init void *spp_getpage(void
        return ptr;
  }
  
 -static void
 +static __init void
  set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot)
  {
        pgd_t *pgd;
@@@ -214,7 -214,7 +214,7 @@@ void __init cleanup_highmap(void
  }
  
  /* NOTE: this is meant to be run only at boot */
 -void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
 +void __init __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
  {
        unsigned long address = __fix_to_virt(idx);
  
@@@ -526,8 -526,7 +526,8 @@@ static void __init early_memtest(unsign
                                t_size = end - t_start;
  
                        printk(KERN_CONT "\n  %016llx - %016llx pattern %d",
 -                              t_start, t_start + t_size, pattern);
 +                              (unsigned long long)t_start,
 +                              (unsigned long long)t_start + t_size, pattern);
  
                        memtest(t_start, t_size, pattern);
  
@@@ -767,6 -766,13 +767,13 @@@ EXPORT_SYMBOL_GPL(rodata_test_data)
  void mark_rodata_ro(void)
  {
        unsigned long start = PFN_ALIGN(_stext), end = PFN_ALIGN(__end_rodata);
+       unsigned long rodata_start =
+               ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK;
+ #ifdef CONFIG_DYNAMIC_FTRACE
+       /* Dynamic tracing modifies the kernel text section */
+       start = rodata_start;
+ #endif
  
        printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",
               (end - start) >> 10);
         * The rodata section (but not the kernel text!) should also be
         * not-executable.
         */
-       start = ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK;
-       set_memory_nx(start, (end - start) >> PAGE_SHIFT);
+       set_memory_nx(rodata_start, (end - rodata_start) >> PAGE_SHIFT);
  
        rodata_test();
  
diff --combined kernel/printk.c
index e2129e83fd75b8d0c708a7c410005015e0cba564,ae7d5b9e535d98da497a3509d8597a041666c169..75ef3af39132e717a0ea905106fc454b3692ea67
@@@ -666,7 -666,7 +666,7 @@@ static int acquire_console_semaphore_fo
        return retval;
  }
  
 -const char printk_recursion_bug_msg [] =
 +static const char printk_recursion_bug_msg [] =
                        KERN_CRIT "BUG: recent printk recursion!\n";
  static int printk_recursion_bug;
  
@@@ -1041,7 -1041,9 +1041,9 @@@ void release_console_sem(void
                _log_end = log_end;
                con_start = log_end;            /* Flush */
                spin_unlock(&logbuf_lock);
+               stop_critical_timings();        /* don't trace print latency */
                call_console_drivers(_con_start, _log_end);
+               start_critical_timings();
                local_irq_restore(flags);
        }
        console_locked = 0;
diff --combined kernel/sched.c
index 94ead43eda62bf8ebb9e054d9cad2a5838fe8f90,1ffa76813a012633d5fe67f2eb8977255a95d4e0..42899dce837d6f27a5f90db3d2037c2ff0a05489
@@@ -70,6 -70,7 +70,7 @@@
  #include <linux/bootmem.h>
  #include <linux/debugfs.h>
  #include <linux/ctype.h>
+ #include <linux/ftrace.h>
  
  #include <asm/tlb.h>
  #include <asm/irq_regs.h>
@@@ -607,6 -608,24 +608,24 @@@ static inline void update_rq_clock(stru
  # define const_debug static const
  #endif
  
+ /**
+  * runqueue_is_locked
+  *
+  * Returns true if the current cpu runqueue is locked.
+  * This interface allows printk to be called with the runqueue lock
+  * held and know whether or not it is OK to wake up the klogd.
+  */
+ int runqueue_is_locked(void)
+ {
+       int cpu = get_cpu();
+       struct rq *rq = cpu_rq(cpu);
+       int ret;
+       ret = spin_is_locked(&rq->lock);
+       put_cpu();
+       return ret;
+ }
  /*
   * Debugging: various feature bits
   */
@@@ -831,7 -850,7 +850,7 @@@ static unsigned long long __cpu_clock(i
   * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
   * clock constructed from sched_clock():
   */
- unsigned long long cpu_clock(int cpu)
+ unsigned long long notrace cpu_clock(int cpu)
  {
        unsigned long long prev_cpu_time, time, delta_time;
        unsigned long flags;
@@@ -2149,6 -2168,9 +2168,9 @@@ out_activate
        success = 1;
  
  out_running:
+       trace_mark(kernel_sched_wakeup,
+               "pid %d state %ld ## rq %p task %p rq->curr %p",
+               p->pid, p->state, rq, p, rq->curr);
        check_preempt_curr(rq, p);
  
        p->state = TASK_RUNNING;
@@@ -2279,6 -2301,9 +2301,9 @@@ void wake_up_new_task(struct task_struc
                p->sched_class->task_new(rq, p);
                inc_nr_running(p, rq);
        }
+       trace_mark(kernel_sched_wakeup_new,
+               "pid %d state %ld ## rq %p task %p rq->curr %p",
+               p->pid, p->state, rq, p, rq->curr);
        check_preempt_curr(rq, p);
  #ifdef CONFIG_SMP
        if (p->sched_class->task_wake_up)
@@@ -2451,6 -2476,11 +2476,11 @@@ context_switch(struct rq *rq, struct ta
        struct mm_struct *mm, *oldmm;
  
        prepare_task_switch(rq, prev, next);
+       trace_mark(kernel_sched_schedule,
+               "prev_pid %d next_pid %d prev_state %ld "
+               "## rq %p prev %p next %p",
+               prev->pid, next->pid, prev->state,
+               rq, prev, next);
        mm = next->mm;
        oldmm = prev->active_mm;
        /*
@@@ -4021,26 -4051,44 +4051,44 @@@ void scheduler_tick(void
  #endif
  }
  
- #if defined(CONFIG_PREEMPT) && defined(CONFIG_DEBUG_PREEMPT)
+ #if defined(CONFIG_PREEMPT) && (defined(CONFIG_DEBUG_PREEMPT) || \
+                               defined(CONFIG_PREEMPT_TRACER))
+ static inline unsigned long get_parent_ip(unsigned long addr)
+ {
+       if (in_lock_functions(addr)) {
+               addr = CALLER_ADDR2;
+               if (in_lock_functions(addr))
+                       addr = CALLER_ADDR3;
+       }
+       return addr;
+ }
  
  void __kprobes add_preempt_count(int val)
  {
+ #ifdef CONFIG_DEBUG_PREEMPT
        /*
         * Underflow?
         */
        if (DEBUG_LOCKS_WARN_ON((preempt_count() < 0)))
                return;
+ #endif
        preempt_count() += val;
+ #ifdef CONFIG_DEBUG_PREEMPT
        /*
         * Spinlock count overflowing soon?
         */
        DEBUG_LOCKS_WARN_ON((preempt_count() & PREEMPT_MASK) >=
                                PREEMPT_MASK - 10);
+ #endif
+       if (preempt_count() == val)
+               trace_preempt_off(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1));
  }
  EXPORT_SYMBOL(add_preempt_count);
  
  void __kprobes sub_preempt_count(int val)
  {
+ #ifdef CONFIG_DEBUG_PREEMPT
        /*
         * Underflow?
         */
        if (DEBUG_LOCKS_WARN_ON((val < PREEMPT_MASK) &&
                        !(preempt_count() & PREEMPT_MASK)))
                return;
+ #endif
  
+       if (preempt_count() == val)
+               trace_preempt_on(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1));
        preempt_count() -= val;
  }
  EXPORT_SYMBOL(sub_preempt_count);
@@@ -5384,7 -5435,7 +5435,7 @@@ out_unlock
        return retval;
  }
  
- static const char stat_nam[] = "RSDTtZX";
+ static const char stat_nam[] = TASK_STATE_TO_CHAR_STR;
  
  void sched_show_task(struct task_struct *p)
  {
@@@ -5887,7 -5938,6 +5938,7 @@@ static void migrate_dead_tasks(unsigne
                next = pick_next_task(rq, rq->curr);
                if (!next)
                        break;
 +              next->sched_class->put_prev_task(rq, next);
                migrate_dead(dead_cpu, next);
  
        }
@@@ -8502,9 -8552,6 +8553,9 @@@ int sched_group_set_rt_period(struct ta
        rt_period = (u64)rt_period_us * NSEC_PER_USEC;
        rt_runtime = tg->rt_bandwidth.rt_runtime;
  
 +      if (rt_period == 0)
 +              return -EINVAL;
 +
        return tg_set_bandwidth(tg, rt_period, rt_runtime);
  }