Skip to content
  1. May 26, 2009
    • Zhaolei's avatar
      ftrace: Add task_comm support for trace_event · b11c53e1
      Zhaolei authored
      
      
      If we enable a trace event alone without any tracer running (such as
      function tracer, sched switch tracer, etc...) it can't output enough
      task command information.
      
      We need to use the tracing_{start/stop}_cmdline_record() helpers
      which are designed to keep track of cmdlines for any tasks that
      were scheduled during the tracing.
      
      Before this patch:
       # echo 1 > debugfs/tracing/events/sched/sched_switch/enable
       # cat debugfs/tracing/trace
       # tracer: nop
       #
       #           TASK-PID    CPU#    TIMESTAMP  FUNCTION
       #              | |       |          |         |
                  <...>-2289  [000] 526276.724790: sched_switch: task bash:2289 [120] ==> sshd:2287 [120]
                  <...>-2287  [000] 526276.725231: sched_switch: task sshd:2287 [120] ==> bash:2289 [120]
                  <...>-2289  [000] 526276.725452: sched_switch: task bash:2289 [120] ==> sshd:2287 [120]
                  <...>-2287  [000] 526276.727181: sched_switch: task sshd:2287 [120] ==> swapper:0 [140]
                 <idle>-0     [000] 526277.032734: sched_switch: task swapper:0 [140] ==> events/0:5 [115]
                  <...>-5     [000] 526277.032782: sched_switch: task events/0:5 [115] ==> swapper:0 [140]
       ...
      
      After this patch:
       # tracer: nop
       #
       #           TASK-PID    CPU#    TIMESTAMP  FUNCTION
       #              | |       |          |         |
                   bash-2269  [000] 527347.989229: sched_switch: task bash:2269 [120] ==> sshd:2267 [120]
                   sshd-2267  [000] 527347.990960: sched_switch: task sshd:2267 [120] ==> bash:2269 [120]
                   bash-2269  [000] 527347.991143: sched_switch: task bash:2269 [120] ==> sshd:2267 [120]
                   sshd-2267  [000] 527347.992959: sched_switch: task sshd:2267 [120] ==> swapper:0 [140]
                 <idle>-0     [000] 527348.531989: sched_switch: task swapper:0 [140] ==> events/0:5 [115]
               events/0-5     [000] 527348.532115: sched_switch: task events/0:5 [115] ==> swapper:0 [140]
       ...
      
      Changelog:
      v1->v2: Update Kconfig to select CONTEXT_SWITCH_TRACER in
              ENABLE_EVENT_TRACING
      v2->v3: v2 can solve problem that was caused by config EVENT_TRACING
              alone, but when CONFIG_FTRACE is off and CONFIG_TRACING is
              selected by other config, compile fail happened again.
              This version solves it.
      
      [ Impact: fix incomplete output of event tracing ]
      
      Signed-off-by: default avatarZhao Lei <zhaolei@cn.fujitsu.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <4A14FDFE.2080402@cn.fujitsu.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      b11c53e1
    • Pekka Enberg's avatar
      kmemtrace: fix kernel parameter documentation · 29fcefba
      Pekka Enberg authored
      
      
      The kmemtrace.enable kernel parameter no longer works. To enable
      kmemtrace at boot-time, you must pass "ftrace=kmemtrace" instead.
      
      [ Impact: remove obsolete kernel parameter documentation ]
      
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
      LKML-Reference: <alpine.DEB.2.00.0905241112190.10296@rocky>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      29fcefba
    • Li Zefan's avatar
      tracing/events: change the type of __str_loc_item to unsigned short · b0aae68c
      Li Zefan authored
      
      
      When defining a dynamic size string, we add __str_loc_##item to the
      trace entry, and it stores the location of the actual string in
      entry->_str_data[]
      
      'unsigned short' should be sufficient to store this information, thus
      we save 2 bytes per dyn-size string in the ring buffer.
      
      [ Impact: reduce memory occupied by dyn-size strings in ring buffer ]
      
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <4A14EDB6.2050507@cn.fujitsu.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      b0aae68c
    • Lai Jiangshan's avatar
      tracing: add trace_event_read_lock() · 4f535968
      Lai Jiangshan authored
      
      
      I found that there is nothing to protect event_hash in
      ftrace_find_event(). Rcu protects the event hashlist
      but not the event itself while we use it after its extraction
      through ftrace_find_event().
      
      This lack of a proper locking in this spot opens a race
      window between any event dereferencing and module removal.
      
      Eg:
      
      --Task A--
      
      print_trace_line(trace) {
        event = find_ftrace_event(trace)
      
      --Task B--
      
      trace_module_remove_events(mod) {
        list_trace_events_module(ev, mod) {
          unregister_ftrace_event(ev->event) {
            hlist_del(ev->event->node)
              list_del(....)
          }
        }
      }
      |--> module removed, the event has been dropped
      
      --Task A--
      
        event->print(trace); // Dereferencing freed memory
      
      If the event retrieved belongs to a module and this module
      is concurrently removed, we may end up dereferencing a data
      from a freed module.
      
      RCU could solve this, but it would add latency to the kernel and
      forbid tracers output callbacks to call any sleepable code.
      So this fix converts 'trace_event_mutex' to a read/write semaphore,
      and adds trace_event_read_lock() to protect ftrace_find_event().
      
      [ Impact: fix possible freed memory dereference in ftrace ]
      
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <4A114806.7090302@cn.fujitsu.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      4f535968
  2. May 21, 2009
  3. May 19, 2009
    • Stefan Raspl's avatar
      blktrace: remove debugfs entries on bad path · fd51d251
      Stefan Raspl authored
      
      
      debugfs directory entries for devices are not removed on some
      of the failure pathes in do_blk_trace_setup().
      One way to reproduce is to start blktrace on multiple devices
      with insufficient Vmalloc space: Devices will fail with
      a message like this:
      
      	BLKTRACESETUP(2) /dev/sdu failed: 5/Input/output error
      
      If so, the respective entries in debugfs
      (e.g. /sys/kernel/debug/block/sdu) will remain and subsequent
      attempts to start blktrace on the respective devices will not
      succeed due to existing directories.
      
      [ Impact: fix /debug/tracing file cleanup corner case ]
      
      Signed-off-by: default avatarStefan Raspl <stefan.raspl@linux.vnet.ibm.com>
      Acked-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: schwidefsky@de.ibm.com
      Cc: heiko.carstens@de.ibm.com
      LKML-Reference: <4A1266CC.5040801@linux.vnet.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      fd51d251
    • Li Zefan's avatar
      tracing/events: Documentation updates · 143c145e
      Li Zefan authored
      
      
      - fix some typos
      - document the difference between '>' and '>>'
      - document the 'enable' toggle
      - remove section "Defining an event-enabled tracepoint", since it's
        out-dated and sample/trace_events/ already serves this purpose.
      
      v2: add "Updated by Li Zefan"
      
      [ Impact: make documentation up-to-date ]
      
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      LKML-Reference: <4A125503.5060406@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      143c145e
  4. May 18, 2009
  5. May 16, 2009
  6. May 15, 2009
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 5d41343a
      Linus Torvalds authored
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: Fix race in ext4_inode_info.i_cached_extent
        ext4: Clear the unwritten buffer_head flag after the extent is initialized
        ext4: Use a fake block number for delayed new buffer_head
        ext4: Fix sub-block zeroing for writes into preallocated extents
      5d41343a
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 · c244450d
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
        ASoC: DaVinci EVM board support buildfixes
        ASoC: DaVinci I2S updates
        ASoC: davinci-pcm buildfixes
        ALSA: pcsp: fix printk format warning
        ALSA: riptide: postfix increment and off by one
        pxa2xx-ac97: fix reset gpio mode setting
        ASoC: soc-core: fix crash when removing not instantiated card
      c244450d
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb · ade385e4
      Linus Torvalds authored
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
        kgdb: gdb documentation fix
        kgdb,i386: use address that SP register points to in the exception frame
        sysrq, intel_fb: fix sysrq g collision
      ade385e4
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block · c6538499
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
        Revert "mm: add /proc controls for pdflush threads"
        viocd: needs to depend on BLOCK
        block: fix the bio_vec array index out-of-bounds test
      c6538499
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · 662f11cf
      Linus Torvalds authored
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc: Fix PCI ROM access
        powerpc/pseries: Really fix the oprofile CPU type on pseries
        serial/nwpserial: Fix wrong register read address and add interrupt acknowledge.
        powerpc/cell: Make ptcal more reliable
        powerpc: Allow mem=x cmdline to work with 4G+
        powerpc/mpic: Fix incorrect allocation of interrupt rev-map
        powerpc: Fix oprofile sampling of marked events on POWER7
        powerpc/iseries: Fix pci breakage due to bad dma_data initialization
        powerpc: Fix mktree build error on Mac OS X host
        powerpc/virtex: Fix duplicate level irq events.
        powerpc/virtex: Add uImage to the default images list
        powerpc/boot: add simpleImage.* to clean-files list
        powerpc/8xx: Update defconfigs
        powerpc/embedded6xx: Update defconfigs
        powerpc/86xx: Update defconfigs
        powerpc/85xx: Update defconfigs
        powerpc/83xx: Update defconfigs
        powerpc/fsl_soc: Remove mpc83xx_wdt_init, again
      662f11cf
    • Sukadev Bhattiprolu's avatar
      devpts: correctly set default options · 1f71ebed
      Sukadev Bhattiprolu authored
      
      
      devpts_get_sb() calls memset(0) to clear mount options and calls
      parse_mount_options() if user specified any mount options.
      
      The memset(0) is bogus since the 'mode' and 'ptmxmode' options are
      non-zero by default.  parse_mount_options() restores options to default
      anyway and can properly deal with NULL mount options.
      
      So in devpts_get_sb() remove memset(0) and call parse_mount_options() even
      for NULL mount options.
      
      Bug reported by Eric Paris: http://lkml.org/lkml/2009/5/7/448.
      
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@us.ibm.com>
      Tested-by: default avatarMarc Dionne <marc.c.dionne@gmail.com>
      Reported-by: default avatarEric Paris <eparis@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Reviewed-by: default avatar"H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1f71ebed
    • Takashi Iwai's avatar
      Merge branch 'fix/asoc' into for-linus · 60befb97
      Takashi Iwai authored
      * fix/asoc:
        ASoC: DaVinci EVM board support buildfixes
        ASoC: DaVinci I2S updates
        ASoC: davinci-pcm buildfixes
        pxa2xx-ac97: fix reset gpio mode setting
        ASoC: soc-core: fix crash when removing not instantiated card
      60befb97
    • Takashi Iwai's avatar
      Merge branch 'fix/misc' into for-linus · a3d2b755
      Takashi Iwai authored
      * fix/misc:
        ALSA: pcsp: fix printk format warning
        ALSA: riptide: postfix increment and off by one
      a3d2b755
    • Theodore Ts'o's avatar
      ext4: Fix race in ext4_inode_info.i_cached_extent · 2ec0ae3a
      Theodore Ts'o authored
      
      
      If two CPU's simultaneously call ext4_ext_get_blocks() at the same
      time, there is nothing protecting the i_cached_extent structure from
      being used and updated at the same time.  This could potentially cause
      the wrong location on disk to be read or written to, including
      potentially causing the corruption of the block group descriptors
      and/or inode table.
      
      This bug has been in the ext4 code since almost the very beginning of
      ext4's development.  Fortunately once the data is stored in the page
      cache cache, ext4_get_blocks() doesn't need to be called, so trying to
      replicate this problem to the point where we could identify its root
      cause was *extremely* difficult.  Many thanks to Kevin Shanahan for
      working over several months to be able to reproduce this easily so we
      could finally nail down the cause of the corruption.
      
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatar"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      2ec0ae3a
    • Frank Rowand's avatar
      kgdb: gdb documentation fix · d34a792d
      Frank Rowand authored
      
      
      gdb command "set remote debug 1" is not valid, change to correct command.
      
      Signed-off-by: default avatarFrank Rowand <frank.rowand@am.sony.com>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      d34a792d
    • Jason Wessel's avatar
      kgdb,i386: use address that SP register points to in the exception frame · 33ab1979
      Jason Wessel authored
      
      
      The treatment of the SP register is different on x86_64 and i386.
      This is a regression fix that lived outside the mainline kernel from
      2.6.27 to now.  The regression was a result of the original merge
      consolidation of the i386 and x86_64 archs to x86.
      
      The incorrectly reported SP on i386 prevented stack tracebacks from
      working correctly in gdb.
      
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      33ab1979
    • Jason Wessel's avatar
      sysrq, intel_fb: fix sysrq g collision · 364b5b7b
      Jason Wessel authored
      Commit 79e53945
      
       introduced a
      regression where you cannot use sysrq 'g' to enter kgdb.  The solution
      is to move the intel fb sysrq over to V for video instead of G for
      graphics.  The SMP VOYAGER code to register for the sysrq-v is not
      anywhere to be found in the mainline kernel, so the comments in the
      code were cleaned up as well.
      
      This patch also cleans up the sysrq definitions for kgdb to make it
      generic for the kernel debugger, such that the sysrq 'g' can be used
      in the future to enter a gdbstub or another kernel debugger.
      
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Acked-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      364b5b7b
    • Jens Axboe's avatar
      Revert "mm: add /proc controls for pdflush threads" · cd17cbfd
      Jens Axboe authored
      This reverts commit fafd688e
      
      .
      
      Work is progressing to switch away from pdflush as the process backing
      for flushing out dirty data. So it seems pointless to add more knobs
      to control pdflush threads. The original author of the patch did not
      have any specific use cases for adding the knobs, so we can easily
      revert this before 2.6.30 to avoid having to maintain this API
      forever.
      
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      cd17cbfd
    • David Brownell's avatar
      ASoC: DaVinci EVM board support buildfixes · f492ec9f
      David Brownell authored
      
      
      This is a build fix, resyncing the DaVinci EVM ASoC board code
      with the version in the DaVinci tree.  That resync includes
      support for the DM355 EVM, although that board isn't yet in
      mainline.
      
      (NOTE:  also includes a bugfix to the platform_add_resources
      call, recently sent by Chaithrika U S <chaithrika@ti.com> but
      not yet merged into the DaVinci tree.)
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      f492ec9f
    • David Brownell's avatar
      ASoC: DaVinci I2S updates · a62114cb
      David Brownell authored
      
      
      This resyncs the DaVinci I2S code with the version in the DaVinci
      tree.  The behavioral change uses updated clock interfaces which
      recently merged to mainline.  Two other changes include adding a
      comment on the ASP/McBSP/McASP confusion, and dropping pdev->id in
      order to support more boards than just the DM644x EVM.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      a62114cb
    • David Brownell's avatar
      ASoC: davinci-pcm buildfixes · 82075af6
      David Brownell authored
      
      
      This is a buildfix for the DaVinci PCM code, resyncing it with
      the version in the DaVinci tree.  The notable change is using
      current EDMA interfaces, which recently merged to mainline.
      (The older interfaces never made it into mainline.)
      
      NOTE:  open issue, the DMA should be to/from SRAM; see chip
      errata for more info.  The artifacts are extremely easy to
      hear on DM355 hardware (not yet supported in mainline), but
      don't seem as audible on DM6446 hardwaare (which does have
      mainline support).
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      82075af6
    • Benjamin Herrenschmidt's avatar
      powerpc: Fix PCI ROM access · ad892a63
      Benjamin Herrenschmidt authored
      
      
      A couple of issues crept in since about 2.6.27 related to accessing PCI
      device ROMs on various powerpc machines.
      
      First, historically, we don't allocate the ROM resource in the resource
      tree. I'm not entirely certain of why, I susepct they often contained
      garbage on x86 but it's hard to tell. This causes the current generic
      code to always call pci_assign_resource() when trying to access the said
      ROM from sysfs, which will try to re-assign some new address regardless
      of what the ROM BAR was already set to at boot time. This can be a
      problem on hypervisor platforms like pSeries where we aren't supposed
      to move PCI devices around (and in fact probably can't).
      
      Second, our code that generates the PCI tree from the OF device-tree
      (instead of doing config space probing) which we mostly use on pseries
      at the moment, didn't set the (new) flag IORESOURCE_SIZEALIGN on any
      resource. That means that any attempt at re-assigning such a resource
      with pci_assign_resource() would fail due to resource_alignment()
      returning 0.
      
      This fixes this by doing these two things:
      
       - The code that calculates resource flags based on the OF device-node
      is improved to set IORESOURCE_SIZEALIGN on any valid BAR, and while at
      it also set IORESOURCE_READONLY for ROMs since we were lacking that too
      
       - We now allocate ROM resources as part of the resource tree. However
      to limit the chances of nasty conflicts due to busted firmwares, we
      only do it on the second pass of our two-passes allocation scheme,
      so that all valid and enabled BARs get precedence.
      
      This brings pSeries back the ability to access PCI ROMs via sysfs (and
      thus initialize various video cards from X etc...).
      
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ad892a63
    • Benjamin Herrenschmidt's avatar
      powerpc/pseries: Really fix the oprofile CPU type on pseries · b173f03d
      Benjamin Herrenschmidt authored
      
      
      My previous pach for fixing the oprofile CPU type got somewhat mismerged
      (by my fault) when it collided with another related patch. This should
      finally (fingers crossed) fix the whole thing.
      
      We make sure we keep the -old- oprofile type and CPU type whenever
      one of them was specified in the first pass through the function.
      
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b173f03d
    • Benjamin Krill's avatar
      serial/nwpserial: Fix wrong register read address and add interrupt acknowledge. · 951c4df5
      Benjamin Krill authored
      
      
      The receive interrupt routine checks the wrong register if the
      receive fifo is empty. Further an explicit interrupt acknowledge
      write is introduced. In some circumstances another interrupt was
      issued.
      
      Signed-off-by: default avatarBenjamin Krill <ben@codiert.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      951c4df5