10 Mar, 2010

1 commit

  • Events that trigger overflows by interrupting a context can
    use get_irq_regs() or task_pt_regs() to retrieve the state
    when the event triggered. But this is not the case for some
    other class of events like trace events as tracepoints are
    executed in the same context than the code that triggered
    the event.

    It means we need a different api to capture the regs there,
    namely we need a hot snapshot to get the most important
    informations for perf: the instruction pointer to get the
    event origin, the frame pointer for the callchain, the code
    segment for user_mode() tests (we always use __KERNEL_CS as
    trace events always occur from the kernel) and the eflags
    for further purposes.

    v2: rename perf_save_regs to perf_fetch_caller_regs as per
    Masami's suggestion.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Steven Rostedt
    Cc: Arnaldo Carvalho de Melo
    Cc: Masami Hiramatsu
    Cc: Jason Baron
    Cc: Archs

    Frederic Weisbecker
     

17 Dec, 2009

1 commit

  • The current print_context_stack helper that does the stack
    walking job is good for usual stacktraces as it walks through
    all the stack and reports even addresses that look unreliable,
    which is nice when we don't have frame pointers for example.

    But we have users like perf that only require reliable
    stacktraces, and those may want a more adapted stack walker, so
    lets make this function a callback in stacktrace_ops that users
    can tune for their needs.

    Signed-off-by: Frederic Weisbecker
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     

14 Apr, 2009

1 commit


03 Dec, 2008

1 commit

  • Impact: better dumpstack output

    I noticed in my crash dumps and even in the stack tracer that a
    lot of functions listed in the stack trace are simply
    return_to_handler which is ftrace graphs way to insert its own
    call into the return of a function.

    But we lose out where the actually function was called from.

    This patch adds in hooks to the dumpstack mechanism that detects
    this and finds the real function to print. Both are printed to
    let the user know that a hook is still in place.

    This does give a funny side effect in the stack tracer output:

    Depth Size Location (80 entries)
    ----- ---- --------
    0) 4144 48 save_stack_trace+0x2f/0x4d
    1) 4096 128 ftrace_call+0x5/0x2b
    2) 3968 16 mempool_alloc_slab+0x16/0x18
    3) 3952 384 return_to_handler+0x0/0x73
    4) 3568 -240 stack_trace_call+0x11d/0x209
    5) 3808 144 return_to_handler+0x0/0x73
    6) 3664 -128 mempool_alloc+0x4d/0xfe
    7) 3792 128 return_to_handler+0x0/0x73
    8) 3664 -32 scsi_sg_alloc+0x48/0x4a [scsi_mod]

    As you can see, the real functions are now negative. This is due
    to them not being found inside the stack.

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

    Steven Rostedt
     

28 Oct, 2008

1 commit

  • Impact: cleanup

    As promised, now that dumpstack_32 and dumpstack_64 have so many bits
    in common, we should merge the in-sync bits into a common file, to
    prevent them from diverging again.

    This patch removes bits which are common between dumpstack_32.c and
    dumpstack_64.c and places them in a common dumpstack.c which is built
    for both 32 and 64 bit arches.

    Signed-off-by: Neil Horman
    Acked-by: Alexander van Heukelum
    Signed-off-by: Ingo Molnar

    Makefile | 2
    arch/x86/kernel/Makefile | 2
    arch/x86/kernel/Makefile | 2
    arch/x86/kernel/Makefile | 2
    arch/x86/kernel/Makefile | 2
    arch/x86/kernel/Makefile | 2
    arch/x86/kernel/dumpstack.c | 319 +++++++++++++++++++++++++++++++++++++++++
    arch/x86/kernel/dumpstack.h | 39 +++++
    arch/x86/kernel/dumpstack_32.c | 294 -------------------------------------
    arch/x86/kernel/dumpstack_64.c | 285 ------------------------------------
    5 files changed, 363 insertions(+), 576 deletions(-)

    Neil Horman