1. 13 9月, 2009 4 次提交
    • J
      ftrace: __start_mcount_loc should be .init.rodata · 4b3b4c5e
      John Reiser 提交于
      __start_mcount_loc[] is unused after init, yet occupies RAM forever
      as part of .rodata.  152kiB is typical on a 64-bit architecture.  Instead,
      __start_mcount_loc should be in the interval [__init_begin, __init_end)
      so that the space is reclaimed after init.
      
      __start_mcount_loc[] is generated during the load portion
      of kernel build, and is used only by ftrace_init().  ftrace_init is declared
      '__init' and is in .init.text, which is freed after init.
      __start_mcount_loc is placed into .rodata by a call to MCOUNT_REC inside
      the RO_DATA macro of include/asm-generic/vmlinux.lds.h.  The array *is*
      read-only, but more importantly it is not used after init.  So the call to
      MCOUNT_REC should be moved from RO_DATA to INIT_DATA.
      
      This patch has been tested on x86_64 with CONFIG_DEBUG_PAGEALLOC=y
      which verifies that the address range never is accessed after init.
      Signed-off-by: NJohn Reiser <jreiser@BitWagon.com>
      LKML-Reference: <4A6DF0B6.7080402@bitwagon.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      4b3b4c5e
    • C
      tracing: do not update tracing_max_latency when tracer is stopped · b5130b1e
      Carsten Emde 提交于
      The state of the function pair tracing_stop()/tracing_start() is
      correctly considered when tracer data are updated. However, the global
      and externally accessible variable tracing_max_latency is always updated
      - even when tracing is stopped.
      
      The update should only occur, if tracing was not stopped.
      Signed-off-by: NCarsten Emde <C.Emde@osadl.org>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      b5130b1e
    • C
      tracing: remove unused local variables in tracer probe functions · 41dfba43
      Carsten Emde 提交于
      When the nsecs_to_usecs() conversion in probe_wakeup_sched_switch() and
      check_critical_timing() was moved to a later stage in order to avoid
      unnecessary computing, it was overlooked to remove the original
      variables, assignments and comments..
      Signed-off-by: NCarsten Emde <C.Emde@osadl.org>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      41dfba43
    • C
      tracing: prevent NULL pointer dereference in ftrace_raw_event_block_bio_bounce · fe63b94a
      Carsten Emde 提交于
      Booting 2.6.31 and executing
         echo 1 >/sys/kernel/debug/tracing/events/enable
      leads to
      BUG: unable to handle kernel NULL pointer dereference at (null)
      IP: [<c032a583>] ftrace_raw_event_block_bio_bounce+0x4b/0xb9
      
      Apparently,
         bio = bio_map_user(q, NULL, uaddr, len, reading, gfp_mask);
      is called in block/blk-map.c:58 where bio->bi_bdev in set to NULL and
      still is NULL when an attempt is made to evaluate bio->bi_bdev->bd_dev
      in include/trace/events/block.h:189.
      
      The tracepoint should ensure bio->bi_bdev is not dereferenced, if NULL.
      Signed-off-by: NCarsten Emde <C.Emde@osadl.org>
      LKML-Reference: <4AAAC9B1.9060505@osadl.org>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      fe63b94a
  2. 12 9月, 2009 5 次提交
  3. 11 9月, 2009 3 次提交
    • S
      tracing: move tgid out of generic entry and into userstack · 48659d31
      Steven Rostedt 提交于
      The userstack trace required the recording of the tgid entry.
      Unfortunately, it was added to the generic entry where it wasted
      4 bytes of every entry and was only used by one entry.
      
      This patch moves it out of the generic field and moves it into the
      only user (userstack_entry).
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      48659d31
    • S
      tracing: add latency format to function_graph tracer · 49ff5903
      Steven Rostedt 提交于
      While debugging something with the function_graph tracer, I found the
      need to see the preempt count of the traces. Unfortunately, since
      the function graph tracer has its own output formatting, it does not
      honor the latency-format option.
      
      This patch makes the function_graph tracer honor the latency-format
      option, but still keeps control of the output. But now we have the
      same details that the latency-format supplies.
      
       # tracer: function_graph
       #
       #      _-----=> irqs-off
       #     / _----=> need-resched
       #    | / _---=> hardirq/softirq
       #    || / _--=> preempt-depth
       #    ||| /
       #    ||||
       # CPU||||  DURATION                  FUNCTION CALLS
       # |  ||||   |   |                     |   |   |   |
        3)  d..1  1.333 us    |        idle_cpu();
        3)  d.h1              |        tick_check_idle() {
        3)  d.h1  0.550 us    |          tick_check_oneshot_broadcast();
        3)  d.h1              |          tick_nohz_stop_idle() {
        3)  d.h1              |            ktime_get() {
        3)  d.h1              |              ktime_get_ts() {
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      49ff5903
    • S
      x86/tracing: comment need for atomic nop · fc06b852
      Steven Rostedt 提交于
      The dynamic function tracer relys on the macro P6_NOP5 always being
      an atomic NOP. If for some reason it is changed to be two operations
      (like a nop2 nop3) it can faults within the kernel when the function
      tracer modifies the code.
      
      This patch adds a comment to note that the P6_NOPs are expected to
      be atomic. This will hopefully prevent anyone from changing that.
      Reported-by: NMathieu Desnoyer <mathieu.desnoyers@polymtl.ca>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      fc06b852
  4. 10 9月, 2009 6 次提交
  5. 06 9月, 2009 22 次提交