1. 08 May, 2009 4 commits
  2. 07 May, 2009 11 commits
    • Steven Rostedt's avatar
      ring-buffer: change WARN_ON from checking preempt_count to preemptible · 74f4fd21
      Steven Rostedt authored
      
      
      There's a WARN_ON in the ring buffer code that makes sure preemption
      is disabled. It checks "!preempt_count()". But when CONFIG_PREEMPT is not
      enabled, preempt_count() is always zero, and this will trigger the warning.
      
      [ Impact: prevent false warning on non preemptible kernels ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      74f4fd21
    • 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
  3. 06 May, 2009 16 commits
  4. 05 May, 2009 9 commits
    • Steven Rostedt's avatar
      ring-buffer: add benchmark and tester · 5092dbc9
      Steven Rostedt authored
      
      
      This patch adds code that can benchmark the ring buffer as well as
      test it. This code can be compiled into the kernel (not recommended)
      or as a module.
      
      A separate ring buffer is used to not interfer with other users, like
      ftrace. It creates a producer and a consumer (option to disable creation
      of the consumer) and will run for 10 seconds, then sleep for 10 seconds
      and then repeat.
      
      While running, the producer will write 10 byte loads into the ring
      buffer with just putting in the current CPU number. The reader will
      continually try to read the buffer. The reader will alternate from reading
      the buffer via event by event, or by full pages.
      
      The output is a pr_info, thus it will fill up the syslogs.
      
        Starting ring buffer hammer
        End ring buffer hammer
        Time:     9000349 (usecs)
        Overruns: 12578640
        Read:     5358440  (by events)
        Entries:  0
        Total:    17937080
        Missed:   0
        Hit:      17937080
        Entries per millisec: 1993
        501 ns per entry
        Sleeping for 10 secs
        Starting ring buffer hammer
        End ring buffer hammer
        Time:     9936350 (usecs)
        Overruns: 0
        Read:     28146644  (by pages)
        Entries:  74
        Total:    28146718
        Missed:   0
        Hit:      28146718
        Entries per millisec: 2832
        353 ns per entry
        Sleeping for 10 secs
      
      Time:      is the time the test ran
      Overruns:  the number of events that were overwritten and not read
      Read:      the number of events read (either by pages or events)
      Entries:   the number of entries left in the buffer
                       (the by pages will only read full pages)
      Total:     Entries + Read + Overruns
      Missed:    the number of entries that failed to write
      Hit:       the number of entries that were written
      
      The above example shows that it takes ~353 nanosecs per entry when
      there is a reader, reading by pages (and no overruns)
      
      The event by event reader slowed the producer down to 501 nanosecs.
      
      [ Impact: see how changes to the ring buffer affect stability and performance ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      5092dbc9
    • Steven Rostedt's avatar
      ring-buffer: move big if statement down · aa20ae84
      Steven Rostedt authored
      
      
      In the hot path of the ring buffer "__rb_reserve_next" there's a big
      if statement that does not even return back to the work flow.
      
      	code;
      
      	if (cross to next page) {
      
      		[ lots of code ]
      
      		return;
      	}
      
      	more code;
      
      The condition is even the unlikely path, although we do not denote it
      with an unlikely because gcc is fine with it. The condition is true when
      the write crosses a page boundary, and we need to start at a new page.
      
      Having this if statement makes it hard to read, but calling another
      function to do the work is also not appropriate, because we are using a lot
      of variables that were set before the if statement, and we do not want to
      send them as parameters.
      
      This patch changes it to a goto:
      
      	code;
      
      	if (cross to next page)
      		goto next_page;
      
      	more code;
      
      	return;
      
      next_page:
      
      	[ lots of code]
      
      This makes the code easier to understand, and a bit more obvious.
      
      The output from gcc is practically identical. For some reason, gcc decided
      to use different registers when I switched it to a goto. But other than that,
      the logic is the same.
      
      [ Impact: easier to read code ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      aa20ae84
    • Linus Torvalds's avatar
      Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 · 413f81eb
      Linus Torvalds authored
      * 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
        drm/r128: fix r128 ioremaps to use ioremap_wc.
        drm: cleanup properly in drm_get_dev() failure paths
        drm: clean the map list before destroying the hash table
        drm: remove unreachable code in drm_sysfs.c
        drm: add control node checks missing from kms merge
        drm/kms: don't try to shortcut drm mode set function
        drm/radeon: bump minor version for occlusion queries support
      413f81eb
    • Steven Rostedt's avatar
      tracing: use proper export symbol for tracing api · 94487d6d
      Steven Rostedt authored
      
      
      When adding the EXPORT_SYMBOL to some of the tracing API, I accidently
      used EXPORT_SYMBOL instead of EXPORT_SYMBOL_GPL. This patch fixes
      that mistake.
      
      [ Impact: export the tracing code only for GPL modules ]
      Reported-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      94487d6d
    • Tim Abbott's avatar
      ftrace: use .sched.text, not .text.sched in recordmcount.pl · 31b6e76e
      Tim Abbott authored
      
      
      The only references in the kernel to the .text.sched section are in
      recordmcount.pl.  Since the code it has is intended to be example code
      it should refer to real kernel sections.  So change it to .sched.text
      instead.
      
      [ Impact: consistency in comments ]
      Signed-off-by: default avatarTim Abbott <tabbott@mit.edu>
      LKML-Reference: <1241136371-10768-1-git-send-email-tabbott@mit.edu>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      31b6e76e
    • Dave Airlie's avatar
      drm/r128: fix r128 ioremaps to use ioremap_wc. · 42beefc0
      Dave Airlie authored
      
      
      This should allow r128 to start working again since PAT changes.
      
      taken from F-11 kernel.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      42beefc0
    • Linus Torvalds's avatar
      Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 · 899ad580
      Linus Torvalds authored
      * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
        [IA64] xen_domu_defconfig: fix build issues/warnings
      899ad580
    • Mel Gorman's avatar
      Ignore madvise(MADV_WILLNEED) for hugetlbfs-backed regions · a425a638
      Mel Gorman authored
      
      
      madvise(MADV_WILLNEED) forces page cache readahead on a range of memory
      backed by a file.  The assumption is made that the page required is
      order-0 and "normal" page cache.
      
      On hugetlbfs, this assumption is not true and order-0 pages are
      allocated and inserted into the hugetlbfs page cache.  This leaks
      hugetlbfs page reservations and can cause BUGs to trigger related to
      corrupted page tables.
      
      This patch causes MADV_WILLNEED to be ignored for hugetlbfs-backed
      regions.
      Signed-off-by: default avatarMel Gorman <mel@csn.ul.ie>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a425a638
    • Steven Rostedt's avatar
      ring-buffer: disable writers when resetting buffers · 41ede23e
      Steven Rostedt authored
      
      
      As a precaution, it is best to disable writing to the ring buffers
      when reseting them.
      
      [ Impact: prevent weird things if write happens during reset ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      41ede23e