1. 01 Apr, 2009 1 commit
    • Steven Rostedt's avatar
      function-graph: allow unregistering twice · 2aad1b76
      Steven Rostedt authored
      Impact: fix to permanent disabling of function graph tracer
      
      There should be nothing to prevent a tracer from unregistering a
      function graph callback more than once. This can simplify error paths.
      
      But currently, the counter does not account for mulitple unregistering
      of the function graph callback. If it happens, the function graph
      tracer will be permanently disabled.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      2aad1b76
  2. 31 Mar, 2009 13 commits
  3. 30 Mar, 2009 1 commit
  4. 26 Mar, 2009 1 commit
    • Tom Zanussi's avatar
      tracing: filter fix for TRACE_EVENT_FORMAT events · 9a8118ba
      Tom Zanussi authored
      Impact: fix crash (hang) when using TRACE_EVENT_FORMAT filter files
      
      filters are only hooked up to the tracepoint events defined using
      TRACE_EVENT but not the tracers that use TRACE_EVENT_FORMAT, such
      as ftrace.
      
      Do not display the filter files at all for TRACE_EVENT_FORMAT events
      for the time being.
      
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1237878882.8339.61.camel@charm-linux>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      9a8118ba
  5. 25 Mar, 2009 6 commits
  6. 24 Mar, 2009 16 commits
    • Jody McIntyre's avatar
      tracing: Documentation / sample code fixes for tracepoints · 0a5d6490
      Jody McIntyre authored
      Fix the tracepoint documentation to refer to "tracepoint-sample"
      instead of "tracepoint-example" to match what actually exists;
      fix the directory, and clarify how to compile.
      
      Change every instance of "example" in the sample tracepoint code
      to "sample" for consistency.
      Signed-off-by: default avatarJody McIntyre <scjody@sun.com>
      Acked-by: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: torvalds@linux-foundation.org
      LKML-Reference: <20090324200027.GH8294@clouds>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0a5d6490
    • Lai Jiangshan's avatar
      tracing: use union for multi-usages field · ee000b7f
      Lai Jiangshan authored
      Impact: cleanup
      
      struct dyn_ftrace::ip has different usages in his lifecycle,
      we use union for it. And also for struct dyn_ftrace::flags.
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Steven Rostedt <srostedt@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <49C871BE.3080405@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ee000b7f
    • Lai Jiangshan's avatar
      ftrace: show virtual PID · cc59c9e8
      Lai Jiangshan authored
      Impact: fix PID output under namespaces
      
      When current namespace is not the global namespace,
      pid read from set_ftrace_pid is no correct.
      
       # ~/newpid_namespace_run bash
       # echo $$
       1
       # echo 1 > set_ftrace_pid
       # cat set_ftrace_pid
       3756
      
      Since we write virtual PID to set_ftrace_pid, we need get
      virtual PID when we read it.
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Steven Rostedt <srostedt@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <49C84D65.9050606@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      cc59c9e8
    • Steven Rostedt's avatar
      function-graph: add option for include sleep times · be6f164a
      Steven Rostedt authored
      Impact: give user a choice to show times spent while sleeping
      
      The user may want to see the time a function spent sleeping.
      This patch adds the trace option "sleep-time" to allow that.
      The "sleep-time" option is default on.
      
       echo sleep-time > /debug/tracing/trace_options
      
      produces:
      
       ------------------------------------------
       2)  avahi-d-3428  =>    <idle>-0
       ------------------------------------------
      
       2)               |      finish_task_switch() {
       2)   0.621 us    |        _spin_unlock_irq();
       2)   2.202 us    |      }
       2) ! 1002.197 us |    }
       2) ! 1003.521 us |  }
      
      where as,
      
       echo nosleep-time > /debug/tracing/trace_options
      
      produces:
      
       0)    <idle>-0    =>  yum-upd-3416
       ------------------------------------------
      
       0)               |              finish_task_switch() {
       0)   0.643 us    |                _spin_unlock_irq();
       0)   2.342 us    |              }
       0) + 41.302 us   |            }
       0) + 42.453 us   |          }
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      be6f164a
    • Steven Rostedt's avatar
      function-graph: ignore times across schedule · 8aef2d28
      Steven Rostedt authored
      Impact: more accurate timings
      
      The current method of function graph tracing does not take into
      account the time spent when a task is not running. This shows functions
      that call schedule have increased costs:
      
       3) + 18.664 us   |      }
       ------------------------------------------
       3)    <idle>-0    =>  kblockd-123
       ------------------------------------------
      
       3)               |      finish_task_switch() {
       3)   1.441 us    |        _spin_unlock_irq();
       3)   3.966 us    |      }
       3) ! 2959.433 us |    }
       3) ! 2961.465 us |  }
      
      This patch uses the tracepoint in the scheduling context switch to
      account for time that has elapsed while a task is scheduled out.
      Now we see:
      
       ------------------------------------------
       3)    <idle>-0    =>  edac-po-1067
       ------------------------------------------
      
       3)               |      finish_task_switch() {
       3)   0.685 us    |        _spin_unlock_irq();
       3)   2.331 us    |      }
       3) + 41.439 us   |    }
       3) + 42.663 us   |  }
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      8aef2d28
    • Steven Rostedt's avatar
      function-graph: prevent more than one tracer registering · 05ce5818
      Steven Rostedt authored
      Impact: prevent crash due to multiple function graph tracers
      
      The function graph tracer can currently only handle a single tracer
      being registered. If another tracer registers with the function
      graph tracer it can crash the system.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      05ce5818
    • Steven Rostedt's avatar
      function-graph: moved the timestamp from arch to generic code · 5d1a03dc
      Steven Rostedt authored
      This patch move the timestamp from happening in the arch specific
      code into the general code. This allows for better control by the tracer
      to time manipulation.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      5d1a03dc
    • Steven Rostedt's avatar
      tracing: fix memory leak in trace_stat · 09833521
      Steven Rostedt authored
      If the function profiler does not have any items recorded and one were
      to cat the function stat file, the kernel would take a BUG with a NULL
      pointer dereference.
      
      Looking further into this, I found that returning NULL from stat_start
      did not stop the stat logic, and would later call stat_next. This breaks
      from the way seq_file works, so I looked into fixing the stat code.
      
      This is where I noticed that the last next_entry is never freed.
      It is allocated, and if the stat_next returns NULL, the code breaks out
      of the loop, unlocks the mutex and exits. We never link the next_entry
      nor do we free it. Thus it is a real memory leak.
      
      This patch rearranges the code a bit to not only fix the memory leak,
      but also to act more like seq_file where nothing is printed if there
      is nothing to print. That is, stat_start returns NULL.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      09833521
    • Li Zefan's avatar
      blktrace: print human-readable act_mask · 09341997
      Li Zefan authored
      Impact: new feature, allow symbolic values in /debug/tracing/act_mask
      
      Print stringified act_mask instead of hex value:
      
       # cat act_mask
       read,write,barrier,sync,queue,requeue,issue,complete,fs,pc,ahead,meta,
       discard,drv_data
       # echo "meta,write" > act_mask
       # cat act_mask
       write,meta
      
      Also:
       - make act_mask accept "ahead", "meta", "discard" and "drv_data"
       - use strsep() instead of strchr() to parse user input
       - return -EINVAL if a token is not found in the mask map
       - fix a bug that 'value' is unsigned, so it can < 0
       - propagate error value of blk_trace_mask2str() to userspace, but not
         always return -ENXIO.
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: default avatarJens Axboe <jens.axboe@oracle.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <49C8AB42.1000802@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      09341997
    • Li Zefan's avatar
      blktrace: fix t_error() · e0dc81be
      Li Zefan authored
      Impact: fix error flag output
      
      t_error() should return t->error but not t->sector.
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: default avatarJens Axboe <jens.axboe@oracle.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <49C8945F.5020802@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e0dc81be
    • Li Zefan's avatar
      blktrace: fix wrong calculation of RWBS · 65796348
      Li Zefan authored
      Impact: fix the output of IO type category characters
      
      Trace categories are the upper 16 bits, not the lower 16 bits.
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: default avatarJens Axboe <jens.axboe@oracle.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <49C89432.8010805@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      65796348
    • Li Zefan's avatar
      blktrace: mark ddir_act[] const · e4955c99
      Li Zefan authored
      Impact: cleanup
      
      ddir_act and what2act always stay immutable.
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: default avatarJens Axboe <jens.axboe@oracle.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <49C89415.5080503@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e4955c99
    • Tom Zanussi's avatar
      tracing/filters: disallow integer values for string filters and vice versa · 9f58a159
      Tom Zanussi authored
      Impact: fix filter use boundary condition / crash
      
      Make sure filters for string fields don't use integer values and vice
      versa.  Getting it wrong can crash the system or produce bogus
      results.
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1237878882.8339.61.camel@charm-linux>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      9f58a159
    • Tom Zanussi's avatar
      tracing/filters: use trace_seq_printf() to print filters · 4bda2d51
      Tom Zanussi authored
      Impact: cleanup
      
      Instead of just using the trace_seq buffer to print the filters, use
      trace_seq_printf() as it was intended to be used.
      Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1237878871.8339.59.camel@charm-linux>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      4bda2d51
    • Tom Zanussi's avatar
      tracing/filters: free pred when clearing filters · 09f1f245
      Tom Zanussi authored
      Impact: fix (small) per trace filter modification memory leak
      
      Free the current pred when clearing the filters via the filter files.
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1237878851.8339.58.camel@charm-linux>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      09f1f245
    • Tom Zanussi's avatar
      tracing/filters: use list_for_each_entry · 1fc2d5c1
      Tom Zanussi authored
      Impact: cleanup
      
      No need to use the safe version here, so use list_for_each_entry instead
      of list_for_each_entry_safe in find_event_field().
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1237878841.8339.57.camel@charm-linux>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      1fc2d5c1
  7. 23 Mar, 2009 2 commits
    • Frederic Weisbecker's avatar
      tracing/function-graph-tracer: fix functions call traces imbalance · 16185369
      Frederic Weisbecker authored
      Impact: fix traces output
      
      Sometimes one can observe an imbalance in the traces between function
      calls and function return traces:
      
      func1() {
          }
      }
      
      The curly brace inside func1() is the return of another function nested
      inside func1. The return trace have been inserted in the buffer but not
      the entry.
      We are storing a return address on the function traces stack while we
      haven't inserted its entry on the buffer, hence the imbalance on the
      traces.
      
      This is because the tracers doesn't check all failures that can happen
      on buffer insertion.
      
      This patch reports the tracing recursion failures and the ring buffer
      failures. In such cases, we now restore the original return address for
      the function, giving up its return trace.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1237843021-11695-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      16185369
    • Anton Vorontsov's avatar
      tracing: Fix TRACING_SUPPORT dependency for PPC32 · 45b95608
      Anton Vorontsov authored
      commit 40ada30f ("tracing: clean up menu"),
      despite the "clean up" in its purpose, introduced a behavioural
      change for Kconfig symbols: we no longer able to select tracing
      support on PPC32 (because IRQFLAGS_SUPPORT isn't yet implemented).
      
      The IRQFLAGS_SUPPORT is not mandatory for most tracers, tracing core
      has a special case for platforms w/o irqflags (which, by the way, has
      become useless as of the commit above).
      
      Though according to Ingo Molnar, there was periodic build failures on
      weird, unmaintained architectures that had no irqflags-tracing support
      and hence didn't know the raw_irqs_save/restore primitives. Thus we'd
      better not enable irqflags-less tracing for all architectures.
      
      This patch restores the old behaviour for PPC32, and thus brings the
      tracing back. Other architectures can either add themselves to the
      exception list or (better) implement TRACE_IRQFLAGS_SUPPORT.
      Signed-off-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
      Acked-b: Steven Rostedt <rostedt@goodmis.org>
      Cc: linuxppc-dev@ozlabs.org
      LKML-Reference: <20090323220724.GA9851@oksana.dev.rtsoft.ru>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      45b95608