23 Aug, 2016

1 commit

  • Pull GPIO fixes from Linus Walleij:
    "Here are a few GPIO fixes for v4.8.

    I was expecting some fallout from the new chardev rework but nothing
    like that turned up att all. Instead a Kconfig confusion that I think
    I have finally nailed, then some ordinary driver noise and trivia.

    This fixes a Kconfig issue with UM: when I made GPIOLIB available to
    all archs, that included UM, but the OF part of GPIOLIB requires
    HAS_IOMEM, so we add HAS_IOMEM as a dependency to OF_GPIO.

    This in turn exposed the fact that a few GPIO drivers were implicitly
    assuming OF_GPIO as their dependency but instead depended on OF alone
    (the typical problem being a pointer inside gpio_chip not existing
    unless OF_GPIO is selected) and then UM would fail to compile with
    these drivers instead. Then I lost patience and made any GPIO driver
    depending on just OF depend on OF_GPIO instead, that is certainly what
    they meant and the only thing that makes sense anyway. GPIO with just
    OF but !OF_GPIO does not make sense.

    Also a fix for the max730x driver data pointer, and a minor comment
    fix for the GPIO tools"

    * tag 'gpio-v4.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
    gpio: make any OF dependent driver depend on OF_GPIO
    gpio: Fix OF build problem on UM
    gpio: max730x: set gpiochip data pointer before using it
    tools/gpio: fix gpio-event-mon header comment

    Linus Torvalds
     

19 Aug, 2016

1 commit

  • Pull perf fixes from Ingo Molnar:
    "Mostly tooling fixes, but also start/stop filter related fixes, a perf
    event read() fix, a fix uncovered by fuzzing, and an uprobes leak fix"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/core: Check return value of the perf_event_read() IPI
    perf/core: Enable mapping of the stop filters
    perf/core: Update filters only on executable mmap
    perf/core: Fix file name handling for start/stop filters
    perf/core: Fix event_function_local()
    uprobes: Fix the memcg accounting
    perf intel-pt: Fix occasional decoding errors when tracing system-wide
    tools: Sync kvm related header files for arm64 and s390
    perf probe: Release resources on error when handling exit paths
    perf probe: Check for dup and fdopen failures
    perf symbols: Fix annotation of objects with debuginfo files
    perf script: Don't disable use_callchain if input is pipe
    perf script: Show proper message when failed list scripts
    perf jitdump: Add the right header to get the major()/minor() definitions
    perf ppc64le: Fix build failure when libelf is not present
    perf tools mem: Fix -t store option for record command
    perf intel-pt: Fix ip compression

    Linus Torvalds
     

17 Aug, 2016

2 commits

  • Pull virtio/vhost fixes from Michael Tsirkin:
    - test fixes
    - a vsock fix

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    tools/virtio: add dma stubs
    vhost/test: fix after swiotlb changes
    vhost/vsock: drop space available check for TX vq
    ringtest: test build fix

    Linus Torvalds
     
  • …/kernel/git/acme/linux into perf/urgent

    Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

    - Fix occasional decoding errors when tracing system-wide with
    Intel PT (Adrian Hunter)

    - Fix ip compression in Intel PT for some specific packet types not
    present on current hardware (Adrian Hunter)

    - Fix annotation of objects with debuginfo files (Anton Blanchard)

    - Fix build on Fedora Rawhide (25) wrt using the right header to
    get the major() & minor() definitions in the jitdump code, now
    it is deprecated getting those using sys/types.h, one has to use
    sys/sysmacros.h (Arnaldo Carvalho de Melo)

    - Sync arm64/s390 kvm related header files (Arnaldo Carvalho de Melo)

    - Check for dup and fdopen failures in 'perf probe' (Colin Ian King,
    Arnaldo Carvalho de Melo)

    - Fix showing callchains in pipe mode, i.e.

    perf record -g -o - workload | perf script

    now shows callchains (He Kuang)

    - Show proper message when the scripts directory points to some
    invalid location in 'perf script --list' (He Kuang)

    - Fix 'perf mem -t store' to record 'cpu/mem-stores/P' events
    again (Jiri Olsa)

    - Fix ppc64le build failure when libelf is not present (Ravi Bangoria)

    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     

16 Aug, 2016

8 commits

  • In order to successfully decode Intel PT traces, context switch events
    are needed from the moment the trace starts. Currently that is ensured
    by using the 'immediate' flag which enables the switch event when it is
    opened.

    However, since commit 86c2786994bd ("perf intel-pt: Add support for
    PERF_RECORD_SWITCH") that might not always happen. When tracing
    system-wide the context switch event is added to the tracking event
    which was not set as 'immediate'. Change that so it is.

    Signed-off-by: Adrian Hunter
    Cc: Jiri Olsa
    Cc: stable@vger.kernel.org # v4.4+
    Fixes: 86c2786994bd ("perf intel-pt: Add support for PERF_RECORD_SWITCH")
    Link: http://lkml.kernel.org/r/1471245784-22580-1-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     
  • From a quick look nothing stands out as requiring changes to kvm tools
    such as tools/perf/arch/s390/util/kvm-stat.c.

    Silences these header checking warnings:

    $ make -C tools/perf
    make: Entering directory '/home/acme/git/linux/tools/perf'
    BUILD: Doing 'make -j4' parallel build
    Warning: tools/arch/s390/include/uapi/asm/kvm.h differs from kernel
    Warning: tools/arch/s390/include/uapi/asm/sie.h differs from kernel
    Warning: tools/arch/arm64/include/uapi/asm/kvm.h differs from kernel

    Cc: Adrian Hunter
    Cc: Alexander Yarygin
    Cc: David Ahern
    Cc: Hemant Kumar
    Cc: Jiri Olsa
    Cc: Michael Ellerman
    Cc: Namhyung Kim
    Cc: Naveen N. Rao
    Cc: Scott Wood
    Cc: Srikar Dronamraju
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-btutge414g516qmh6r5ienlj@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • 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
     
  • Commit 73cdf0c6ea9c ("perf symbols: Record text offset in dso
    to calculate objdump address") started storing the offset of
    the text section for all DSOs:

    if (elf_section_by_name(elf, &ehdr, &tshdr, ".text", NULL))
    dso->text_offset = tshdr.sh_addr - tshdr.sh_offset;

    Unfortunately this breaks debuginfo files, because we need to calculate
    the offset of the text section in the associated executable file. As a
    result perf annotate returns junk for all debuginfo files.

    Fix this by using runtime_ss->elf which should point at the executable
    when parsing a debuginfo file.

    Signed-off-by: Anton Blanchard
    Reviewed-by: Naveen N. Rao
    Tested-by: Wang Nan
    Cc: Peter Zijlstra
    Cc: Ravi Bangoria
    Cc: stable@vger.kernel.org # v4.6+
    Fixes: 73cdf0c6ea9c ("perf symbols: Record text offset in dso to calculate objdump address")
    Link: http://lkml.kernel.org/r/20160813115533.6de17912@kryten
    Signed-off-by: Arnaldo Carvalho de Melo

    Anton Blanchard
     
  • Because perf data from pipe do not have a header with evsel attr, we
    should not check that and disable symbol_conf.use_callchain. Otherwise,
    perf script won't show callchains even if the data stream contains
    callchain.

    Before:
    $ perf record -g -o - uname |perf script
    Linux
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.000 MB - ]
    uname 1828 182630.186578: 250000 cpu-clock: ..b9499 setup_arg_pages
    uname 1828 182630.186850: 250000 cpu-clock: ..83b20 ___might_sleep
    uname 1828 182630.187153: 250000 cpu-clock: ..4b6be file_map_prot_ch
    ...

    After:
    $ perf record -g -o - uname |perf script
    Linux
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.000 MB - ]
    uname 1833 182675.927099: 250000 cpu-clock:
    ba5520 _raw_spin_lock+0xfe200040 ([kernel.kallsyms])
    389dd4 expand_downwards+0xfe200154 ([kernel.kallsyms])
    389f34 expand_stack+0xfe200024 ([kernel.kallsyms])
    3b957e setup_arg_pages+0xfe20019e ([kernel.kallsyms])
    40c80f load_elf_binary+0xfe20042f ([kernel.kallsyms])
    ...

    Signed-off-by: He Kuang
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1470309943-153909-2-git-send-email-hekuang@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    He Kuang
     
  • Perf shows the usage message when perf scripts folder failed to open,
    which misleads users to let them think the command is being mistyped.

    This patch shows a proper message and guides users to check the
    PERF_EXEC_PATH environment variable in that case.

    Before:

    $ perf script --list

    Usage: perf script []
    or: perf script [] record ]
    or: perf script [] report ] ]
    or: perf script [] [script-args]

    -l, --list list available scripts

    After:

    $ perf script --list
    open(/home/user/perf-core/scripts) failed.
    Check for "PERF_EXEC_PATH" env to set scripts dir.

    Signed-off-by: He Kuang
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1470309943-153909-1-git-send-email-hekuang@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    He Kuang
     
  • Noticed on Fedora Rawhide:

    $ gcc --version
    gcc (GCC) 6.1.1 20160721 (Red Hat 6.1.1-4)
    $ rpm -q glibc
    glibc-2.24.90-1.fc26.x86_64
    $

    CC /tmp/build/perf/util/jitdump.o
    util/jitdump.c: In function 'jit_repipe_code_load':
    util/jitdump.c:428:2: error: '__major_from_sys_types' is deprecated:
    In the GNU C Library, `major' is defined by .
    For historical compatibility, it is currently defined by
    as well, but we plan to remove this soon.
    To use `major', include directly.
    If you did not intend to use a system-defined macro `major',
    you should #undef it after including .
    [-Werror=deprecated-declarations]
    event->mmap2.maj = major(st.st_dev);
    ^~~~~
    In file included from /usr/include/features.h:397:0,
    from /usr/include/sys/types.h:25,
    from util/jitdump.c:1:
    /usr/include/sys/sysmacros.h:87:1: note: declared here
    __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_FST_IMPL_TEMPL)

    Fix it following that recomendation.

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

    Arnaldo Carvalho de Melo
     

15 Aug, 2016

2 commits


13 Aug, 2016

5 commits

  • Pull perf fixes from Ingo Molnar:
    "Mostly tooling fixes, plus two uncore-PMU fixes, an uprobes fix, a
    perf-cgroups fix and an AUX events fix"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/x86/intel/uncore: Add enable_box for client MSR uncore
    perf/x86/intel/uncore: Fix uncore num_counters
    uprobes/x86: Fix RIP-relative handling of EVEX-encoded instructions
    perf/core: Set cgroup in CPU contexts for new cgroup events
    perf/core: Fix sideband list-iteration vs. event ordering NULL pointer deference crash
    perf probe ppc64le: Fix probe location when using DWARF
    perf probe: Add function to post process kernel trace events
    tools: Sync cpufeatures headers with the kernel
    toops: Sync tools/include/uapi/linux/bpf.h with the kernel
    tools: Sync cpufeatures.h and vmx.h with the kernel
    perf probe: Support signedness casting
    perf stat: Avoid skew when reading events
    perf probe: Fix module name matching
    perf probe: Adjust map->reloc offset when finding kernel symbol from map
    perf hists: Trim libtraceevent trace_seq buffers
    perf script: Add 'bpf-output' field to usage message

    Linus Torvalds
     
  • Pull libnvdimm fixes from Dan Williams:

    - Fix for the nd_blk (NVDIMM Block Window Aperture) driver.

    A spec clarification requires the driver to mask off reserved bits in
    status register. This is tagged for -stable back to the v4.2 kernel.

    - Fix for a kernel crash in the nvdimm unit tests when module loading
    is interrupted with SIGTERM. Tagged for -stable since validation
    efforts external to Intel use the unit tests for qualifying
    backports.

    - Add a new 'size' sysfs attribute for the BTT (NVDIMM Block
    Translation Table) driver to make it symmetric with the other
    namespace personality drivers (PFN and DAX) that provide a size
    attribute for indicating how much namespace capacity is lost to
    metadata.

    The BTT change arrived at the start of the merge window and has
    appeared in a -next release. It can technically wait for 4.9, but it
    is small, fixes asymmetry in the libnvdimm-sysfs interface, and
    something I would have squeezed into the v4.8 pull request had it
    arrived a few days earlier.

    * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
    tools/testing/nvdimm: fix SIGTERM vs hotplug crash
    nvdimm, btt: add a size attribute for BTTs
    libnvdimm, nd_blk: mask off reserved status bits

    Linus Torvalds
     
  • arch__post_process_probe_trace_events() calls get_target_map() to
    prepare symbol table. get_target_map() is defined inside
    util/probe-event.c.

    probe-event.c will only get included in perf binary if CONFIG_LIBELF is
    set. Hence arch__post_process_probe_trace_events() needs to be defined
    inside #ifdef HAVE_LIBELF_SUPPORT to solve compilation error.

    Reported-and-Tested-by: Anton Blanchard
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Alexander Shishkin
    Cc: Balbir Singh
    Cc: Naveen N. Rao
    Cc: Ananth N Mavinakayanahalli
    Cc: Masami Hiramatsu
    Cc: Wang Nan
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/57ABFF88.8030905@linux.vnet.ibm.com
    [ Thunderbird MUA mangled it, fix that ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Ravi Bangoria
     
  • Michael reported 'perf mem -t store record' being broken. The reason is
    latest rework of this area:

    commit acbe613e0c03 ("perf tools: Add monitored events array")

    We don't mark perf_mem_events store record when -t store option is
    specified.

    Committer notes:

    Before:

    # perf mem -t store record usleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.020 MB perf.data (7 samples) ]
    # perf evlist
    cycles:ppp
    #

    After:

    # perf mem -t store record usleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.020 MB perf.data (7 samples) ]
    # perf evlist
    cpu/mem-stores/P
    #

    Reported-by: Michael Petlan
    Signed-off-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Fixes: acbe613e0c03 ("perf tools: Add monitored events array")
    Link: http://lkml.kernel.org/r/1470905457-18311-1-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • The June 2015 Intel SDM introduced IP Compression types 4 and 6. Refer
    to section 36.4.2.2 Target IP (TIP) Packet - IP Compression.

    Existing Intel PT packet decoder did not support type 4, and got type 6
    wrong. Because type 3 and type 4 have the same number of bytes, the
    packet 'count' has been changed from being the number of ip bytes to
    being the type code. That allows the Intel PT decoder to correctly
    decide whether to sign-extend or use the last ip. However that also
    meant the code had to be adjusted in a number of places.

    Currently hardware is not using the new compression types, so this fix
    has no effect on existing hardware.

    Signed-off-by: Adrian Hunter
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/r/1469005206-3049-1-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     

11 Aug, 2016

1 commit

  • The unit tests crash when hotplug races the previous probe. This race
    requires that the loading of the nfit_test module be terminated with
    SIGTERM, and the module to be unloaded while the ars scan is still
    running.

    In contrast to the normal nfit driver, the unit test calls
    acpi_nfit_init() twice to simulate hotplug, whereas the nominal case
    goes through the acpi_nfit_notify() event handler. The
    acpi_nfit_notify() path is careful to flush the previous region
    registration before servicing the hotplug event. The unit test was
    missing this guarantee.

    BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: [] pwq_activate_delayed_work+0x47/0x170
    [..]
    Call Trace:
    [] pwq_dec_nr_in_flight+0x66/0xa0
    [] process_one_work+0x2d0/0x680
    [] ? process_one_work+0x171/0x680
    [] worker_thread+0x4e/0x480
    [] ? process_one_work+0x680/0x680
    [] ? process_one_work+0x680/0x680
    [] kthread+0xf3/0x110
    [] ret_from_fork+0x1f/0x40
    [] ? kthread_create_on_node+0x230/0x230

    Cc:
    Signed-off-by: Dan Williams

    Dan Williams
     

10 Aug, 2016

2 commits

  • We have some tests that assume we're using std=gnu99, which is fine on
    most compilers, but some old compilers use a different default.

    So make it explicit that we want to use std=gnu99.

    Signed-off-by: Michael Ellerman

    Michael Ellerman
     
  • …/kernel/git/acme/linux into perf/urgent

    Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

    User visible fixes:

    - Fix the lookup for a kernel module in 'perf probe', fixing for instance, the
    erroneous return of "[raid10]" when looking for "[raid1]" (Konstantin Khlebnikov)

    - Disable counters in a group before reading them in 'perf stat', to avoid skew (Mark Rutland)

    - Fix adding probes to function aliases in systems using kaslr (Masami Hiramatsu)

    - Trip libtraceevent trace_seq buffers, removing unnecessary memory usage that could
    bring a system using tracepoint events with 'perf top' to a crawl, as the trace_seq
    buffers start at a whooping 4 KB, which is very rarely used in perf's usecases,
    so realloc it to the really used space as a last measure after using libtraceevent
    functions to format the fields of tracepoint events (Arnaldo Carvalho de Melo)

    - Fix 'perf probe' location when using DWARF on ppc64le (Ravi Bangoria)

    - Allow specifying signedness casts to a 'perf probe' variable, to shorten
    the number of steps to see signed values that otherwise would always appear
    as hex values (Naohiro Aota)

    Documentation fixes:

    - Add 'bpf-output' field to 'perf script' usage message (Brendan Gregg)

    Infrastructure fixes:

    - Sync kernel header files: cpufeatures.h, {disabled,required}-features.h,
    bpf.h and vmx.h, so that we get a clean build, without warnings about files
    being different from the kernel counterparts.

    A verification of the need or desirability of changes in tools/ based on what
    was done in the kernel changesets was made and documented in the respective
    file sync changesets (Arnaldo Carvalho de Melo)

    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     

09 Aug, 2016

11 commits

  • Powerpc has Global Entry Point and Local Entry Point for functions. LEP
    catches call from both the GEP and the LEP. Symbol table of ELF contains
    GEP and Offset from which we can calculate LEP, but debuginfo does not
    have LEP info.

    Currently, perf prioritize symbol table over dwarf to probe on LEP for
    ppc64le. But when user tries to probe with function parameter, we fall
    back to using dwarf(i.e. GEP) and when function called via LEP, probe
    will never hit.

    For example:

    $ objdump -d vmlinux
    ...
    do_sys_open():
    c0000000002eb4a0: e8 00 4c 3c addis r2,r12,232
    c0000000002eb4a4: 60 00 42 38 addi r2,r2,96
    c0000000002eb4a8: a6 02 08 7c mflr r0
    c0000000002eb4ac: d0 ff 41 fb std r26,-48(r1)

    $ sudo ./perf probe do_sys_open
    $ sudo cat /sys/kernel/debug/tracing/kprobe_events
    p:probe/do_sys_open _text+3060904

    $ sudo ./perf probe 'do_sys_open filename:string'
    $ sudo cat /sys/kernel/debug/tracing/kprobe_events
    p:probe/do_sys_open _text+3060896 filename_string=+0(%gpr4):string

    For second case, perf probed on GEP. So when function will be called via
    LEP, probe won't hit.

    $ sudo ./perf record -a -e probe:do_sys_open ls
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.195 MB perf.data ]

    To resolve this issue, let's not prioritize symbol table, let perf
    decide what it wants to use. Perf is already converting GEP to LEP when
    it uses symbol table. When perf uses debuginfo, let it find LEP offset
    form symbol table. This way we fall back to probe on LEP for all cases.

    After patch:

    $ sudo ./perf probe 'do_sys_open filename:string'
    $ sudo cat /sys/kernel/debug/tracing/kprobe_events
    p:probe/do_sys_open _text+3060904 filename_string=+0(%gpr4):string

    $ sudo ./perf record -a -e probe:do_sys_open ls
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.197 MB perf.data (11 samples) ]

    Signed-off-by: Ravi Bangoria
    Acked-by: Masami Hiramatsu
    Cc: Alexander Shishkin
    Cc: Ananth N Mavinakayanahalli
    Cc: Balbir Singh
    Cc: Namhyung Kim
    Cc: Naveen N. Rao
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1470723805-5081-2-git-send-email-ravi.bangoria@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ravi Bangoria
     
  • Instead of inline code, introduce function to post process kernel
    probe trace events.

    Signed-off-by: Ravi Bangoria
    Acked-by: Masami Hiramatsu
    Cc: Alexander Shishkin
    Cc: Ananth N Mavinakayanahalli
    Cc: Balbir Singh
    Cc: Namhyung Kim
    Cc: Naveen N. Rao
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1470723805-5081-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ravi Bangoria
     
  • Due to:

    1e61f78baf89 ("x86/cpufeature: Make sure DISABLED/REQUIRED macros are updated")

    No changes to tools using those headers (tools/arch/x86/lib/mem{set,cpu}_64.S)
    seems necessary.

    Detected by the tools build header drift checker:

    $ make -C tools/perf O=/tmp/build/perf
    make: Entering directory '/home/acme/git/linux/tools/perf'
    BUILD: Doing 'make -j4' parallel build
    GEN /tmp/build/perf/common-cmds.h
    Warning: tools/arch/x86/include/asm/disabled-features.h differs from kernel
    Warning: tools/arch/x86/include/asm/required-features.h differs from kernel
    Warning: tools/arch/x86/include/asm/cpufeatures.h differs from kernel
    CC /tmp/build/perf/util/probe-finder.o
    CC /tmp/build/perf/builtin-help.o

    ^C$

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

    Arnaldo Carvalho de Melo
     
  • The way we're using kernel headers in tools/ now, with a copy that is
    made to the same path prefixed by "tools/" plus checking if that copy
    got stale, i.e. if the kernel counterpart changed, helps in keeping
    track with new features that may be useful for tools to exploit.

    For instance, looking at all the changes to bpf.h since it was last
    copied to tools/include brings this to toolers' attention:

    Need to investigate this one to check how to run a program via perf, setting up
    a BPF event, that will take advantage of the way perf already calls clang/LLVM,
    sets up the event and runs the workload in a single command line, helping in
    debugging such semi cooperative programs:

    96ae52279594 ("bpf: Add bpf_probe_write_user BPF helper to be called in tracers")

    This one needs further investigation about using the feature it improves
    in 'perf trace' to do some tcpdumpin' mixed with syscalls, tracepoints,
    probe points, callgraphs, etc:

    555c8a8623a3 ("bpf: avoid stack copy and use skb ctx for event output")

    Add tracing just packets that are related to some container to that mix:

    4a482f34afcc ("cgroup: bpf: Add bpf_skb_in_cgroup_proto")
    4ed8ec521ed5 ("cgroup: bpf: Add BPF_MAP_TYPE_CGROUP_ARRAY")

    Definetely needs to have example programs accessing task_struct from a bpf proggie
    started from 'perf trace':

    606274c5abd8 ("bpf: introduce bpf_get_current_task() helper")

    Core networking related, XDP:

    6ce96ca348a9 ("bpf: add XDP_TX xdp_action for direct forwarding")
    6a773a15a1e8 ("bpf: add XDP prog type for early driver filter")
    13c5c240f789 ("bpf: add bpf_get_hash_recalc helper")
    d2485c4242a8 ("bpf: add bpf_skb_change_type helper")
    6578171a7ff0 ("bpf: add bpf_skb_change_proto helper")

    Changes detected by the tools build system:

    $ make -C tools/perf O=/tmp/build/perf install-bin
    make: Entering directory '/home/acme/git/linux/tools/perf'
    BUILD: Doing 'make -j4' parallel build
    Warning: tools/include/uapi/linux/bpf.h differs from kernel
    INSTALL GTK UI
    CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o

    $

    Cc: Adrian Hunter
    Cc: Alexei Starovoitov
    Cc: Brenden Blanco
    Cc: Daniel Borkmann
    Cc: David Ahern
    Cc: David S. Miller
    Cc: Jiri Olsa
    Cc: Martin KaFai Lau
    Cc: Namhyung Kim
    Cc: Sargun Dhillon
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-difq4ts1xvww6eyfs9e7zlft@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • There were changes related to the deprecation of the "pcommit"
    instruction:

    fd1d961dd681 ("x86/insn: remove pcommit")
    dfa169bbee00 ("Revert "KVM: x86: add pcommit support"")

    No need to update anything in the tools, as "pcommit" wasn't being
    listed on the VMX_EXIT_REASONS in the tools/perf/arch/x86/util/kvm-stat.c
    file.

    Just grab fresh copies of these files to silence the file cache
    coherency detector:

    $ make -C tools/perf O=/tmp/build/perf install-bin
    make: Entering directory '/home/acme/git/linux/tools/perf'
    BUILD: Doing 'make -j4' parallel build
    Warning: tools/arch/x86/include/asm/cpufeatures.h differs from kernel
    Warning: tools/arch/x86/include/uapi/asm/vmx.h differs from kernel
    INSTALL GTK UI

    #

    Cc: Adrian Hunter
    Cc: Dan Williams
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paolo Bonzini
    Cc: Ross Zwisler
    Cc: Wang Nan
    Cc: Xiao Guangrong
    Link: http://lkml.kernel.org/n/tip-07pmcc1ysydhyyxbmp1vt0l4@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • The 'perf probe' tool detects a variable's type and use the detected
    type to add a new probe. Then, kprobes prints its variable in
    hexadecimal format if the variable is unsigned and prints in decimal if
    it is signed.

    We sometimes want to see unsigned variable in decimal format (i.e.
    sector_t or size_t). In that case, we need to investigate the variable's
    size manually to specify just signedness.

    This patch add signedness casting support. By specifying "s" or "u" as a
    type, perf-probe will investigate variable size as usual and use the
    specified signedness.

    E.g. without this:

    $ perf probe -a 'submit_bio bio->bi_iter.bi_sector'
    Added new event:
    probe:submit_bio (on submit_bio with bi_sector=bio->bi_iter.bi_sector)
    You can now use it in all perf tools, such as:
    perf record -e probe:submit_bio -aR sleep 1
    $ cat trace_pipe|head
    dbench-9692 [003] d..1 971.096633: submit_bio: (submit_bio+0x0/0x140) bi_sector=0x3a3d00
    dbench-9692 [003] d..1 971.096685: submit_bio: (submit_bio+0x0/0x140) bi_sector=0x1a3d80
    dbench-9692 [003] d..1 971.096687: submit_bio: (submit_bio+0x0/0x140) bi_sector=0x3a3d80
    ...
    // need to investigate the variable size
    $ perf probe -a 'submit_bio bio->bi_iter.bi_sector:s64'
    Added new event:
    probe:submit_bio (on submit_bio with bi_sector=bio->bi_iter.bi_sector:s64)
    You can now use it in all perf tools, such as:
    perf record -e probe:submit_bio -aR sleep 1

    With this:

    // just use "s" to cast its signedness
    $ perf probe -v -a 'submit_bio bio->bi_iter.bi_sector:s'
    Added new event:
    probe:submit_bio (on submit_bio with bi_sector=bio->bi_iter.bi_sector:s)
    You can now use it in all perf tools, such as:
    perf record -e probe:submit_bio -aR sleep 1
    $ cat trace_pipe|head
    dbench-9689 [001] d..1 1212.391237: submit_bio: (submit_bio+0x0/0x140) bi_sector=128
    dbench-9689 [001] d..1 1212.391252: submit_bio: (submit_bio+0x0/0x140) bi_sector=131072
    dbench-9697 [006] d..1 1212.398611: submit_bio: (submit_bio+0x0/0x140) bi_sector=30208

    This commit also update perf-probe.txt to describe "types". Most parts
    are based on existing documentation: Documentation/trace/kprobetrace.txt

    Committer note:

    Testing using 'perf trace':

    # perf probe -a 'submit_bio bio->bi_iter.bi_sector'
    Added new event:
    probe:submit_bio (on submit_bio with bi_sector=bio->bi_iter.bi_sector)

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

    perf record -e probe:submit_bio -aR sleep 1

    # trace --no-syscalls --ev probe:submit_bio
    0.000 probe:submit_bio:(ffffffffac3aee00) bi_sector=0xc133c0)
    3181.861 probe:submit_bio:(ffffffffac3aee00) bi_sector=0x6cffb8)
    3181.881 probe:submit_bio:(ffffffffac3aee00) bi_sector=0x6cffc0)
    3184.488 probe:submit_bio:(ffffffffac3aee00) bi_sector=0x6cffc8)

    4717.927 probe:submit_bio:(ffffffffac3aee00) bi_sector=0x4dc7a88)
    4717.970 probe:submit_bio:(ffffffffac3aee00) bi_sector=0x4dc7880)
    ^C[root@jouet ~]#

    Now, using this new feature:

    [root@jouet ~]# perf probe -a 'submit_bio bio->bi_iter.bi_sector:s'
    Added new event:
    probe:submit_bio (on submit_bio with bi_sector=bio->bi_iter.bi_sector:s)

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

    perf record -e probe:submit_bio -aR sleep 1

    [root@jouet ~]# trace --no-syscalls --ev probe:submit_bio
    0.000 probe:submit_bio:(ffffffffac3aee00) bi_sector=7145704)
    0.017 probe:submit_bio:(ffffffffac3aee00) bi_sector=7145712)
    0.019 probe:submit_bio:(ffffffffac3aee00) bi_sector=7145720)
    2.567 probe:submit_bio:(ffffffffac3aee00) bi_sector=7145728)
    5631.919 probe:submit_bio:(ffffffffac3aee00) bi_sector=0)
    5631.941 probe:submit_bio:(ffffffffac3aee00) bi_sector=8)
    5631.945 probe:submit_bio:(ffffffffac3aee00) bi_sector=16)
    5631.948 probe:submit_bio:(ffffffffac3aee00) bi_sector=24)
    ^C#

    With callchains:

    # trace --no-syscalls --ev probe:submit_bio/max-stack=10/
    0.000 probe:submit_bio:(ffffffffac3aee00) bi_sector=50662544)
    submit_bio+0xa8200001 ([kernel.kallsyms])
    submit_bh+0xa8200013 ([kernel.kallsyms])
    jbd2_journal_commit_transaction+0xa8200691 ([kernel.kallsyms])
    kjournald2+0xa82000ca ([kernel.kallsyms])
    kthread+0xa82000d8 ([kernel.kallsyms])
    ret_from_fork+0xa820001f ([kernel.kallsyms])
    0.023 probe:submit_bio:(ffffffffac3aee00) bi_sector=50662552)
    submit_bio+0xa8200001 ([kernel.kallsyms])
    submit_bh+0xa8200013 ([kernel.kallsyms])
    jbd2_journal_commit_transaction+0xa8200691 ([kernel.kallsyms])
    kjournald2+0xa82000ca ([kernel.kallsyms])
    kthread+0xa82000d8 ([kernel.kallsyms])
    ret_from_fork+0xa820001f ([kernel.kallsyms])
    0.027 probe:submit_bio:(ffffffffac3aee00) bi_sector=50662560)
    submit_bio+0xa8200001 ([kernel.kallsyms])
    submit_bh+0xa8200013 ([kernel.kallsyms])
    jbd2_journal_commit_transaction+0xa8200691 ([kernel.kallsyms])
    kjournald2+0xa82000ca ([kernel.kallsyms])
    kthread+0xa82000d8 ([kernel.kallsyms])
    ret_from_fork+0xa820001f ([kernel.kallsyms])
    2.593 probe:submit_bio:(ffffffffac3aee00) bi_sector=50662568)
    submit_bio+0xa8200001 ([kernel.kallsyms])
    submit_bh+0xa8200013 ([kernel.kallsyms])
    journal_submit_commit_record+0xa82001ac ([kernel.kallsyms])
    jbd2_journal_commit_transaction+0xa82012e8 ([kernel.kallsyms])
    kjournald2+0xa82000ca ([kernel.kallsyms])
    kthread+0xa82000d8 ([kernel.kallsyms])
    ret_from_fork+0xa820001f ([kernel.kallsyms])
    ^C#

    Signed-off-by: Naohiro Aota
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Hemant Kumar
    Cc: Masami Hiramatsu
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1470710408-23515-1-git-send-email-naohiro.aota@hgst.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Naohiro Aota
     
  • When we don't have a tracee (i.e. we're attaching to a task or CPU),
    counters can still be running after our workload finishes, and can still
    be running as we read their values. As we read events one-by-one, there
    can be arbitrary skew between values of events, even within a group.
    This means that ratios within an event group are not reliable.

    This skew can be seen if measuring a group of identical events, e.g:

    # perf stat -a -C0 -e '{cycles,cycles}' sleep 1

    To avoid this, we must stop groups from counting before we read the
    values of any constituent events. This patch adds and makes use of a new
    disable_counters() helper, which disables group leaders (and thus each
    group as a whole). This mirrors the use of enable_counters() for
    starting event groups in the absence of a tracee.

    Closing a group leader splits the group, and without a disabled group
    leader the newly split events will begin counting. Thus to ensure counts
    are reliable we must defer closing group leaders until all counts have
    been read. To do so this patch removes the event closing logic from the
    read_counters() helper, explicitly closes the events using
    perf_evlist__close(), which also aids legibility.

    Signed-off-by: Mark Rutland
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1470747869-3567-1-git-send-email-mark.rutland@arm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Mark Rutland
     
  • If module is "module" then dso->short_name is "[module]". Substring
    comparing is't enough: "raid10" matches to "[raid1]". This patch also
    checks terminating zero in module name.

    Signed-off-by: Konstantin Khlebnikov
    Acked-by: Masami Hiramatsu
    Link: http://lkml.kernel.org/r/147039975648.715620.12985971832789032159.stgit@buzz
    Signed-off-by: Arnaldo Carvalho de Melo

    Konstantin Khlebnikov
     
  • Adjust map->reloc offset for the unmapped address when finding
    alternative symbol address from map, because KASLR can relocate the
    kernel symbol address.

    The same adjustment has been done when finding appropriate kernel symbol
    address from map which was introduced by commit f90acac75713 ("perf
    probe: Find given address from offline dwarf")

    Reported-by: Arnaldo Carvalho de Melo
    Signed-off-by: Masami Hiramatsu
    Cc: Alexei Starovoitov
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/20160806192948.e366f3fbc4b194de600f8326@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • When we use libtraceevent to format trace event fields into printable
    strings to use in hist entries it is important to trim it from the
    default 4 KiB it starts with to what is really used, to reduce the
    memory footprint, so use realloc(seq.buffer, seq.len + 1) when returning
    the seq.buffer formatted with the fields contents.

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

    Arnaldo Carvalho de Melo
     
  • This adds the 'bpf-output' field to the perf script usage message, and docs.

    Signed-off-by: Brendan Gregg
    Cc: Alexander Shishkin
    Cc: Alexei Starovoitov
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1470192469-11910-4-git-send-email-bgregg@netflix.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Brendan Gregg
     

08 Aug, 2016

1 commit


06 Aug, 2016

2 commits

  • Pull perf updates from Ingo Molnar:
    "Mostly tooling fixes and some late tooling updates, plus two perf
    related printk message fixes"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf tests bpf: Use SyS_epoll_wait alias
    perf tests: objdump output can contain multi byte chunks
    perf record: Add --sample-cpu option
    perf hists: Introduce output_resort_cb method
    perf tools: Move config/Makefile into Makefile.config
    perf tests: Add test for bitmap_scnprintf function
    tools lib: Add bitmap_and function
    tools lib: Add bitmap_scnprintf function
    tools lib: Add bitmap_alloc function
    tools lib traceevent: Ignore generated library files
    perf tools: Fix build failure on perl script context
    perf/core: Change log level for duration warning to KERN_INFO
    perf annotate: Plug filename string leak
    perf annotate: Introduce strerror for handling symbol__disassemble() errors
    perf annotate: Rename symbol__annotate() to symbol__disassemble()
    perf/x86: Modify error message in virtualized environment
    perf target: str_error_r() always returns the buffer it receives
    perf annotate: Use pipe + fork instead of popen
    perf evsel: Introduce constructor for cycles event

    Linus Torvalds
     
  • Pull NTB updates from Jon Mason:
    "NTB bug fixes for the ntb_tool and ntb_perf, and improvements to the
    ntb_perf and ntb_pingpong for increased debugability.

    Also, modification to the ntb_transport layer to increase/decrease
    the number of transport entries depending on the ring size"

    * tag 'ntb-4.8' of git://github.com/jonmason/ntb:
    NTB: ntb_hw_intel: use local variable pdev
    NTB: ntb_hw_intel: show BAR size in debugfs info
    ntb_test: Add a selftest script for the NTB subsystem
    ntb_perf: clear link_is_up flag when the link goes down.
    ntb_pingpong: Add a debugfs file to get the ping count
    ntb_tool: Add link status and files to debugfs
    ntb_tool: Postpone memory window initialization for the user
    ntb_perf: Wait for link before running test
    ntb_perf: Return results by reading the run file
    ntb_perf: Improve thread handling to increase robustness
    ntb_perf: Schedule based on time not on performance
    ntb_transport: Check the number of spads the hardware supports
    ntb_tool: Add memory window debug support
    ntb_perf: Allow limiting the size of the memory windows
    NTB: allocate number transport entries depending on size of ring size
    ntb_tool: BUG: Ensure the buffer size is large enough to return all spads
    ntb_tool: Fix infinite loop bug when writing spad/peer_spad file

    Linus Torvalds
     

05 Aug, 2016

2 commits

  • This script automates testing doorbells, scratchpads and memory windows
    for an NTB device. It can be run locally, with the NTB looped
    back to the same host or use SSH to remotely control the second host.

    In the single host case, the script just needs to be passed two
    arguments: a PCI ID for each side of the link. In the two host case
    the -r option must be used to specify the remote hostname (which must
    be SSH accessible and should probably have ssh-keys exchanged).

    A sample run looks like this:

    $ sudo ./ntb_test.sh 0000:03:00.1 0000:83:00.1 -p 29
    Starting ntb_tool tests...
    Running link tests on: 0000:03:00.1 / 0000:83:00.1
    Passed
    Running link tests on: 0000:83:00.1 / 0000:03:00.1
    Passed
    Running db tests on: 0000:03:00.1 / 0000:83:00.1
    Passed
    Running db tests on: 0000:83:00.1 / 0000:03:00.1
    Passed
    Running spad tests on: 0000:03:00.1 / 0000:83:00.1
    Passed
    Running spad tests on: 0000:83:00.1 / 0000:03:00.1
    Passed
    Running mw0 tests on: 0000:03:00.1 / 0000:83:00.1
    Passed
    Running mw0 tests on: 0000:83:00.1 / 0000:03:00.1
    Passed
    Running mw1 tests on: 0000:03:00.1 / 0000:83:00.1
    Passed
    Running mw1 tests on: 0000:83:00.1 / 0000:03:00.1
    Passed

    Starting ntb_pingpong tests...
    Running ping pong tests on: 0000:03:00.1 / 0000:83:00.1
    Passed

    Starting ntb_perf tests...
    Running local perf test without DMA
    0: copied 536870912 bytes in 164453 usecs, 3264 MBytes/s
    Passed
    Running remote perf test without DMA
    0: copied 536870912 bytes in 164453 usecs, 3264 MBytes/s
    Passed

    Signed-off-by: Logan Gunthorpe
    Acked-by: Shuah Khan
    Acked-by: Allen Hubbe
    Signed-off-by: Jon Mason

    Logan Gunthorpe
     
  • Pull RTC updates from Alexandre Belloni:
    "RTC for 4.8

    Cleanups:
    - huge cleanup of rtc-generic and char/genrtc this allowed to cleanup
    rtc-cmos, rtc-sh, rtc-m68k, rtc-powerpc and rtc-parisc
    - move mn10300 to rtc-cmos

    Subsystem:
    - fix wakealarms after hibernate
    - multiples fixes for rctest
    - simplify implementations of .read_alarm

    New drivers:
    - Maxim MAX6916

    Drivers:
    - ds1307: fix weekday
    - m41t80: add wakeup support
    - pcf85063: add support for PCF85063A variant
    - rv8803: extend i2c fix and other fixes
    - s35390a: fix alarm reading, this fixes instant reboot after
    shutdown for QNAP TS-41x
    - s3c: clock fixes"

    * tag 'rtc-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (65 commits)
    rtc: rv8803: Clear V1F when setting the time
    rtc: rv8803: Stop the clock while setting the time
    rtc: rv8803: Always apply the I²C workaround
    rtc: rv8803: Fix read day of week
    rtc: rv8803: Remove the check for valid time
    rtc: rv8803: Kconfig: Indicate rx8900 support
    rtc: asm9260: remove .owner field for driver
    rtc: at91sam9: Fix missing spin_lock_init()
    rtc: m41t80: add suspend handlers for alarm IRQ
    rtc: m41t80: make it a real error message
    rtc: pcf85063: Add support for the PCF85063A device
    rtc: pcf85063: fix year range
    rtc: hym8563: in .read_alarm set .tm_sec to 0 to signal minute accuracy
    rtc: explicitly set tm_sec = 0 for drivers with minute accurancy
    rtc: s3c: Add s3c_rtc_{enable/disable}_clk in s3c_rtc_setfreq()
    rtc: s3c: Remove unnecessary call to disable already disabled clock
    rtc: abx80x: use devm_add_action_or_reset()
    rtc: m41t80: use devm_add_action_or_reset()
    rtc: fix a typo and reduce three empty lines to one
    rtc: s35390a: improve two comments in .set_alarm
    ...

    Linus Torvalds
     

04 Aug, 2016

2 commits

  • …ernel/git/acme/linux into perf/urgent

    Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

    New features:

    - Add --sample-cpu to 'perf record', to explicitely ask for sampling
    the CPU (Jiri Olsa)

    Fixes:

    - Fix processing of multi byte chunks in objdump output, fixing
    disassemble processing for annotation on at least ARM64 (Jan Stancek)

    - Use SyS_epoll_wait in a BPF 'perf test' entry instead of sys_epoll_wait, that
    is not present in the DWARF info in vmlinux files (Arnaldo Carvalho de Melo)

    - Add -wno-shadow when processing files using perl headers, fixing
    the build on Fedora Rawhide and Arch Linux (Namhyung Kim)

    Infrastructure changes:

    - Annotate prep work to better catch and report errors related to
    using objdump to disassemble DSOs (Arnaldo Carvalho de Melo)

    - Add 'alloc', 'scnprintf' and 'and' methods for bitmap processing (Jiri Olsa)

    - Add nested output resorting callback in hists processing (Jiri Olsa)

    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     
  • Something made the sys_epoll_wait() function alias not to be found in
    the vmlinux DWARF info, being found only in /proc/kallsyms, which made
    the BPF perf tests to fail:

    [root@jouet ~]# perf test BPF
    37: Test BPF filter :
    37.1: Test basic BPF filtering : FAILED!
    37.2: Test BPF prologue generation : Skip
    37.3: Test BPF relocation checker : Skip
    [root@jouet ~]#

    Using -v we can see it is failing to find DWARF info for the probed function,
    sys_epoll_wait, which we can find in /proc/kallsyms but not in vmlinux with
    CONFIG_DEBUG_INFO:

    [root@jouet ~]# grep -w sys_epoll_wait /proc/kallsyms
    ffffffffbd295b50 T sys_epoll_wait
    [root@jouet ~]#

    [root@jouet ~]# readelf -wi /lib/modules/4.7.0+/build/vmlinux | grep -w sys_epoll_wait
    [root@jouet ~]#

    If we try to use perf probe:

    [root@jouet ~]# perf probe sys_epoll_wait
    Failed to find debug information for address ffffffffbd295b50
    Probe point 'sys_epoll_wait' not found.
    Error: Failed to add events.
    [root@jouet ~]#

    It all works if we use SyS_epoll_wait, that is just an alias to the probed
    function:

    [root@jouet ~]# grep -i sys_epoll_wait /proc/kallsyms
    ffffffffbd295b50 T SyS_epoll_wait
    ffffffffbd295b50 T sys_epoll_wait
    [root@jouet ~]#

    So use it:

    [root@jouet ~]# perf test BPF
    37: Test BPF filter :
    37.1: Test basic BPF filtering : Ok
    37.2: Test BPF prologue generation : Ok
    37.3: Test BPF relocation checker : Ok
    [root@jouet ~]#

    Further info:

    [root@jouet ~]# gcc --version
    gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3)
    [acme@jouet linux]$ cat /etc/fedora-release
    Fedora release 24 (Twenty Four)

    Investigation as to why it fails is still underway, but it was always
    going from sys_epoll_wait to SyS_epoll_wait when looking up the DWARF
    info in vmlinux, and this is what is breaking now.

    Switching to use SyS_epoll_wait allows this test to proceed and test the
    BPF code it was designed for, so lets have this in to allow passing this
    test while we fix the root cause.

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

    Arnaldo Carvalho de Melo