25 Nov, 2008

9 commits


24 Nov, 2008

6 commits

  • Impact: fix build failure on llvm-gcc-4.2

    According to the gcc manual, the 'used' attribute should be applied to
    functions referenced only from inline assembly.
    This fixes a build failure with llvm-gcc-4.2, which deleted
    __mutex_lock_slowpath, __mutex_unlock_slowpath.

    Signed-off-by: Török Edwin
    Signed-off-by: Ingo Molnar

    Török Edwin
     
  • Impact: use standard docbook tags

    Reported-by: Randy Dunlap
    Signed-off-by: Török Edwin
    Signed-off-by: Ingo Molnar

    Török Edwin
     
  • Impact: avoid losing some traces when a task is freed

    do_exit() is not the last function called when a task finishes.
    There are still some functions which are to be called such as
    ree_task(). So we delay the freeing of the return stack to the
    last moment.

    Signed-off-by: Frederic Weisbecker
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     
  • Impact: update documentation

    Update to reflect the current state of the tracing framework:

    - "none" tracer has been replaced by "nop" tracer
    - tracing_enabled must be toggled when changing buffer size

    Signed-off-by: Pekka Paalanen
    Signed-off-by: Ingo Molnar

    Pekka Paalanen
     
  • Impact: fix mmiotrace overrun tracing

    When ftrace framework moved to use the ring buffer facility, the buffer
    overrun detection was broken after 2.6.27 by commit

    | commit 3928a8a2d98081d1bc3c0a84a2d70e29b90ecf1c
    | Author: Steven Rostedt
    | Date: Mon Sep 29 23:02:41 2008 -0400
    |
    | ftrace: make work with new ring buffer
    |
    | This patch ports ftrace over to the new ring buffer.

    The detection is now fixed by using the ring buffer API.

    When mmiotrace detects a buffer overrun, it will report the number of
    lost events. People reading an mmiotrace log must know if something was
    missed, otherwise the data may not make sense.

    Signed-off-by: Pekka Paalanen
    Acked-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Pekka Paalanen
     
  • Impact: fix a crash

    While I killed the cat process, I got sometimes the following (but rare)
    crash:

    [ 65.689027] Pid: 2969, comm: cat Not tainted (2.6.28-rc6-tip #83) AMILO Li 2727
    [ 65.689027] EIP: 0060:[] EFLAGS: 00010082 CPU: 1
    [ 65.689027] EIP is at 0x0
    [ 65.689027] EAX: 00000000 EBX: f66cd780 ECX: c019a64a EDX: f66cd780
    [ 65.689027] ESI: 00000286 EDI: f66cd780 EBP: f630be2c ESP: f630be24
    [ 65.689027] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
    [ 65.689027] Process cat (pid: 2969, ti=f630a000 task=f66cd780 task.ti=f630a000)
    [ 65.689027] Stack:
    [ 65.689027] 00000012 f630bd54 f630be7c c012c853 00000000 c0133cc9 f66cda54 f630be5c
    [ 65.689027] f630be68 f66cda54 f66cd88c f66cd878 f7070000 00000001 f630be90 c0135dbc
    [ 65.689027] f614a614 f630be68 f630be68 f65ba200 00000002 f630bf10 f630be90 c012cad6
    [ 65.689027] Call Trace:
    [ 65.689027] [] ? do_exit+0x603/0x850
    [ 65.689027] [] ? next_signal+0x9/0x40
    [ 65.689027] [] ? dequeue_signal+0x8c/0x180
    [ 65.689027] [] ? do_group_exit+0x36/0x90
    [ 65.689027] [] ? get_signal_to_deliver+0x20c/0x390
    [ 65.689027] [] ? do_notify_resume+0x99/0x8b0
    [ 65.689027] [] ? tty_ldisc_deref+0x5a/0x80
    [ 65.689027] [] ? trace_hardirqs_on+0xb/0x10
    [ 65.689027] [] ? tty_ldisc_deref+0x5a/0x80
    [ 65.689027] [] ? n_tty_write+0x0/0x340
    [ 65.689027] [] ? redirected_tty_write+0x82/0x90
    [ 65.689027] [] ? vfs_write+0x99/0xd0
    [ 65.689027] [] ? redirected_tty_write+0x0/0x90
    [ 65.689027] [] ? sys_write+0x42/0x70
    [ 65.689027] [] ? work_notifysig+0x13/0x19
    [ 65.689027] Code: Bad EIP value.
    [ 65.689027] EIP: [] 0x0 SS:ESP 0068:f630be24

    This is because on do_exit(), kfree is called to free the return addresses stack
    but kfree is traced and stored its return address in this stack.
    This patch fixes it.

    Signed-off-by: Frederic Weisbecker
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     

23 Nov, 2008

25 commits

  • …dt/linux-2.6-trace into tracing/powerpc

    Ingo Molnar
     
  • Impact: fix race

    vma->vm_file reference is only stable while holding the mmap_sem,
    so move usage of it to within the critical section.

    Signed-off-by: Ingo Molnar

    Török Edwin
     
  • Impact: cleanup

    User stack tracing is just implemented for x86, but it is not x86 specific.

    Introduce a generic config flag, that is currently enabled only for x86.
    When other arches implement it, they will have to
    SELECT USER_STACKTRACE_SUPPORT.

    Signed-off-by: Török Edwin
    Signed-off-by: Ingo Molnar

    Török Edwin
     
  • Impact: fix refcounting/object-access bug

    Hold mmap_sem while looking up/accessing vma.
    Hold the RCU lock while using the task we looked up.

    Signed-off-by: Török Edwin
    Signed-off-by: Ingo Molnar

    Török Edwin
     
  • Impact: cleanup

    Signed-off-by: Török Edwin
    Signed-off-by: Ingo Molnar

    Török Edwin
     
  • Impact: fix compiler warning

    The ftrace_pointers used in the branch profiler are constant values.
    They should never change. But the compiler complains when they are
    passed into the debugfs_create_file as a data pointer, because the
    function discards the qualifier.

    This patch typecasts the parameter to debugfs_create_file back to
    a void pointer. To remind the callbacks that they are pointing to
    a constant value, I also modified the callback local pointers to
    be const struct ftrace_pointer * as well.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     
  • Impact: add new API to disable all of ftrace on anomalies

    It case of a serious anomaly being detected (like something caught by
    lockdep) it is a good idea to disable all tracing immediately, without
    grabing any locks.

    This patch adds ftrace_off_permanent that disables the tracers, function
    tracing and ring buffers without a way to enable them again. This should
    only be used when something serious has been detected.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     
  • Impact: feature to permanently disable ring buffer

    This patch adds a API to the ring buffer code that will permanently
    disable the ring buffer from ever recording. This should only be
    called when some serious anomaly is detected, and the system
    may be in an unstable state. When that happens, shutting down the
    recording to the ring buffers may be appropriate.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     
  • Impact: extend scripts/recordmcount.pl to ARM

    Arm uses %progbits instead of @progbits and requires only 4 byte alignment.

    [ Thanks to Sam Ravnborg for mentioning that ARM uses %progbits ]

    Signed-off-by: Jim Radford
    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Jim Radford
     
  • Impact: extend scripts/recordmcount.pl with default alignment for SH

    Set $alignment=2 for the sh architecture so that a ".align 2" directive
    will be emitted for all __mcount_loc sections. Fix a whitspace error
    while I'm here (converted spaces to tabs).

    Signed-off-by: Matt Fleming
    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Matt Fleming
     
  • Impact: feature to profile if statements

    This patch adds a branch profiler for all if () statements.
    The results will be found in:

    /debugfs/tracing/profile_branch

    For example:

    miss hit % Function File Line
    ------- --------- - -------- ---- ----
    0 1 100 x86_64_start_reservations head64.c 127
    0 1 100 copy_bootdata head64.c 69
    1 0 0 x86_64_start_kernel head64.c 111
    32 0 0 set_intr_gate desc.h 319
    1 0 0 reserve_ebda_region head.c 51
    1 0 0 reserve_ebda_region head.c 47
    0 1 100 reserve_ebda_region head.c 42
    0 0 X maxcpus main.c 165

    Miss means the branch was not taken. Hit means the branch was taken.
    The percent is the percentage the branch was taken.

    This adds a significant amount of overhead and should only be used
    by those analyzing their system.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     
  • Impact: cleanup on output of branch profiler

    When a branch has not been taken, it does not make sense to show
    a percentage incorrect or hit. This patch changes the behaviour
    to print out a 'X' when the branch has not been executed yet.

    For example:

    correct incorrect % Function File Line
    ------- --------- - -------- ---- ----
    2096 0 0 do_arch_prctl process_64.c 832
    0 0 X do_arch_prctl process_64.c 804
    2604 0 0 IS_ERR err.h 34
    130228 5765 4 __switch_to process_64.c 673
    0 0 X enable_TSC process_64.c 448
    0 0 X disable_TSC process_64.c 431

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     
  • Impact: clean up to make one profiler of like and unlikely tracer

    The likely and unlikely profiler prints out the file and line numbers
    of the annotated branches that it is profiling. It shows the number
    of times it was correct or incorrect in its guess. Having two
    different files or sections for that matter to tell us if it was a
    likely or unlikely is pretty pointless. We really only care if
    it was correct or not.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     
  • Impact: clean up of branch check

    The unlikely/likely profiler does an extra assign of the f.line.
    This is not needed since it is already calculated at compile time.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     
  • Impact: cleanup of recordmcount.pl

    Now that more architectures are being ported to the MCOUNT_RECORD
    method, there is no reason to have each declare their own arch
    specific variable if most of them share the same value. This patch
    creates a set of default values for the arch specific variables
    based off of i386.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     
  • Impact: Add PowerPC port to recordmcount.pl script

    This patch updates the recordmcount.pl script to process
    PowerPC.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     
  • First cut at dynamic ftrace support.

    [
    Steven Rostedt - only updated the recordmcount.pl file.
    There are updates for PowerPC that will conflict with this,
    and we need to base off of these changes.
    ]

    Signed-off-by: Matt Fleming
    Signed-off-by: Paul Mundt
    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Matt Fleming
     
  • Impact: fix initcall debug output on non-scalar ktime platforms (32-bit embedded)

    The initcall_debug code access the tv64 member of ktime. This won't work
    correctly for large deltas on platforms that don't use the scalar ktime
    implementation.

    Signed-off-by: Will Newton
    Acked-by: Tim Bird
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar

    Will Newton
     
  • Impact: widen function-tracing to suspend+resume (and hibernation) sequences

    Now that the ftrace kernel thread is gone, we can allow tracing
    during suspend/resume again.

    So revert these two commits:

    f42ac38c5 "ftrace: disable tracing for suspend to ram"
    41108eb10 "ftrace: disable tracing for hibernation"

    This should be tested very carefully, as it could interact with
    altneratives instruction patching, etc.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Impact: modify+improve the userstacktrace tracing visualization feature

    Store thread group leader id, and use it to lookup the address in the
    process's map. We could have looked up the address on thread's map,
    but the thread might not exist by the time we are called. The process
    might not exist either, but if you are reading trace_pipe, that is
    unlikely.

    Example usage:

    mount -t debugfs nodev /sys/kernel/debug
    cd /sys/kernel/debug/tracing
    echo userstacktrace >iter_ctrl
    echo sym-userobj >iter_ctrl
    echo sched_switch >current_tracer
    echo 1 >tracing_enabled
    cat trace_pipe >/tmp/trace&
    .... run application ...
    echo 0 >tracing_enabled
    cat /tmp/trace

    You'll see stack entries like:

    /lib/libpthread-2.7.so[+0xd370]

    You can convert them to function/line using:

    addr2line -fie /lib/libpthread-2.7.so 0xd370

    Or:

    addr2line -fie /usr/lib/debug/libpthread-2.7.so 0xd370

    For non-PIC/PIE executables this won't work:

    a.out[+0x73b]

    You need to run the following: addr2line -fie a.out 0x40073b
    (where 0x400000 is the default load address of a.out)

    Signed-off-by: Török Edwin
    Signed-off-by: Ingo Molnar

    Török Edwin
     
  • Impact: expose new VFS API

    make mangle_path() available, as per the suggestions of Christoph Hellwig
    and Al Viro:

    http://lkml.org/lkml/2008/11/4/338

    Signed-off-by: Török Edwin
    Signed-off-by: Ingo Molnar

    Török Edwin
     
  • Impact: add new (default-off) tracing visualization feature

    Usage example:

    mount -t debugfs nodev /sys/kernel/debug
    cd /sys/kernel/debug/tracing
    echo userstacktrace >iter_ctrl
    echo sched_switch >current_tracer
    echo 1 >tracing_enabled
    .... run application ...
    echo 0 >tracing_enabled

    Then read one of 'trace','latency_trace','trace_pipe'.

    To get the best output you can compile your userspace programs with
    frame pointers (at least glibc + the app you are tracing).

    Signed-off-by: Török Edwin
    Signed-off-by: Ingo Molnar

    Török Edwin
     
  • Impact: cleanup

    Eliminate #ifdefs in core code by using empty inline functions.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Impact: use deeper function tracing depth safely

    Some tests showed that function return tracing needed a more deeper depth
    of function calls. But it could be unsafe to store these return addresses
    to the stack.

    So these arrays will now be allocated dynamically into task_struct of current
    only when the tracer is activated.

    Typical scheme when tracer is activated:
    - allocate a return stack for each task in global list.
    - fork: allocate the return stack for the newly created task
    - exit: free return stack of current
    - idle init: same as fork

    I chose a default depth of 50. I don't have overruns anymore.

    Signed-off-by: Frederic Weisbecker
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     
  • Ingo Molnar