1. 15 May, 2009 4 commits
  2. 12 May, 2009 3 commits
  3. 11 May, 2009 6 commits
  4. 08 May, 2009 5 commits
  5. 07 May, 2009 13 commits
    • Steven Rostedt's avatar
      ring-buffer: add total count in ring-buffer-benchmark · 7da3046d
      Steven Rostedt authored
      It is nice to see the overhead of the benchmark test when tracing is
      disabled. That is, we turn off the ring buffer just to see what the
      cost of running the loop that calls into the ring buffer is.
      
      Currently, if no entries wer made, we get 0. This is not informative.
      This patch changes it to check if we had any "missed" (non recorded)
      events. If so, a total count is also reported.
      
      [ Impact: evaluate the over head of the ring buffer benchmark test ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      7da3046d
    • Steven Rostedt's avatar
      ring-buffer: only periodically call cond_resched to ring-buffer-benchmark · 0574ea42
      Steven Rostedt authored
      Calling cond_resched at every iteration of the loop adds a bit of
      overhead to the benchmark.
      
      This patch does two things.
      
      1) only calls cond-resched when CONFIG_PREEMPT is not enabled
      2) only calls cond-resched after so many traces has been performed.
      
      [ Impact: less overhead to the ring-buffer-benchmark ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      0574ea42
    • Steven Rostedt's avatar
      tracing: have menu default enabled when kernel debug is configured · 65b77242
      Steven Rostedt authored
      Tracing can be very helpful to debug the kernel. When DEBUG_KERNEL is
      enabled it is nice to enable the trace menu as well.
      
      This patch only make the tracing menu enabled by default, it does not
      make any of the tracers enabled. And the menu is only enabled by
      default if DEBUG_KERNEL is enabled.
      
      [ Impact: show tracing options to those debugging the kernel ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      65b77242
    • Steven Rostedt's avatar
      tracing: append ":*" to internal setting of system events · d6bf81ef
      Steven Rostedt authored
      The system enabling of events uses the same code as the set_event file.
      It passes in the name of the system to the parser and that will enable
      all the events that has that system as a name.
      
      The problem is that it will also enable events with the same name as the
      system.
      
      If you have system name foo, and system name bar, but within the system
      bar, there exists an event called foo. By setting the system name foo,
      you will also be enabling the event foo in the system bar. This is not
      an expected result.
      
      The solution is to pass in "foo:*", which will only enable the system
      foo and not events called foo.
      
      [ Impact: prevent accidental enabling of events with same name as a system ]
      Reported-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      d6bf81ef
    • Steven Rostedt's avatar
      ring-buffer: remove complex calculations in ring-buffer-test · 29c8000e
      Steven Rostedt authored
      Ingo Molnar thought that the code to calculate the time in cond_resched
      is a bit too ugly and is not needed. This patch removes it and replaces
      it with a simple call to cond_resched. I kept the comment that explains
      the reason for the cond_resched.
      
      [ Impact: remove ugly code ]
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      29c8000e
    • Ingo Molnar's avatar
      Merge branch 'tracing/hw-branch-tracing' into tracing/core · 0ad5d703
      Ingo Molnar authored
      Merge reason: this topic is ready for upstream now. It passed
                    Oleg's review and Andrew had no further mm/*
                    objections/observations either.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0ad5d703
    • Ingo Molnar's avatar
      Merge branch 'linus' into tracing/core · 44347d94
      Ingo Molnar authored
      Merge reason: tracing/core was on a .30-rc1 base and was missing out on
                    on a handful of tracing fixes present in .30-rc5-almost.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      44347d94
    • Li Zefan's avatar
      tracing/events: fix concurrent access to ftrace_events list, fix · d94fc523
      Li Zefan authored
      In filter_add_subsystem_pred() we should release event_mutex before
      calling filter_free_subsystem_preds(), since both functions hold
      event_mutex.
      
      [ Impact: fix deadlock when writing invalid pred into subsystem filter ]
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Cc: tzanussi@gmail.com
      Cc: a.p.zijlstra@chello.nl
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      LKML-Reference: <4A028993.7020509@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d94fc523
    • Frederic Weisbecker's avatar
      tracing/filters: support for operator reserved characters in strings · 5928c3cc
      Frederic Weisbecker authored
      When we set a filter for an event, such as:
      
      echo "name == my_lock_name" > \
      	/debug/tracing/events/lockdep/lock_acquired/filter
      
      then the following order of token type is parsed:
      
      - space
      - operator
      - parentheses
      - operand
      
      Because the operators and parentheses have a higher precedence
      than the operand characters, which is normal, then we can't
      use any string containing such special characters:
      
      ()=<>!&|
      
      To get this support and also avoid ambiguous intepretation from
      the parser or the human, we can do it using double quotes so that
      we keep the usual languages habits.
      
      Then after this patch you can still declare string condition like
      before:
      
      echo name == myname
      
      But if you want to compare against a string containing an operator
      character, you can use double quotes:
      
      echo 'name == "&myname"'
      
      Don't forget to include the whole expression into single quotes or
      the double ones will be eaten by echo.
      
      [ Impact: support strings with special characters for tracing filters ]
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Zhaolei <zhaolei@cn.fujitsu.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      5928c3cc
    • Frederic Weisbecker's avatar
      tracing/filters: support for filters of dynamic sized arrays · e8808c10
      Frederic Weisbecker authored
      Currently the filtering infrastructure supports well the
      numeric types and fixed sized array types.
      
      But the recently added __string() field uses a specific
      indirect offset mechanism which requires a specific
      predicate. Until now it wasn't supported.
      
      This patch adds this support and implies very few changes,
      only a new predicate is needed, the management of this specific
      field can be done through the usual string helpers in the
      filtering infrastructure.
      
      [ Impact: support all kinds of strings in the tracing filters ]
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Zhaolei <zhaolei@cn.fujitsu.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      e8808c10
    • Steven Rostedt's avatar
      tracing: add hierarchical enabling of events · 8ae79a13
      Steven Rostedt authored
      With the current event directory, you can only enable individual events.
      The file debugfs/tracing/set_event is used to be able to enable or
      disable several events at once. But that can still be awkward.
      
      This patch adds hierarchical enabling of events. That is, each directory
      in debugfs/tracing/events has an "enable" file. This file can enable
      or disable all events within the directory and below.
      
       # echo 1 > /debugfs/tracing/events/enable
      
      will enable all events.
      
       # echo 1 > /debugfs/tracing/events/sched/enable
      
      will enable all events in the sched subsystem.
      
       # echo 1 > /debugfs/tracing/events/enable
       # echo 0 > /debugfs/tracing/events/irq/enable
      
      will enable all events, but then disable just the irq subsystem events.
      
      When reading one of these enable files, there are four results:
      
       0 - all events this file affects are disabled
       1 - all events this file affects are enabled
       X - there is a mixture of events enabled and disabled
       ? - this file does not affect any event
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      8ae79a13
    • Steven Rostedt's avatar
      tracing: reset ring buffer when removing modules with events · 9456f0fa
      Steven Rostedt authored
      Li Zefan found that there's a race using the event ids of events and
      modules. When a module is loaded, an event id is incremented. We only
      have 16 bits for event ids (65536) and there is a possible (but highly
      unlikely) race that we could load and unload a module that registers
      events so many times that the event id counter overflows.
      
      When it overflows, it then restarts and goes looking for available
      ids. An id is available if it was added by a module and released.
      
      The race is if you have one module add an id, and then is removed.
      Another module loaded can use that same event id. But if the old module
      still had events in the ring buffer, the new module's call back would
      get bogus data.  At best (and most likely) the output would just be
      garbage. But if the module for some reason used pointers (not recommended)
      then this could potentially crash.
      
      The safest thing to do is just reset the ring buffer if a module that
      registered events is removed.
      
      [ Impact: prevent unpredictable results of event id overflows ]
      Reported-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      LKML-Reference: <49FEAFD0.30106@cn.fujitsu.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      9456f0fa
    • Steven Rostedt's avatar
      tracing: update sample with TRACE_INCLUDE_FILE · 71e1c8ac
      Steven Rostedt authored
      When creating trace events for ftrace, the header file with the TRACE_EVENT
      macros must also have a macro called TRACE_SYSTEM. This macro describes
      the name of the system the TRACE_EVENTS are defined for. It also doubles
      as a way for the define_trace.h file to include the file that included
      it.
      
      For example:
      
      in irq.h
      
       #define TRACE_SYSTEM irq
      
      [...]
      
       #include <trace/define_trace.h>
      
      The define_trace will use TRACE_SYSTEM to include irq.h. But if the name
      of the trace system does not match the name of the trace header file,
      one can override it with:
      
      Which will change define_trace.h to inclued foo_trace.h instead of foo.h
      
      The sample comments this, but people that use the sample code will more
      likely use the code and not read the comments. This patch changes the
      sample code to use the TRACE_INCLUDE_FILE to better show developers how to
      use it.
      
      [ Impact: make sample less confusing to developers ]
      Reported-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      71e1c8ac
  6. 06 May, 2009 9 commits