]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge branches 'tracing/ftrace', 'tracing/fastboot', 'tracing/nmisafe' and 'tracing...
authorIngo Molnar <mingo@elte.hu>
Sat, 8 Nov 2008 08:34:35 +0000 (09:34 +0100)
committerIngo Molnar <mingo@elte.hu>
Sat, 8 Nov 2008 08:34:35 +0000 (09:34 +0100)
1  2  3 
arch/x86/Kconfig
arch/x86/mm/Makefile
include/linux/ftrace.h
kernel/trace/ring_buffer.c
kernel/trace/trace.c

Simple merge
Simple merge
index 7a75fc6d41f42ba87b0f2ab43976d9aedd78b3be,1b340e3fa249d4231f05f56bdd959aaafac4c0e7,703eb53cfa2b2a1512b7ce97d9c1da218ad9ac0f..1f5608c11023b8dff949eaed7e7fa6da9f001065
@@@@ -214,11 -182,8 -181,6 +212,11 @@@@ static inline void __ftrace_enabled_res
   #endif
   
   #ifdef CONFIG_TRACING
  +extern int ftrace_dump_on_oops;
  +
 ++extern void tracing_start(void);
 ++extern void tracing_stop(void);
 ++
   extern void
   ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
   
index a2dea5008826bc65fed9249ae416b13a531374e6,cedf4e2682855000f28c7f5ddbe3a8fabd2bc0d2,3f338063864628a3ae42f0269018388062132a1a..6781e9aab2c09a2655cc58f5c40e4392a0eba3a1
@@@@ -1526,11 -1532,10 -1547,23 +1541,24 @@@@ rb_get_reader_page(struct ring_buffer_p
   {
        struct buffer_page *reader = NULL;
        unsigned long flags;
++      int nr_loops = 0;
   
 --     spin_lock_irqsave(&cpu_buffer->lock, flags);
 ++     local_irq_save(flags);
 ++     __raw_spin_lock(&cpu_buffer->lock);
   
    again:
++      /*
++       * This should normally only loop twice. But because the
++       * start of the reader inserts an empty page, it causes
++       * a case where we will loop three times. There should be no
++       * reason to loop four times (that I know of).
++       */
++      if (unlikely(++nr_loops > 3)) {
++              RB_WARN_ON(cpu_buffer, 1);
++              reader = NULL;
++              goto out;
++      }
++ 
        reader = cpu_buffer->reader_page;
   
        /* If there's more to read, return this page */
index ff1e9ed9b5879314850dcd3dc6e5d68ca20c38da,e4c40c868d67fb0f3028d5bf2ef3f806b23ab62f,974973e39e87058816a0052f29350b25dd02f130..d55ccfc8d67451abfedadbe606a095774447260e
@@@@ -71,36 -62,38 -62,7 +71,36 @@@@ static cpumask_t __read_mostly             tracing
   #define for_each_tracing_cpu(cpu)    \
        for_each_cpu_mask(cpu, tracing_buffer_mask)
   
 --static int tracing_disabled = 1;
 - 
  +/*
  + * ftrace_dump_on_oops - variable to dump ftrace buffer on oops
  + *
  + * If there is an oops (or kernel panic) and the ftrace_dump_on_oops
  + * is set, then ftrace_dump is called. This will output the contents
  + * of the ftrace buffers to the console.  This is very useful for
  + * capturing traces that lead to crashes and outputing it to a
  + * serial console.
  + *
  + * It is default off, but you can enable it with either specifying
  + * "ftrace_dump_on_oops" in the kernel command line, or setting
  + * /proc/sys/kernel/ftrace_dump_on_oops to true.
  + */
  +int ftrace_dump_on_oops;
  +
  +static int tracing_set_tracer(char *buf);
  +
  +static int __init set_ftrace(char *str)
  +{
  +     tracing_set_tracer(str);
  +     return 1;
  +}
  +__setup("ftrace", set_ftrace);
  +
  +static int __init set_ftrace_dump_on_oops(char *str)
  +{
  +     ftrace_dump_on_oops = 1;
  +     return 1;
  +}
  +__setup("ftrace_dump_on_oops", set_ftrace_dump_on_oops);
   
   long
   ns2usecs(cycle_t nsec)