1. 05 2月, 2009 2 次提交
  2. 03 2月, 2009 4 次提交
    • A
      trace: Change struct trace_event callbacks parameter list · 2c9b238e
      Arnaldo Carvalho de Melo 提交于
      Impact: API change
      
      The trace_seq and trace_entry are in trace_iterator, where there are
      more fields that may be needed by tracers, so just pass the
      tracer_iterator as is already the case for struct tracer->print_line.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2c9b238e
    • F
      trace: better manage the context info for events · c4a8e8be
      Frederic Weisbecker 提交于
      Impact: make trace_event more convenient for tracers
      
      All tracers (for the moment) that use the struct trace_event want to
      have the context info printed before their own output: the pid/cmdline,
      cpu, and timestamp.
      
      But some other tracers that want to implement their trace_event
      callbacks will not necessary need these information or they may want to
      format them as they want.
      
      This patch adds a new default-enabled trace option:
      TRACE_ITER_CONTEXT_INFO When disabled through:
      
      echo nocontext-info > /debugfs/tracing/trace_options
      
      The pid, cpu and timestamps headers will not be printed.
      
      IE with the sched_switch tracer with context-info (default):
      
           bash-2935 [001] 100.356561: 2935:120:S ==> [001]  0:140:R <idle>
         <idle>-0    [000] 100.412804:    0:140:R   + [000] 11:115:S events/0
         <idle>-0    [000] 100.412816:    0:140:R ==> [000] 11:115:R events/0
       events/0-11   [000] 100.412829:   11:115:S ==> [000]  0:140:R <idle>
      
      Without context-info:
      
       2935:120:S ==> [001]  0:140:R <idle>
          0:140:R   + [000] 11:115:S events/0
          0:140:R ==> [000] 11:115:R events/0
         11:115:S ==> [000]  0:140:R <idle>
      
      A tracer can disable it at runtime by clearing the bit
      TRACE_ITER_CONTEXT_INFO in trace_flags.
      
      The print routines were renamed to trace_print_context and
      trace_print_lat_context, so that they can be used by tracers if they
      want to use them for one of the trace_event callbacks.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c4a8e8be
    • S
      trace: let boot trace be chosen by command line · 79fb0768
      Steven Rostedt 提交于
      Now that we have a working ftrace=<tracer> function, make the boot
      tracer get activated by it. This way we can turn it on or off without
      recompiling the kernel, as well as keeping the selftests on. The
      selftests are disabled whenever a default tracer starts running.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      79fb0768
    • S
      trace: fix default boot up tracer · b2821ae6
      Steven Rostedt 提交于
      Peter Zijlstra started the functionality to start up a default
      tracing at bootup. This patch finishes the work.
      
      Now if you add 'ftrace=<tracer>' to the command line, when that tracer
      is registered on bootup, that tracer is selected and starts tracing.
      
      Note, all selftests for tracers that are registered after this tracer
      is disabled. This prevents the selftests from disturbing the running
      tracer, or the running tracer from disturbing the selftest.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b2821ae6
  3. 26 1月, 2009 1 次提交
  4. 23 1月, 2009 1 次提交
  5. 22 1月, 2009 1 次提交
  6. 21 1月, 2009 3 次提交
    • S
      trace: set max latency variable to zero on default · 1092307d
      Steven Rostedt 提交于
      Impact: trace max latencies on start of latency tracing
      
      This patch sets the max latency to zero whenever one of the
      irq variant tracers or the wakeup tracer is set to current tracer.
      
      Most developers expect to see output when starting up a latency
      tracer. But since the max_latency is already set to max, and
      it takes a latency greater than max_latency to be recorded, there
      is no trace. This is not the expected behavior and has even confused
      myself.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1092307d
    • S
      trace: stop all recording to ring buffer on ftrace_dump · a442e5e0
      Steven Rostedt 提交于
      Impact: limit ftrace dump output
      
      Currently ftrace_dump only calls ftrace_kill that is a fast way
      to prevent the function tracer functions from being called (just sets
      a flag and clears the function to call, nothing else). It is better
      to also turn off any recording to the ring buffers as well.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a442e5e0
    • S
      trace: print ftrace_dump at KERN_EMERG log level · faf6861e
      Steven Rostedt 提交于
      Impact: fix to print out ftrace_dump when expected
      
      I was debugging a hard race condition to only find out that
      after I hit the race, my log level was not at level to show
      KERN_INFO. The time it took to trigger the race was wasted because
      I did not capture the trace.
      
      Since ftrace_dump is only called from kernel oops (and only when
      it is set in the kernel command line to do so), or when a
      developer adds it to their own local tree, the log level of
      the print should be at KERN_EMERG to make sure the print appears.
      
      ftrace_dump is not called by a normal user setup, and will not
      add extra unwanted print out to the console. There is no reason
      it should be at KERN_INFO.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      faf6861e
  7. 16 1月, 2009 4 次提交
    • S
      trace: set max latency variable to zero on default · 745b1626
      Steven Rostedt 提交于
      Impact: trace max latencies on start of latency tracing
      
      This patch sets the max latency to zero whenever one of the
      irq variant tracers or the wakeup tracer is set to current tracer.
      
      Most developers expect to see output when starting up a latency
      tracer. But since the max_latency is already set to max, and
      it takes a latency greater than max_latency to be recorded, there
      is no trace. This is not the expected behavior and has even confused
      myself.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      745b1626
    • S
      ftrace: remove static from function tracer functions · a225cdd2
      Steven Rostedt 提交于
      Impact: clean up
      
      After reorganizing the functions in trace.c and trace_function.c,
      they no longer need to be in global context. This patch makes the
      functions and one variable into static.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a225cdd2
    • S
      ftrace: move function tracer functions out of trace.c · bb3c3c95
      Steven Rostedt 提交于
      Impact: clean up of trace.c
      
      The function tracer functions were put in trace.c because it needed
      to share static variables that were in trace.c.  Since then, those
      variables have become global for various reasons. This patch moves
      the function tracer functions into trace_function.c where they belong.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      bb3c3c95
    • S
      ftrace: add stack trace to function tracer · 53614991
      Steven Rostedt 提交于
      Impact: new feature to stack trace any function
      
      Chris Mason asked about being able to pick and choose a function
      and get a stack trace from it. This feature enables his request.
      
       # echo io_schedule > /debug/tracing/set_ftrace_filter
       # echo function > /debug/tracing/current_tracer
       # echo func_stack_trace > /debug/tracing/trace_options
      
      Produces the following in /debug/tracing/trace:
      
             kjournald-702   [001]   135.673060: io_schedule <-sync_buffer
             kjournald-702   [002]   135.673671:
       <= sync_buffer
       <= __wait_on_bit
       <= out_of_line_wait_on_bit
       <= __wait_on_buffer
       <= sync_dirty_buffer
       <= journal_commit_transaction
       <= kjournald
      
      Note, be careful about turning this on without filtering the functions.
      You may find that you have a 10 second lag between typing and seeing
      what you typed. This is why the stack trace for the function tracer
      does not use the same stack_trace flag as the other tracers use.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      53614991
  8. 15 1月, 2009 2 次提交
    • S
      trace: stop all recording to ring buffer on ftrace_dump · 0ee6b6cf
      Steven Rostedt 提交于
      Impact: limit ftrace dump output
      
      Currently ftrace_dump only calls ftrace_kill that is a fast way
      to prevent the function tracer functions from being called (just sets
      a flag and clears the function to call, nothing else). It is better
      to also turn off any recording to the ring buffers as well.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0ee6b6cf
    • S
      trace: print ftrace_dump at KERN_EMERG log level · 428aee14
      Steven Rostedt 提交于
      Impact: fix to print out ftrace_dump when expected
      
      I was debugging a hard race condition to only find out that
      after I hit the race, my log level was not at level to show
      KERN_INFO. The time it took to trigger the race was wasted because
      I did not capture the trace.
      
      Since ftrace_dump is only called from kernel oops (and only when
      it is set in the kernel command line to do so), or when a
      developer adds it to their own local tree, the log level of
      the print should be at KERN_EMERG to make sure the print appears.
      
      ftrace_dump is not called by a normal user setup, and will not
      add extra unwanted print out to the console. There is no reason
      it should be at KERN_INFO.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      428aee14
  9. 14 1月, 2009 1 次提交
  10. 01 1月, 2009 2 次提交
  11. 31 12月, 2008 1 次提交
  12. 29 12月, 2008 4 次提交
    • F
      tracing/ftrace: provide the base infrastructure for histogram tracing · dbd0b4b3
      Frederic Weisbecker 提交于
      Impact: extend the tracing API
      
      The goal of this patch is to normalize and make more easy the
      implementation of statistical (histogram) tracing.
      
      It implements a trace_stat file into the /debugfs/tracing directory where
      one can print a one-shot output of statistics/histogram entries.
      
      A tracer has to provide two basic iterator callbacks:
      
        stat_start() => the first entry
        stat_next(prev, idx) => the next one.
      
      Note that it is adapted for arrays or hash tables or lists.... since it
      provides a pointer to the previous entry and the current index of the
      iterator.
      
      These two callbacks are called to get a snapshot of the statistics at each
      opening of the trace_stat file because. The values are so updated between
      two "cat trace_stat". And the tracer is free to lock its datas during the
      iteration to keep consistent values.
      
      Since it is almost always interesting to sort statisticals values to
      address the problems by priority, this infrastructure provides a "sorting"
      of the stat entries too if desired. A tracer has just to provide a
      stat_cmp callback to compare two entries and the stat tracing
      infrastructure will build a sorted list of the given entries.
      
      A last callback, called stat_headers, can be implemented by a tracer to
      output headers on its trace.
      
      If one of these callbacks is changed on runtime, it just have to signal it
      to the stat tracing API by calling the init_tracer_stat() helper.
      
      Changes in V2:
      
      - Fix a memory leak if the user opens multiple times the trace_stat file
        without closing it. Now we always free our list before rebuilding it.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      dbd0b4b3
    • S
      ftrace: change trace.c to use registered events · f633cef0
      Steven Rostedt 提交于
      Impact: rework trace.c to use new event register API
      
      Almost every ftrace event has to implement its output display in
      trace.c through a different function. Some events did not handle
      all the formats (trace, latency-trace, raw, hex, binary), and
      this method does not scale well.
      
      This patch converts the format functions to use the event API to
      find the event and and print its format. Currently, we have
      a print function for trace, latency_trace, raw, hex and binary.
      A trace_nop_print is available if the event wants to avoid output
      on a particular format.
      
      Perhaps other tracers could use this in the future (like mmiotrace and
      function_graph).
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f633cef0
    • S
      ftrace: set up trace event hash infrastructure · f0868d1e
      Steven Rostedt 提交于
      Impact: simplify/generalize/refactor trace.c
      
      The trace.c file is becoming more difficult to maintain due to the
      growing number of events. There is several formats that an event may
      be printed. This patch sets up the infrastructure of an event hash to
      allow for events to register how they should be printed.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f0868d1e
    • S
      ftrace: remove obsolete print continue functionality · c47956d9
      Steven Rostedt 提交于
      Impact: cleanup, remove obsolete code
      
      Now that the ring buffer used by ftrace allows for variable length
      entries, we do not need the 'cont' feature of the buffer.  This code
      makes other parts of ftrace more complex and by removing this it
      simplifies the ftrace code.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c47956d9
  13. 19 12月, 2008 2 次提交
  14. 18 12月, 2008 1 次提交
    • T
      trace: fix task state printout · 3d9101e9
      Thomas Gleixner 提交于
      Impact: fix occasionally incorrect trace output
      
      The tracing code has interesting varieties of printing out task state.
      
      Unfortunalely only one of the instances is correct as it copies the
      code from sched.c:sched_show_task(). The others are plain wrong as
      they treatthe bitfield as an integer offset into the character
      array. Also the size check of the character array is wrong as it
      includes the trailing \0.
      
      Use a common state decoder inline which does the Right Thing.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3d9101e9
  15. 17 12月, 2008 1 次提交
    • F
      tracing/ftrace: add the printk-msg-only option · 66896a85
      Frederic Weisbecker 提交于
      Impact: display ftrace_printk messages "as is"
      
      By default, ftrace_printk() messages find their output with some other
      informations like pid, caller, ...
      Sometimes a developer just want to have the ftrace_printk left "as is", without
      other information.
      
      This is done by providing a default-off option called printk-msg-only.
      To enable it, just do `echo printk-msg-only > /debugfs/tracing/trace_options`
      
      Before the patch:
      
                 <...>-2739  [000]   145.692153: __might_sleep: I'm an ftrace_printk msg in __might_sleep
                 <...>-2739  [000]   145.692155: __might_sleep: I'm another ftrace_printk msg in __might_sleep
      
      After the patch and the printk-msg-only option enabled:
      
      I'm an ftrace_printk msg in __might_sleep
      I'm another ftrace_printk msg in __might_sleep
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      66896a85
  16. 13 12月, 2008 1 次提交
    • R
      cpumask: change cpumask_scnprintf, cpumask_parse_user, cpulist_parse, and... · 29c0177e
      Rusty Russell 提交于
      cpumask: change cpumask_scnprintf, cpumask_parse_user, cpulist_parse, and cpulist_scnprintf to take pointers.
      
      Impact: change calling convention of existing cpumask APIs
      
      Most cpumask functions started with cpus_: these have been replaced by
      cpumask_ ones which take struct cpumask pointers as expected.
      
      These four functions don't have good replacement names; fortunately
      they're rarely used, so we just change them over.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NMike Travis <travis@sgi.com>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Cc: paulus@samba.org
      Cc: mingo@redhat.com
      Cc: tony.luck@intel.com
      Cc: ralf@linux-mips.org
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: cl@linux-foundation.org
      Cc: srostedt@redhat.com
      29c0177e
  17. 12 12月, 2008 1 次提交
  18. 10 12月, 2008 1 次提交
  19. 08 12月, 2008 3 次提交
  20. 05 12月, 2008 2 次提交
  21. 04 12月, 2008 2 次提交
    • F
      tracing/function-graph-tracer: handle ftrace_printk entries · 1fd8f2a3
      Frederic Weisbecker 提交于
      Handle the TRACE_PRINT entries from the function grapg tracer
      and output them as a C comment just below the function that called
      it, as if it was a comment inside this function.
      
      Example with an ftrace_printk inside might_sleep() function:
      
      void __might_sleep(char *file, int line)
      {
      	static unsigned long prev_jiffy;	/* ratelimiting */
      
      	ftrace_printk("Hi I'm a comment in might_sleep() :-)");
      
      A chunk of a resulting trace:
      
       0)               |        _reiserfs_free_block() {
       0)               |          reiserfs_read_bitmap_block() {
       0)               |            __bread() {
       0)               |              __getblk() {
       0)               |                __find_get_block() {
       0)   0.698 us    |                  mark_page_accessed();
       0)   2.267 us    |                }
       0)               |                __might_sleep() {
       0)               |                  /* Hi I'm a comment in might_sleep() :-) */
       0)   1.321 us    |                }
       0)   5.872 us    |              }
       0)   7.313 us    |            }
       0)   8.718 us    |          }
      
      And this patch brings two minor fixes:
      
      - The newline after a switch-out task has disappeared
      - The "|" sign just before the cpu number on task-switch has been deleted.
      
       0)   0.616 us    |                pick_next_task_rt();
       0)   1.457 us    |                _spin_trylock();
       0)   0.653 us    |                _spin_unlock();
       0)   0.728 us    |                _spin_trylock();
       0)   0.631 us    |                _spin_unlock();
       0)   0.729 us    |                native_load_sp0();
       0)   0.593 us    |                native_load_tls();
       ------------------------------------------
       0)    cat-2834    =>   migrati-3
       ------------------------------------------
      
       0)               |    finish_task_switch() {
       0)   0.841 us    |      _spin_unlock_irq();
       0)   0.616 us    |      post_schedule_rt();
       0)   3.882 us    |    }
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1fd8f2a3
    • S
      ftrace: trace single pid for function graph tracer · 804a6851
      Steven Rostedt 提交于
      Impact: New feature
      
      This patch makes the changes to set_ftrace_pid apply to the function
      graph tracer.
      
        # echo $$ > /debugfs/tracing/set_ftrace_pid
        # echo function_graph > /debugfs/tracing/current_tracer
      
      Will cause only the current task to be traced. Note, the trace flags are
      also inherited by child processes, so the children of the shell
      will also be traced.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      804a6851