25 Apr, 2017

1 commit


20 Apr, 2017

3 commits

  • There are places where we just need a forward declaration, and others
    were we need to include strlist.h and/or strfilter.h, reducing the
    impact of changes in headers on the build time, do it.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-zab42gbiki88y9k0csorxekb@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Removing it from util.h, part of an effort to disentangle the includes
    hell, that makes changes to util.h or something included by it to cause
    a complete rebuild of the tools.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-ztrjy52q1rqcchuy3rubfgt2@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Moving them from util.h, where they don't belong. Since libc already
    have string.h, name it slightly differently, as string2.h.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-eh3vz5sqxsrdd8lodoro4jrw@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

28 Mar, 2017

1 commit

  • SDT marker argument is in N@OP format. N is the size of argument and OP
    is the actual assembly operand. OP is arch dependent component and hence
    it's parsing logic also should be placed under tools/perf/arch/.

    Signed-off-by: Ravi Bangoria
    Acked-by: Masami Hiramatsu
    Cc: Alexander Shishkin
    Cc: Alexis Berlemont
    Cc: Hemant Kumar
    Cc: Michael Ellerman
    Cc: Naveen N. Rao
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20170328094754.3156-3-ravi.bangoria@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ravi Bangoria
     

21 Mar, 2017

2 commits

  • An sdt probe can be associated with arguments but they were not passed
    to the user probe tracing interface (uprobe_events); this patch adapts
    the sdt argument descriptors according to the uprobe input format.

    As the uprobe parser does not support scaled address mode, perf will
    skip arguments which cannot be adapted to the uprobe format.

    Here are the results:

    $ perf buildid-cache -v --add test_sdt
    $ perf probe -x test_sdt sdt_libfoo:table_frob
    $ perf probe -x test_sdt sdt_libfoo:table_diddle
    $ perf record -e sdt_libfoo:table_frob -e sdt_libfoo:table_diddle test_sdt
    $ perf script
    test_sdt ... 666.255678: sdt_libfoo:table_frob: (4004d7) arg0=0 arg1=0
    test_sdt ... 666.255683: sdt_libfoo:table_diddle: (40051a) arg0=0 arg1=0
    test_sdt ... 666.255686: sdt_libfoo:table_frob: (4004d7) arg0=1 arg1=2
    test_sdt ... 666.255689: sdt_libfoo:table_diddle: (40051a) arg0=3 arg1=4
    test_sdt ... 666.255692: sdt_libfoo:table_frob: (4004d7) arg0=2 arg1=4
    test_sdt ... 666.255694: sdt_libfoo:table_diddle: (40051a) arg0=6 arg1=8

    Signed-off-by: Alexis Berlemont
    Acked-by: Masami Hiramatsu
    Cc: Alexander Shishkin
    Cc: Hemant Kumar
    Cc: Peter Zijlstra
    Cc: Ravi Bangoria
    Link: http://lkml.kernel.org/r/20161214000732.1710-3-alexis.berlemont@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexis Berlemont
     
  • There are many SDT markers in powerpc whose uprobe definition goes
    beyond current MAX_CMDLEN, especially when target filename is long and
    sdt marker has long list of arguments. For example, definition of sdt
    marker

    method__compile__end: 8@17 8@9 8@10 -4@8 8@7 -4@6 8@5 -4@4 1@37(28)

    from file

    /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-2.b14.fc22.ppc64/jre/lib/ppc64/server/libjvm.so

    is

    p:sdt_hotspot/method__compile__end /usr/lib/jvm/java-1.8.0-openjdk-\
    1.8.0.91-2.b14.fc22.ppc64/jre/lib/ppc64/server/libjvm.so:0x4c4e00\
    arg1=%gpr17:u64 arg2=%gpr9:u64 arg3=%gpr10:u64 arg4=%gpr8:s32\
    arg5=%gpr7:u64 arg6=%gpr6:s32 arg7=%gpr5:u64 arg8=%gpr4:s32\
    arg9=+37(%gpr28):u8

    'perf probe' fails with segfault for such markers. As the uprobe_events
    file accepts definitions up to 4094 characters(4096 - 2 (\n\0)),
    increase value of MAX_CMDLEN match that.

    Signed-off-by: Ravi Bangoria
    Acked-by: Masami Hiramatsu
    Cc: Alexander Shishkin
    Cc: Alexis Berlemont
    Cc: Madhavan Srinivasan
    Cc: Michael Ellerman
    Cc: Naveen N. Rao
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20170207054547.3690-1-ravi.bangoria@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ravi Bangoria
     

15 Mar, 2017

2 commits

  • We indicate support for accepting sym+offset with kretprobes through a
    line in ftrace README. Parse the same to identify support and choose the
    appropriate format for kprobe_events.

    As an example, without this perf patch, but with the ftrace changes:

    naveen@ubuntu:~/linux/tools/perf$ sudo cat /sys/kernel/debug/tracing/README | grep kretprobe
    place (kretprobe): [:][+]|
    naveen@ubuntu:~/linux/tools/perf$
    naveen@ubuntu:~/linux/tools/perf$ sudo ./perf probe -v do_open%return
    probe-definition(0): do_open%return
    symbol:do_open file:(null) line:0 offset:0 return:1 lazy:(null)
    0 arguments
    Looking at the vmlinux_path (8 entries long)
    Using /boot/vmlinux for symbols
    Open Debuginfo file: /boot/vmlinux
    Try to find probe point from debuginfo.
    Matched function: do_open [2d0c7d8]
    Probe point found: do_open+0
    Matched function: do_open [35d76b5]
    found inline addr: 0xc0000000004ba984
    Failed to find "do_open%return",
    because do_open is an inlined function and has no return point.
    An error occurred in debuginfo analysis (-22).
    Trying to use symbols.
    Opening /sys/kernel/debug/tracing//kprobe_events write=1
    Writing event: r:probe/do_open do_open+0
    Writing event: r:probe/do_open_1 do_open+0
    Added new events:
    probe:do_open (on do_open%return)
    probe:do_open_1 (on do_open%return)

    You can now use it in all perf tools, such as:

    perf record -e probe:do_open_1 -aR sleep 1

    naveen@ubuntu:~/linux/tools/perf$ sudo cat /sys/kernel/debug/kprobes/list
    c000000000041370 k kretprobe_trampoline+0x0 [OPTIMIZED]
    c0000000004433d0 r do_open+0x0 [DISABLED]
    c0000000004433d0 r do_open+0x0 [DISABLED]

    And after this patch (and the subsequent powerpc patch):

    naveen@ubuntu:~/linux/tools/perf$ sudo ./perf probe -v do_open%return
    probe-definition(0): do_open%return
    symbol:do_open file:(null) line:0 offset:0 return:1 lazy:(null)
    0 arguments
    Looking at the vmlinux_path (8 entries long)
    Using /boot/vmlinux for symbols
    Open Debuginfo file: /boot/vmlinux
    Try to find probe point from debuginfo.
    Matched function: do_open [2d0c7d8]
    Probe point found: do_open+0
    Matched function: do_open [35d76b5]
    found inline addr: 0xc0000000004ba984
    Failed to find "do_open%return",
    because do_open is an inlined function and has no return point.
    An error occurred in debuginfo analysis (-22).
    Trying to use symbols.
    Opening /sys/kernel/debug/tracing//README write=0
    Opening /sys/kernel/debug/tracing//kprobe_events write=1
    Writing event: r:probe/do_open _text+4469712
    Writing event: r:probe/do_open_1 _text+4956248
    Added new events:
    probe:do_open (on do_open%return)
    probe:do_open_1 (on do_open%return)

    You can now use it in all perf tools, such as:

    perf record -e probe:do_open_1 -aR sleep 1

    naveen@ubuntu:~/linux/tools/perf$ sudo cat /sys/kernel/debug/kprobes/list
    c000000000041370 k kretprobe_trampoline+0x0 [OPTIMIZED]
    c0000000004433d0 r do_open+0x0 [DISABLED]
    c0000000004ba058 r do_open+0x8 [DISABLED]

    Signed-off-by: Naveen N. Rao
    Acked-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Michael Ellerman
    Cc: Steven Rostedt
    Cc: linuxppc-dev@lists.ozlabs.org
    Link: http://lkml.kernel.org/r/496ef9f33c1ab16286ece9dd62aa672807aef91c.1488961018.git.naveen.n.rao@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Naveen N. Rao
     
  • Simplify and separate out the ftrace README scanning logic into a
    separate helper. This is used subsequently to scan for all patterns of
    interest and to cache the result.

    Since we are only interested in availability of probe argument type x,
    we will only scan for that.

    Signed-off-by: Naveen N. Rao
    Acked-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Michael Ellerman
    Cc: Steven Rostedt
    Cc: linuxppc-dev@lists.ozlabs.org
    Link: http://lkml.kernel.org/r/6dc30edc747ba82a236593be6cf3a046fa9453b5.1488961018.git.naveen.n.rao@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Naveen N. Rao
     

04 Mar, 2017

1 commit

  • Generalize probe event file open routine into a generic function for opening
    trace files.

    Signed-off-by: Naveen N. Rao
    Acked-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Michael Ellerman
    Cc: Steven Rostedt
    Cc: linuxppc-dev@lists.ozlabs.org
    Link: http://lkml.kernel.org/r/b580465c7a4dcd5d3b40fdf8568e6be45d0a6333.1487849577.git.naveen.n.rao@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Naveen N. Rao
     

29 Sep, 2016

1 commit

  • Two SDT debug messages can occur for every DSO which is too noisy.
    Consequently, increase debug level of SDT messages.

    Signed-off-by: Adrian Hunter
    Acked-by: Masami Hiramatsu
    Cc: Jiri Olsa
    Cc: Mathieu Poirier
    Link: http://lkml.kernel.org/r/1474641528-18776-9-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     

24 Aug, 2016

2 commits

  • Remove unused tracing_dir variable from open_probe_events().

    Signed-off-by: Masami Hiramatsu
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/147201827792.5713.4165387506020511920.stgit@devbox
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Add a checking routine what types are supported by the running kernel by
    finding the pattern in /tracing/README.

    Signed-off-by: Masami Hiramatsu
    Cc: Alexander Shishkin
    Cc: Hemant Kumar
    Cc: Naohiro Aota
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/147151071172.12957.3340095690753291085.stgit@devbox
    [ 'enum probe_type' has no negative entries, so ends up as 'unsigned', remove '< 0'
    test to fix the build on at least centos:5, debian:7 & ubuntu:12.04.5 ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

16 Aug, 2016

2 commits

  • Cc: Adrian Hunter
    Cc: Colin King
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Masami Hiramatsu
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-zh2j4iqimralugke5qq7dn6d@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • dup and fdopen can potentially fail, so add some extra
    error handling checks rather than assuming they always work.

    Signed-off-by: Colin King
    Acked-by: Masami Hiramatsu
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1471038296-12956-1-git-send-email-colin.king@canonical.com
    [ Free resources when those functions (now being verified) fail ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Colin Ian King
     

14 Jul, 2016

4 commits

  • Allo glob wildcard for reusing cached/SDT events. E.g.

    # perf probe -x /usr/lib64/libc-2.20.so -a %sdt_libc:\*

    This example adds probes for all SDT in libc.
    Note that the SDTs must have been scanned by perf buildid-cache.

    Committer note:

    Using it to check what of those SDT probes would take place when doing
    a cargo run (rust):

    # trace --no-sys --event sdt_libc:* cargo run
    0.000 sdt_libc:setjmp:(7f326b69c4d1))
    28.423 sdt_libc:setjmp:(7f4b0a5364d1))
    29.000 sdt_libc:setjmp:(7f4b0a5364d1))
    88.597 sdt_libc:setjmp:(7fc01fd414d1))
    89.220 sdt_libc:setjmp:(7fc01fd414d1))
    95.501 sdt_libc:setjmp:(7f326b69c4d1))
    Running `target/debug/hello_world`
    97.110 sdt_libc:setjmp:(7f95e09234d1))
    Hello, world!
    #

    Signed-off-by: Masami Hiramatsu
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Ananth N Mavinakayanahalli
    Cc: Brendan Gregg
    Cc: Hemant Kumar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/146831791813.17065.17846564230840594888.stgit@devbox
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Add for_each_probe_cache_entry() wrapper macro for hiding list in
    probe_cache.

    Signed-off-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Brendan Gregg
    Cc: Hemant Kumar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/146831790386.17065.15082256697569419710.stgit@devbox
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Make "perf probe --cache --list" show only available cached events by
    checking build-id validity.

    E.g. without this patch:
    ----
    $ ./perf probe --cache --add oldevent=cmd_probe
    $ make #(to update ./perf)
    $ ./perf probe --cache --add newevent=cmd_probe
    $ ./perf probe --cache --list
    /home/mhiramat/ksrc/linux/tools/perf/perf (061e90539bac69
    probe_perf:newevent=cmd_probe
    /home/mhiramat/ksrc/linux/tools/perf/perf (c2e44d614e33e1
    probe_perf:oldevent=cmd_probe
    ----
    It shows both of old and new events but user can not use old one.
    With this;
    ----
    $ ./perf probe --cache -l
    /home/mhiramat/ksrc/linux/tools/perf/perf (061e90539bac69
    probe_perf:newevent=cmd_probe
    ----

    This shows only new events which are on the existing binary.

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Brendan Gregg
    Cc: Hemant Kumar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/146831789417.17065.17896487479879669610.stgit@devbox
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • To improve usability, support %[PROVIDER:]SDTEVENT format to add new
    probes on SDT and cached events.

    e.g.
    ----
    # perf probe -x /lib/libc-2.17.so %lll_lock_wait_private
    Added new event:
    sdt_libc:lll_lock_wait_private (on %lll_lock_wait_private in /usr/lib/libc-2.17.so)

    You can now use it in all perf tools, such as:

    perf record -e sdt_libc:lll_lock_wait_private -aR sleep 1

    # perf probe -l | more
    sdt_libc:lll_lock_wait_private (on __lll_lock_wait_private+21 in /usr/lib/libc-2.17.so)
    ----

    Note that this is not only for SDT events, but also normal
    events with event-name.

    e.g. define "myevent" on cache (-n doesn't add the real probe)
    ----
    # perf probe -x ./perf --cache -n --add 'myevent=dso__load $params'
    ----
    Reuse the "myevent" from cache as below.
    ----
    # perf probe -x ./perf %myevent
    ----

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Masami Hiramatsu
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Ananth N Mavinakayanahalli
    Cc: Brendan Gregg
    Cc: Hemant Kumar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/146831788372.17065.3645054540325909346.stgit@devbox
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

13 Jul, 2016

2 commits

  • That is not present on some libelf implementations, such as the one used
    in Alpine Linux: libelf-0.8.13.

    This ends up disabling the SDT code, that relies on this function.

    One alternative would be to provide an weak fallback implementation or
    the open coded variant used by the buildid sysfs notes reading code.

    Cc: Adrian Hunter
    Cc: Ananth N Mavinakayanahalli
    Cc: Brendan Gregg
    Cc: David Ahern
    Cc: Hemant Kumar
    Cc: Jiri Olsa
    Cc: Masami Hiramatsu
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-82lh22ybedy9b9lych8xj12g@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • The tools so far have been using the strerror_r() GNU variant, that
    returns a string, be it the buffer passed or something else.

    But that, besides being tricky in cases where we expect that the
    function using strerror_r() returns the error formatted in a provided
    buffer (we have to check if it returned something else and copy that
    instead), breaks the build on systems not using glibc, like Alpine
    Linux, where musl libc is used.

    So, introduce yet another wrapper, str_error_r(), that has the GNU
    interface, but uses the portable XSI variant of strerror_r(), so that
    users rest asured that the provided buffer is used and it is what is
    returned.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-d4t42fnf48ytlk8rjxs822tf@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

05 Jul, 2016

1 commit

  • perf buildid-cache --add scans given binary and add
    the SDT events to probe cache. "sdt_" prefix is appended for
    all SDT providers to avoid event-name clash with other pre-defined
    events. It is possible to use the cached SDT events as other cached
    events, via perf probe --add "sdt_:=".

    e.g.
    ----
    # perf buildid-cache --add /lib/libc-2.17.so
    # perf probe --cache --list | head -n 5
    /usr/lib/libc-2.17.so (a6fb821bdf53660eb2c29f778757aef294d3d392):
    sdt_libc:setjmp=setjmp
    sdt_libc:longjmp=longjmp
    sdt_libc:longjmp_target=longjmp_target
    sdt_libc:memory_heap_new=memory_heap_new
    # perf probe -x /usr/lib/libc-2.17.so \
    -a sdt_libc:memory_heap_new=memory_heap_new
    Added new event:
    sdt_libc:memory_heap_new (on memory_heap_new
    in /usr/lib/libc-2.17.so)

    You can now use it in all perf tools, such as:

    perf record -e sdt_libc:memory_heap_new -aR sleep 1

    # perf probe -l
    sdt_libc:memory_heap_new (on new_heap+183 in /usr/lib/libc-2.17.so)
    ----

    Note that SDT event entries in probe-cache file is somewhat different
    from normal cached events. Normal one starts with "#", but SDTs are
    starting with "%".

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Brendan Gregg
    Cc: Hemant Kumar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/146736025058.27797.13043265488541434502.stgit@devbox
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

01 Jul, 2016

3 commits

  • 'perf probe --del' removes caches when '--cache' is given. Note that
    the delete pattern is not the same as for normal events.

    If you cached probes with event name, --del "eventname" works as
    expected. However, if you skipped it, the cached probes doesn't have
    actual event name. In that case --del "probe-desc" is required (wildcard
    is acceptable). For example a cache entry has the probe-desc "vfs_read
    $params", you can remove it with --del 'vfs_read*'.

    -----
    # perf probe --cache --list
    /[kernel.kallsyms] (1466a0a250b5d0070c6d0f03c5fed30b237970a1):
    vfs_read $params
    /usr/lib64/libc-2.17.so (c31ffe7942bfd77b2fca8f9bd5709d387a86d3bc):
    getaddrinfo $params

    # perf probe --cache --del vfs_read\*
    Removed cached event: probe:vfs_read

    # perf probe --cache --list
    /[kernel.kallsyms] (1466a0a250b5d0070c6d0f03c5fed30b237970a1):
    /usr/lib64/libc-2.17.so (c31ffe7942bfd77b2fca8f9bd5709d387a86d3bc):
    getaddrinfo $params
    -----

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Masami Hiramatsu
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Ananth N Mavinakayanahalli
    Cc: Brendan Gregg
    Cc: Hemant Kumar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/146736021651.27797.10250879847070772920.stgit@devbox
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • perf probe --list shows all cached probes when --cache is given. Each
    caches are shown with on which binary that probed. E.g.:

    -----
    # perf probe --cache vfs_read \$params
    # perf probe --cache -x /lib64/libc-2.17.so getaddrinfo \$params
    # perf probe --cache --list
    [kernel.kallsyms] (1466a0a250b5d0070c6d0f03c5fed30b237970a1):
    vfs_read $params
    /usr/lib64/libc-2.17.so (c31ffe7942bfd77b2fca8f9bd5709d387a86d3bc):
    getaddrinfo $params
    -----

    Note that $params requires debuginfo.

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Masami Hiramatsu
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Ananth N Mavinakayanahalli
    Cc: Brendan Gregg
    Cc: Hemant Kumar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/146736020674.27797.13488316780383460180.stgit@devbox
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Before analyzing debuginfo, try to find a corresponding entry from probe
    cache always. This does not depend on --cache, the --cache enables to
    store/update cache, but looking up the cache is always enabled.

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Brendan Gregg
    Cc: Hemant Kumar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/146736019226.27797.16366402884098398857.stgit@devbox
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

23 Jun, 2016

1 commit


16 Jun, 2016

1 commit

  • Introduce perf_cache object and interfaces to create, add entries,
    commit, and delete the object.

    perf_cache represents a file for the cached "perf probe" definitions on
    one binary file or vmlinux which has its own build id. The probe cache
    file is located under the build-id cache directory of the target binary,
    as below;

    /.build-id///probe

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Brendan Gregg
    Cc: Hemant Kumar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20160615032830.31330.84998.stgit@devbox
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

27 Apr, 2016

1 commit

  • Since other methods return 0 if succeeded (or filedesc), let
    probe_file__add_event() return 0 instead of the length of written bytes.

    Signed-off-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Hemant Kumar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20160426090303.11891.18232.stgit@devbox
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

12 Nov, 2015

1 commit

  • On kernel with only one out of CONFIG_KPROBE_EVENTS and
    CONFIG_UPROBE_EVENTS enabled, 'perf probe -d' causes a segfault because
    perf_del_probe_events() calls probe_file__get_events() with a negative
    fd.

    This patch fixes it by adding parameter validation at the entry of
    probe_file__get_events() and probe_file__get_rawlist(). Since they are
    both non-static public functions (in .h file), parameter verifying is
    required.

    v1 -> v2: Verify fd at the head of probe_file__get_rawlist() instead of
    checking at call site (suggested by Masami and Arnaldo at [1,2]).

    [1] http://lkml.kernel.org/r/50399556C9727B4D88A595C8584AAB37526048E3@GSjpTKYDCembx32.service.hitachi.net
    [2] http://lkml.kernel.org/r/20151105155830.GV13236@kernel.org

    Signed-off-by: Wang Nan
    Acked-by: Masami Hiramatsu
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1446803415-83382-1-git-send-email-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     

14 Sep, 2015

2 commits


04 Sep, 2015

2 commits

  • Showing actual trace event when deleteing perf events is only needed in
    perf probe command. But the add functionality itself can be used by
    other places. So move the printing code into the cmd_probe().

    The output is not changed.

    Signed-off-by: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Masami Hiramatsu
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1441368963-11565-5-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • The del_perf_probe_events() does 2 things:

    1. find existing events which match to filter
    2. delete such trace events from kernel

    But sometimes we need to do something with the trace events. So split
    the funtion into two, so that it can access intermediate trace events
    name using strlist if needed.

    Signed-off-by: Namhyung Kim
    Acked-by: Masami Hiramatsu
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1441368963-11565-4-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

21 Jul, 2015

1 commit

  • Move ftrace probe-event operations to probe-file.c from probe-event.c.

    Signed-off-by: Masami Hiramatsu
    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: Hemant Kumar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20150715091407.8915.14316.stgit@localhost.localdomain
    [ Fixed up strlist__new() calls wrt 4a77e2183fc0 ("perf strlist: Make dupstr be the...") ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu