1. 12 5月, 2009 6 次提交
  2. 11 5月, 2009 2 次提交
    • L
      blktrace: from-sector redundant in trace_block_remap, cleanup · 79c5d3ce
      Li Zefan 提交于
      The last argument of block_remap prober is the original sector
      before remap, so it should be 'from', not 'to'.
      
      [ Impact: clean up ]
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: "Alan D. Brunelle" <Alan.Brunelle@hp.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      LKML-Reference: <4A07CE86.5090301@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      79c5d3ce
    • L
      blktrace: pdu_buf of pc events should be unsigned · 04986257
      Li Zefan 提交于
      I got this:
        8,0    1   305.417782332  2037  I   R 32 (ffffff9e 10 00 ...) [bash]
      
      It should be:
        8,0    1   305.417782332  2037  I   R 32 (9e 10 00 ...) [bash]
      
      [ Impact: fix output of pc events ]
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <4A07C6B3.9080802@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      04986257
  3. 09 5月, 2009 2 次提交
  4. 08 5月, 2009 6 次提交
  5. 07 5月, 2009 14 次提交
    • S
      tracing: append ":*" to internal setting of system events · d6bf81ef
      Steven Rostedt 提交于
      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: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      d6bf81ef
    • S
      ring-buffer: remove complex calculations in ring-buffer-test · 29c8000e
      Steven Rostedt 提交于
      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: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      29c8000e
    • I
      Merge branch 'tracing/hw-branch-tracing' into tracing/core · 0ad5d703
      Ingo Molnar 提交于
      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: NIngo Molnar <mingo@elte.hu>
      0ad5d703
    • I
      Merge branch 'linus' into tracing/core · 44347d94
      Ingo Molnar 提交于
      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: NIngo Molnar <mingo@elte.hu>
      44347d94
    • L
      tracing/events: fix concurrent access to ftrace_events list, fix · d94fc523
      Li Zefan 提交于
      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: NLi 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: NIngo Molnar <mingo@elte.hu>
      d94fc523
    • F
      tracing/filters: support for operator reserved characters in strings · 5928c3cc
      Frederic Weisbecker 提交于
      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: NFrederic Weisbecker <fweisbec@gmail.com>
      5928c3cc
    • F
      tracing/filters: support for filters of dynamic sized arrays · e8808c10
      Frederic Weisbecker 提交于
      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: NFrederic Weisbecker <fweisbec@gmail.com>
      e8808c10
    • S
      tracing: add hierarchical enabling of events · 8ae79a13
      Steven Rostedt 提交于
      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: NSteven Rostedt <rostedt@goodmis.org>
      8ae79a13
    • S
      tracing: reset ring buffer when removing modules with events · 9456f0fa
      Steven Rostedt 提交于
      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: NLi Zefan <lizf@cn.fujitsu.com>
      LKML-Reference: <49FEAFD0.30106@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      9456f0fa
    • S
      tracing: update sample with TRACE_INCLUDE_FILE · 71e1c8ac
      Steven Rostedt 提交于
      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: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      71e1c8ac
    • S
      ring-buffer: change test to be more latency friendly · 3e07a4f6
      Steven Rostedt 提交于
      The ring buffer benchmark/test runs a producer for 10 seconds.
      This is done with preemption and interrupts enabled. But if the kernel
      is not compiled with CONFIG_PREEMPT, it basically stops everything
      but interrupts for 10 seconds.
      
      Although this is just a test and is not for production, this attribute
      can be quite annoying. It can also spawn badness elsewhere.
      
      This patch solves the issues by calling "cond_resched" when the system
      is not compiled with CONFIG_PREEMPT. It also keeps track of the time
      spent to call cond_resched such that it does not go against the
      time calculations. That is, if the task schedules away, the time scheduled
      out is removed from the test data. Note, this only works for non PREEMPT
      because we do not know when the task is scheduled out if we have PREEMPT
      enabled.
      
      [ Impact: prevent test from stopping the world for 10 seconds ]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      3e07a4f6
    • S
      ring-buffer: make moving the tail page a separate function · 6634ff26
      Steven Rostedt 提交于
      Ingo Molnar thought the code would be cleaner if we used a function call
      instead of a goto for moving the tail page. After implementing this,
      it seems that gcc still inlines the result and the output is pretty much
      the same. Since this is considered a cleaner approach, might as well
      implement it.
      
      [ Impact: code clean up ]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      6634ff26
    • S
      ring-buffer: check for failed allocation in ring buffer benchmark · 00c81a58
      Steven Rostedt 提交于
      The result of the allocation of the ring buffer read page in the
      ring buffer bench mark does not check the return to see if a page
      was actually allocated. This patch fixes that.
      
      [ Impact: avoid NULL dereference ]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      00c81a58
    • S
      ring-buffer: remove unneeded conditional in rb_reserve_next · 8e7abf1c
      Steven Rostedt 提交于
      The code in __rb_reserve_next checks on page overflow if it is the
      original commiter and then resets the page back to the original
      setting.  Although this is fine, and the code is correct, it is
      a bit fragil. Some experimental work I did breaks it easily.
      
      The better and more robust solution is to have all commiters that
      overflow the page, simply subtract what they added.
      
      [ Impact: more robust ring buffer account management ]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      8e7abf1c
  6. 06 5月, 2009 10 次提交