03 Jan, 2014

3 commits

  • Enable to fetch data from a file offset. Currently it only supports
    fetching from same binary uprobe set. It'll translate the file offset
    to a proper virtual address in the process.

    The syntax is "@+OFFSET" as it does similar to normal memory fetching
    (@ADDR) which does no address translation.

    Suggested-by: Oleg Nesterov
    Acked-by: Masami Hiramatsu
    Acked-by: Oleg Nesterov
    Cc: Srikar Dronamraju
    Cc: zhangwei(Jovi)
    Cc: Arnaldo Carvalho de Melo
    Signed-off-by: Namhyung Kim

    Namhyung Kim
     
  • Enable to fetch other types of argument for the uprobes. IOW, we can
    access stack, memory, deref, bitfield and retval from uprobes now.

    The format for the argument types are same as kprobes (but @SYMBOL
    type is not supported for uprobes), i.e:

    @ADDR : Fetch memory at ADDR
    $stackN : Fetch Nth entry of stack (N >= 0)
    $stack : Fetch stack address
    $retval : Fetch return value
    +|-offs(FETCHARG) : Fetch memory at FETCHARG +|- offs address

    Note that the retval only can be used with uretprobes.

    Original-patch-by: Hyeoncheol Lee
    Acked-by: Masami Hiramatsu
    Acked-by: Oleg Nesterov
    Cc: Srikar Dronamraju
    Cc: Oleg Nesterov
    Cc: zhangwei(Jovi)
    Cc: Arnaldo Carvalho de Melo
    Signed-off-by: Hyeoncheol Lee
    Signed-off-by: Namhyung Kim

    Namhyung Kim
     
  • The uprobe syntax requires an offset after a file path not a symbol.

    Reviewed-by: Masami Hiramatsu
    Acked-by: Oleg Nesterov
    Acked-by: Srikar Dronamraju
    Cc: zhangwei(Jovi)
    Cc: Arnaldo Carvalho de Melo
    Signed-off-by: Namhyung Kim

    Namhyung Kim
     

13 Apr, 2013

1 commit


08 May, 2012

1 commit

  • Commit f3f096cfe ("tracing: Provide trace events interface for
    uprobes") throws a warning about unmet dependencies.

    The exact warning message is:
    warning: (UPROBE_EVENT) selects UPROBES which has unmet direct dependencies (UPROBE_EVENTS && PERF_EVENTS)

    This is due to a typo in arch/Kconfig file. Fix similar typos in
    the uprobetracer documentation.

    Also add sample format of a uprobe event in the uprobetracer
    documentation as suggested by Masami Hiramatsu.

    Reported-by: Stephen Boyd
    Reported-by: Ingo Molnar
    Signed-off-by: Srikar Dronamraju
    Cc: Linus Torvalds
    Cc: Ananth N Mavinakayanahalli
    Cc: Oleg Nesterov
    Cc: Christoph Hellwig
    Cc: Steven Rostedt
    Cc: Arnaldo Carvalho de Melo
    Cc: Masami Hiramatsu
    Cc: Anton Arapov
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20120508111126.21004.38285.sendpatchset@srdronam.in.ibm.com
    Signed-off-by: Ingo Molnar

    Srikar Dronamraju
     

07 May, 2012

1 commit

  • Implements trace_event support for uprobes. In its current form
    it can be used to put probes at a specified offset in a file and
    dump the required registers when the code flow reaches the
    probed address.

    The following example shows how to dump the instruction pointer
    and %ax a register at the probed text address. Here we are
    trying to probe zfree in /bin/zsh:

    # cd /sys/kernel/debug/tracing/
    # cat /proc/`pgrep zsh`/maps | grep /bin/zsh | grep r-xp
    00400000-0048a000 r-xp 00000000 08:03 130904 /bin/zsh
    # objdump -T /bin/zsh | grep -w zfree
    0000000000446420 g DF .text 0000000000000012 Base
    zfree # echo 'p /bin/zsh:0x46420 %ip %ax' > uprobe_events
    # cat uprobe_events
    p:uprobes/p_zsh_0x46420 /bin/zsh:0x0000000000046420
    # echo 1 > events/uprobes/enable
    # sleep 20
    # echo 0 > events/uprobes/enable
    # cat trace
    # tracer: nop
    #
    # TASK-PID CPU# TIMESTAMP FUNCTION
    # | | | | |
    zsh-24842 [006] 258544.995456: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79
    zsh-24842 [007] 258545.000270: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79
    zsh-24842 [002] 258545.043929: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79
    zsh-24842 [004] 258547.046129: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79

    Signed-off-by: Srikar Dronamraju
    Acked-by: Steven Rostedt
    Acked-by: Masami Hiramatsu
    Cc: Linus Torvalds
    Cc: Ananth N Mavinakayanahalli
    Cc: Jim Keniston
    Cc: Linux-mm
    Cc: Oleg Nesterov
    Cc: Andi Kleen
    Cc: Christoph Hellwig
    Cc: Arnaldo Carvalho de Melo
    Cc: Anton Arapov
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20120411103043.GB29437@linux.vnet.ibm.com
    Signed-off-by: Ingo Molnar

    Srikar Dronamraju