1. 04 12月, 2008 9 次提交
    • S
      ftrace: use struct pid · 978f3a45
      Steven Rostedt 提交于
      Impact: clean up, extend PID filtering to PID namespaces
      
      Eric Biederman suggested using the struct pid for filtering on
      pids in the kernel. This patch is based off of a demonstration
      of an implementation that Eric sent me in an email.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      978f3a45
    • S
      pid: fix the do_each_pid_task() macro · 5ef64761
      Steven Rostedt 提交于
      Impact: macro side-effects fix
      
      This patch adds parenthesis around 'pid' in the do_each_pid_task
      macro to allow callers to pass in more complex parameters.
      
      e.g.  do_each_pid_task(*pid, type, task)
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5ef64761
    • S
      ftrace: trace single pid for function graph tracer · 804a6851
      Steven Rostedt 提交于
      Impact: New feature
      
      This patch makes the changes to set_ftrace_pid apply to the function
      graph tracer.
      
        # echo $$ > /debugfs/tracing/set_ftrace_pid
        # echo function_graph > /debugfs/tracing/current_tracer
      
      Will cause only the current task to be traced. Note, the trace flags are
      also inherited by child processes, so the children of the shell
      will also be traced.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      804a6851
    • S
      ftrace: use task struct trace flag to filter on pid · 0ef8cde5
      Steven Rostedt 提交于
      Impact: clean up
      
      Use the new task struct trace flags to determine if a process should be
      traced or not.
      
      Note: this moves the searching of the pid to the slow path of setting
      the pid field. This needs to be converted to the pid name space.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0ef8cde5
    • S
      ftrace: graph of a single function · ea4e2bc4
      Steven Rostedt 提交于
      This patch adds the file:
      
         /debugfs/tracing/set_graph_function
      
      which can be used along with the function graph tracer.
      
      When this file is empty, the function graph tracer will act as
      usual. When the file has a function in it, the function graph
      tracer will only trace that function.
      
      For example:
      
       # echo blk_unplug > /debugfs/tracing/set_graph_function
       # cat /debugfs/tracing/trace
       [...]
       ------------------------------------------
       | 2)  make-19003  =>  kjournald-2219
       ------------------------------------------
      
       2)               |  blk_unplug() {
       2)               |    dm_unplug_all() {
       2)               |      dm_get_table() {
       2)      1.381 us |        _read_lock();
       2)      0.911 us |        dm_table_get();
       2)      1. 76 us |        _read_unlock();
       2) +   12.912 us |      }
       2)               |      dm_table_unplug_all() {
       2)               |        blk_unplug() {
       2)      0.778 us |          generic_unplug_device();
       2)      2.409 us |        }
       2)      5.992 us |      }
       2)      0.813 us |      dm_table_put();
       2) +   29. 90 us |    }
       2) +   34.532 us |  }
      
      You can add up to 32 functions into this file. Currently we limit it
      to 32, but this may change with later improvements.
      
      To add another function, use the append '>>':
      
        # echo sys_read >> /debugfs/tracing/set_graph_function
        # cat /debugfs/tracing/set_graph_function
        blk_unplug
        sys_read
      
      Using the '>' will clear out the function and write anew:
      
        # echo sys_write > /debug/tracing/set_graph_function
        # cat /debug/tracing/set_graph_function
        sys_write
      
      Note, if you have function graph running while doing this, the small
      time between clearing it and updating it will cause the graph to
      record all functions. This should not be an issue because after
      it sets the filter, only those functions will be recorded from then on.
      If you need to only record a particular function then set this
      file first before starting the function graph tracer. In the future
      this side effect may be corrected.
      
      The set_graph_function file is similar to the set_ftrace_filter but
      it does not take wild cards nor does it allow for more than one
      function to be set with a single write. There is no technical reason why
      this is the case, I just do not have the time yet to implement that.
      
      Note, dynamic ftrace must be enabled for this to appear because it
      uses the dynamic ftrace records to match the name to the mcount
      call sites.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ea4e2bc4
    • I
    • I
      Merge commit 'v2.6.28-rc7' into tracing/core · b8307db2
      Ingo Molnar 提交于
      b8307db2
    • S
      ftrace: fix race in function graph during fork · e8e1abe9
      Steven Rostedt 提交于
      Impact: graph tracer race/crash fix
      
      There is a nasy race in startup of a new process running the
      function graph tracer. In fork.c:
      
      	total_forks++;
      	spin_unlock(&current->sighand->siglock);
      	write_unlock_irq(&tasklist_lock);
      	ftrace_graph_init_task(p);
      	proc_fork_connector(p);
      	cgroup_post_fork(p);
      	return p;
      
      The new task is free to run as soon as the tasklist_lock is released.
      This is before the ftrace_graph_init_task. If the task does run
      it will be using the same ret_stack and curr_ret_stack as the parent.
      This will cause crashes that are difficult to debug.
      
      This patch moves the ftrace_graph_init_task to just after the alloc_pid
      code. This fixes the above race.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e8e1abe9
    • S
      trace: fix output of stack trace · 0a37119d
      Steven Rostedt 提交于
      Impact: fix to output of stack trace
      
      If a function is not found in the stack of the stack tracer, the
      number printed is quite strange. This fixes the algorithm to handle
      missing functions better.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0a37119d
  2. 03 12月, 2008 15 次提交
  3. 02 12月, 2008 16 次提交
    • F
      tracing/function-graph-tracer: support for x86-64 · 48d68b20
      Frederic Weisbecker 提交于
      Impact: extend and enable the function graph tracer to 64-bit x86
      
      This patch implements the support for function graph tracer under x86-64.
      Both static and dynamic tracing are supported.
      
      This causes some small CPP conditional asm on arch/x86/kernel/ftrace.c I
      wanted to use probe_kernel_read/write to make the return address
      saving/patching code more generic but it causes tracing recursion.
      
      That would be perhaps useful to implement a notrace version of these
      function for other archs ports.
      
      Note that arch/x86/process_64.c is not traced, as in X86-32. I first
      thought __switch_to() was responsible of crashes during tracing because I
      believed current task were changed inside but that's actually not the
      case (actually yes, but not the "current" pointer).
      
      So I will have to investigate to find the functions that harm here, to
      enable tracing of the other functions inside (but there is no issue at
      this time, while process_64.c stays out of -pg flags).
      
      A little possible race condition is fixed inside this patch too. When the
      tracer allocate a return stack dynamically, the current depth is not
      initialized before but after. An interrupt could occur at this time and,
      after seeing that the return stack is allocated, the tracer could try to
      trace it with a random uninitialized depth. It's a prevention, even if I
      hadn't problems with it.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Tim Bird <tim.bird@am.sony.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      48d68b20
    • L
      function trace: fix a bug of single thread function trace · 66eafebc
      Liming Wang 提交于
      Impact: fix "no output from tracer" bug caused by ftrace_update_pid_func()
      
      When disabling single thread function trace using
      "echo -1 > set_ftrace_pid", the normal function trace
      has to restore to original function, otherwise the normal
      function trace will not work well.
      
      Without this commit, something like below:
      
      	$ ps |grep 850
      	  850 root      2556 S    -/bin/sh
      	$ echo 850 > /debug/tracing/set_ftrace_pid
      	$ echo function > /debug/tracing/current_tracer
      	$ echo 1 > /debug/tracing/tracing_enabled
      	$ sleep 1
      	$ echo 0 > /debug/tracing/tracing_enabled
      	$ cat /debug/tracing/trace_pipe |wc -l
      	59704
      	$ echo -1 > /debug/tracing/set_ftrace_pid
      	$ echo 1 > /debug/tracing/tracing_enabled
      	$ sleep 1
      	$ echo 0 > /debug/tracing/tracing_enabled
      	$ more /debug/tracing/trace_pipe
      		<====== nothing output now!
      			it should output trace record.
      Signed-off-by: NLiming Wang <liming.wang@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      66eafebc
    • I
      Merge branches 'tracing/branch-tracer', 'tracing/ftrace',... · 222658e0
      Ingo Molnar 提交于
      Merge branches 'tracing/branch-tracer', 'tracing/ftrace', 'tracing/function-graph-tracer', 'tracing/markers', 'tracing/powerpc', 'tracing/stack-tracer' and 'tracing/tracepoints' into tracing/core
      222658e0
    • I
      Merge branch 'tracing/urgent' into tracing/core · 74bf3cab
      Ingo Molnar 提交于
      Conflicts:
      	kernel/trace/ring_buffer.c
      74bf3cab
    • L
      Linux 2.6.28-rc7 · 061e41fd
      Linus Torvalds 提交于
      061e41fd
    • L
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 · 0d815142
      Linus Torvalds 提交于
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (25 commits)
        em28xx: remove backward compat macro added on a previous fix
        V4L/DVB (9748): em28xx: fix compile warning
        V4L/DVB (9743): em28xx: fix oops audio
        V4L/DVB (9742): em28xx-alsa: implement another locking schema
        V4L/DVB (9732): sms1xxx: use new firmware for Hauppauge WinTV MiniStick
        V4L/DVB (9691): gspca: Move the video device to a separate area.
        V4L/DVB (9690): gspca: Lock the subdrivers via module_get/put.
        V4L/DVB (9689): gspca: Memory leak when disconnect while streaming.
        V4L/DVB (9668): em28xx: fix a race condition with hald
        V4L/DVB (9664): af9015: don't reconnect device in USB-bus
        V4L/DVB (9647): em28xx: void having two concurrent control URB's
        V4L/DVB (9646): em28xx: avoid allocating/dealocating memory on every control urb
        V4L/DVB (9645): em28xx: Avoid memory leaks if registration fails
        V4L/DVB (9639): Make dib0700 remote control support work with firmware v1.20
        V4L/DVB (9635): v4l: s2255drv fix firmware test on big-endian
        V4L/DVB (9634): Make sure the i2c gate is open before powering down tuner
        V4L/DVB (9632): make em28xx aux audio input work
        V4L/DVB (9631): Make s2api work for ATSC support
        V4L/DVB (9627): em28xx: Avoid i2c register error for boards without eeprom
        V4L/DVB (9608): Fix section mismatch warning for dm1105 during make
        ...
      0d815142
    • A
      drivers/gpu/drm/i915/i915_irq.c: fix warning · 9c84ba4e
      Andrew Morton 提交于
      drivers/gpu/drm/i915/i915_irq.c: In function 'i915_disable_pipestat':
      drivers/gpu/drm/i915/i915_irq.c:101: warning: control may reach end of non-void function 'i915_pipestat' being inlined
      
      Cc: Dave Airlie <airlied@linux.ie>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9c84ba4e
    • J
      i82875p_edac: fix module remove · 09a81269
      Jarkko Lavinen 提交于
      Fix module removal bugs of i82875p_edac.  Also i82975x_edac code seems to
      have the same module removal bugs as in i82875p_edac.
      
      The problems were:
      
      1. In module removal i82875p_remove_one() is never called.
      
         Variable i82875p_registered is newer changed from 1, which
         guarantees i82875p_remove_one() is not called (and even if it were
         called, it would be called in wrong order).
      
         As a result, the edac_mc workque is not stopped and keeps probing.
         If kernel debugging options are not enabled, user may not notice
         anything going wrong.
      
         if debugging options are enabled and I do "rmmod i82875p_edac", I
         get:
      
            edac debug: edac_pci_workq_function() checking
            BUG: unable to handle kernel paging request at f882d16f
            ...
            call trace:
             [<f8834df3>] ? edac_mc_workq_function+0x55/0x7e [edac_core]
             [<c0233974>] ? run_workqueue+0xd7/0x1a5
             [<c023392f>] ? run_workqueue+0x92/0x1a5
             [<f8834d9e>] ? edac_mc_workq_function+0x0/0x7e [edac_core]
             [<c0233af9>] ? worker_thread+0xb7/0xc3
             [<c0236a7b>] ? autoremove_wake_function+0x0/0x33
             [<c0233a42>] ? worker_thread+0x0/0xc3
             [<c0236809>] ? kthread+0x3b/0x61
             [<c02367ce>] ? kthread+0x0/0x61
             [<c0204587>] ? kernel_thread_helper+0x7/0x10
      
         Fix for this is to get rid of needles variable i82875p_registered
         altogether and run i82875p_remove_one() *before*
         pci_unregister_driver().
      
      2. edac_mc_del_mc() uses mci after freeing mci
      
         edac_mc_del_mc() calls calls edac_remove_sysfs_mci_device().  The
         kobject refcount of mci drops to 0 and mci is freed.  After this
         mci is accessed via debug print and i82875p_remove_one() still
         uses mci->pvt and tries to free mci again with edac_mc_free().
      
         The fix for this is add kobject_get(&mci->edac_mci_kobj) after
         edac_mc_alloc(). Then the mci is still available after returning
         from edac_mc_del_mc() with refcount 1, and mci->pvt is still
         available. When i82875p_remove_one() finally calls edac_mc_free(),
         this will cause kobject_put() and mci is released properly.
      Signed-off-by: NJarkko Lavinen <jlavi@iki.fi>
      Cc: Doug Thompson <norsk5@yahoo.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      09a81269
    • J
      i82875p_edac: fix overflow device resource setup · 307d1144
      Jarkko Lavinen 提交于
      When I do "modprobe i82875p_edac" on my Asus P4C800 MB on kernels 2.6.26
      or later, the module load fails due to BAR 0 collision.  On 2.6.25 the
      module loads just fine.
      
      The overflow device on the MB seems to be hidden and its resources are not
      allocated at normal PCI bus init.  Log shows the missing resource problem:
      
        EDAC DEBUG: i82875p_probe1()
        PCI: 0000:00:06.0 reg 10 32bit mmio: [fecf0000, fecf0fff]
        pci 0000:00:06.0: device not available because of BAR 0
      [0xfecf0000-0xfecf0fff] collisions
        EDAC i82875p: i82875p_setup_overfl_dev(): Failed to enable overflow
      device
      
      The patch below fixes this by calling pci_bus_assign_resources() after
      the overflow device is revealed and added to the bus. With this patch
      I am again able to load and use the module.
      Signed-off-by: NJarkko Lavinen <jlavi@iki.fi>
      Cc: Doug Thompson <norsk5@yahoo.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      307d1144
    • D
      fbdev: fix FB console blanking · bca404af
      Dmitry Baryshkov 提交于
      The commit aef7db4b fixed the problem with
      recursive locking in fb blanking code if blank is caused by user setting
      the /sys/class/graphics/fb*/blank.  However this broke the fbcon timeout
      blanking.
      
      If you use a driver that defines ->fb_blank operation and at the same time
      that driver relies on other driver (e.g.  backlight or lcd class) to blank
      the screen, when the fbcon times out and tries to blank the fb, it will
      call only fb driver blanker and won't notify the other driver.  Thus FB
      output is disabled, but the screen isn't blanked.
      
      Restore fbcon blanking and at the same time apply the proper fix for the
      above problem: if fbcon_blank is called with FBINFO_FLAG_USEREVENT, we are
      already called through notification from fb_blank, thus we don't have to
      blank the fb again.
      Signed-off-by: NDmitry Baryshkov <dbaryshkov@gmail.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bca404af
    • R
      ntfs: don't fool kernel-doc · 03801553
      Randy Dunlap 提交于
      kernel-doc handles macros now (it has for quite some time), so change the
      ntfs_debug() macro's kernel-doc to be just before the macro instead of
      before a phony function prototype.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Anton Altaparmakov <aia21@cantab.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      03801553
    • R
      kernel-doc: handle varargs cleanly · ced69090
      Randy Dunlap 提交于
      The method for listing varargs in kernel-doc notation is:
       * @...: these arguments are printed by the @fmt argument
      
      but scripts/kernel-doc is confused:  it always lists varargs as:
      	...	variable arguments
      and ignores the @...: line's description, but then prints that
      line after the list of function parameters as though it's
      not part of the function parameters.
      
      This patch makes kernel-doc print the supplied @...  description if it is
      present; otherwise a boilerplate "variable arguments" is printed.
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ced69090
    • M
      lib/idr.c: fix rcu related race with idr_find · 6ff2d39b
      Manfred Spraul 提交于
      2nd part of the fixes needed for
      http://bugzilla.kernel.org/show_bug.cgi?id=11796.
      
      When the idr tree is either grown or shrunk, then the update to the number
      of layers and the top pointer were not atomic.  This race caused crashes.
      
      The attached patch fixes that by replicating the layers counter in each
      layer, thus idr_find doesn't need idp->layers anymore.
      Signed-off-by: NManfred Spraul <manfred@colorfullife.com>
      Cc: Clement Calmels <cboulte@gmail.com>
      Cc: Nadia Derbey <Nadia.Derbey@bull.net>
      Cc: Pierre Peiffer <peifferp@gmail.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6ff2d39b
    • F
      DMA-API.txt: fix description of pci_map_sg/dma_map_sg scatterlists handling · 1d678f36
      FUJITA Tomonori 提交于
      - pci_map_sg/dma_map_sg are used with a scatter gather list that doesn't
        come from the block layer (e.g.  some network drivers do).
      
      - how IOMMUs merge adjacent elements of the scatter/gather list is
        independent of how the block layer determines sees elements.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1d678f36
    • D
      frv: fix mmap2 error handling · 4280e312
      David Howells 提交于
      Fix the error handling in sys_mmap2().  Currently, if the pgoff check
      fails, fput() might have to be called (which it isn't), so do the pgoff
      check first, before fget() is called.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reported-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4280e312
    • A
      taint: add missing comment · a8005992
      Arjan van de Ven 提交于
      The description for 'D' was missing in the comment...  (causing me a
      minute of WTF followed by looking at more of the code)
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a8005992