21 Aug, 2020

2 commits

  • [ Upstream commit fa5c893181ed2ca2f96552f50073786d2cfce6c0 ]

    When using a cross-compilation environment, such as OpenEmbedded,
    the CC an CXX variables are set to something more than just a
    command: there are arguments (such as --sysroot) that need to be
    passed on to the compiler so that the right set of headers and
    libraries are used.

    For the particular case that our systems detected, CC is set to
    the following:

    export CC="aarch64-linaro-linux-gcc --sysroot=/oe/build/tmp/work/machine/perf/1.0-r9/recipe-sysroot"

    Without quotes, detection is as follows:

    Auto-detecting system features:
    ... dwarf: [ OFF ]
    ... dwarf_getlocations: [ OFF ]
    ... glibc: [ OFF ]
    ... gtk2: [ OFF ]
    ... libbfd: [ OFF ]
    ... libcap: [ OFF ]
    ... libelf: [ OFF ]
    ... libnuma: [ OFF ]
    ... numa_num_possible_cpus: [ OFF ]
    ... libperl: [ OFF ]
    ... libpython: [ OFF ]
    ... libcrypto: [ OFF ]
    ... libunwind: [ OFF ]
    ... libdw-dwarf-unwind: [ OFF ]
    ... zlib: [ OFF ]
    ... lzma: [ OFF ]
    ... get_cpuid: [ OFF ]
    ... bpf: [ OFF ]
    ... libaio: [ OFF ]
    ... libzstd: [ OFF ]
    ... disassembler-four-args: [ OFF ]

    Makefile.config:414: *** No gnu/libc-version.h found, please install glibc-dev[el]. Stop.
    Makefile.perf:230: recipe for target 'sub-make' failed
    make[1]: *** [sub-make] Error 2
    Makefile:69: recipe for target 'all' failed
    make: *** [all] Error 2

    With CC and CXX quoted, some of those features are now detected.

    Fixes: e3232c2f39ac ("tools build feature: Use CC and CXX from parent")
    Signed-off-by: Daniel Díaz
    Reviewed-by: Thomas Hebb
    Cc: Alexei Starovoitov
    Cc: Andrii Nakryiko
    Cc: Daniel Borkmann
    Cc: Jiri Olsa
    Cc: John Fastabend
    Cc: KP Singh
    Cc: Martin KaFai Lau
    Cc: Namhyung Kim
    Cc: Song Liu
    Cc: Stephane Eranian
    Cc: Yonghong Song
    Link: http://lore.kernel.org/lkml/20200812221518.2869003-1-daniel.diaz@linaro.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin

    Daniel Díaz
     
  • [ Upstream commit e3232c2f39acafd5a29128425bc30b9884642cfa ]

    commit c8c188679ccf ("tools build: Use the same CC for feature detection
    and actual build") changed these assignments from unconditional (:=) to
    conditional (?=) so that they wouldn't clobber values from the
    environment. However, conditional assignment does not work properly for
    variables that Make implicitly sets, among which are CC and CXX. To
    quote tools/scripts/Makefile.include, which handles this properly:

    # Makefiles suck: This macro sets a default value of $(2) for the
    # variable named by $(1), unless the variable has been set by
    # environment or command line. This is necessary for CC and AR
    # because make sets default values, so the simpler ?= approach
    # won't work as expected.

    In other words, the conditional assignments will not run even if the
    variables are not overridden in the environment; Make will set CC to
    "cc" and CXX to "g++" when it starts[1], meaning the variables are not
    empty by the time the conditional assignments are evaluated. This breaks
    cross-compilation when CROSS_COMPILE is set but CC isn't, since "cc"
    gets used for feature detection instead of the cross compiler (and
    likewise for CXX).

    To fix the issue, just pass down the values of CC and CXX computed by
    the parent Makefile, which gets included by the Makefile that actually
    builds whatever we're detecting features for and so is guaranteed to
    have good values. This is a better solution anyway, since it means we
    aren't trying to replicate the logic of the parent build system and so
    don't risk it getting out of sync.

    Leave PKG_CONFIG alone, since 1) there's no common logic to compute it
    in Makefile.include, and 2) it's not an implicit variable, so
    conditional assignment works properly.

    [1] https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

    Fixes: c8c188679ccf ("tools build: Use the same CC for feature detection and actual build")
    Signed-off-by: Thomas Hebb
    Acked-by: Jiri Olsa
    Cc: David Carrillo-Cisneros
    Cc: Ian Rogers
    Cc: Igor Lubashev
    Cc: Namhyung Kim
    Cc: Quentin Monnet
    Cc: Song Liu
    Cc: Stephane Eranian
    Cc: thomas hebb
    Link: http://lore.kernel.org/lkml/0a6e69d1736b0fa231a648f50b0cce5d8a6734ef.1595822871.git.tommyhebb@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin

    Thomas Hebb
     

19 Aug, 2020

1 commit

  • [ Upstream commit a278f3d8191228212c553a5d4303fa603214b717 ]

    The '&&' command seems to have a bad effect when $(cmd_$(1)) exits with
    non-zero effect: the command failure is masked (despite `set -e`) and all but
    the first command of $(dep-cmd) is executed (successfully, as they are mostly
    printfs), thus overall returning 0 in the end.

    This means in practice that despite compilation errors, tools's build Makefile
    will return success. We see this very reliably with libbpf's Makefile, which
    doesn't get compilation error propagated properly. This in turns causes issues
    with selftests build, as well as bpftool and other projects that rely on
    building libbpf.

    The fix is simple: don't use &&. Given `set -e`, we don't need to chain
    commands with &&. The shell will exit on first failure, giving desired
    behavior and propagating error properly.

    Fixes: 275e2d95591e ("tools build: Move dependency copy into function")
    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Daniel Borkmann
    Acked-by: Jiri Olsa
    Link: https://lore.kernel.org/bpf/20200731024244.872574-1-andriin@fb.com
    Signed-off-by: Sasha Levin

    Andrii Nakryiko
     

13 Aug, 2019

1 commit

  • Add utilities to help checking capabilities of the running procss. Make
    perf link with libcap, if it is available. If no libcap-dev[el], assume
    no capabilities.

    Committer testing:

    $ make O=/tmp/build/perf -C tools/perf install-bin
    make: Entering directory '/home/acme/git/perf/tools/perf'
    BUILD: Doing 'make -j8' parallel build

    Auto-detecting system features:

    ... libbfd: [ on ]
    ... libcap: [ OFF ]
    ... libelf: [ on ]

    Makefile.config:833: No libcap found, disables capability support, please install libcap-devel/libcap-dev

    $ grep libcap /tmp/build/perf/FEATURE-DUMP
    feature-libcap=0
    $ cat /tmp/build/perf/feature/test-libcap.make.output
    test-libcap.c:2:10: fatal error: sys/capability.h: No such file or directory
    2 | #include
    | ^~~~~~~~~~~~~~~~~~
    compilation terminated.
    $

    Now install libcap-devel and try again:

    $ make O=/tmp/build/perf -C tools/perf install-bin
    make: Entering directory '/home/acme/git/perf/tools/perf'
    BUILD: Doing 'make -j8' parallel build
    Warning: Kernel ABI header at 'tools/include/linux/bits.h' differs from latest version at 'include/linux/bits.h'
    diff -u tools/include/linux/bits.h include/linux/bits.h
    Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
    diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h

    Auto-detecting system features:

    ... libbfd: [ on ]
    ... libcap: [ on ]
    ... libelf: [ on ]
    >
    CC /tmp/build/perf/jvmti/libjvmti.o
    >
    $ grep libcap /tmp/build/perf/FEATURE-DUMP
    feature-libcap=1
    $ cat /tmp/build/perf/feature/test-libcap.make.output
    $ ldd /tmp/build/perf/feature/test-libcap.make.bin
    ldd: /tmp/build/perf/feature/test-libcap.make.bin: No such file or directory
    $ ldd /tmp/build/perf/feature/test-libcap.bin
    linux-vdso.so.1 (0x00007ffc35bfe000)
    libcap.so.2 => /lib64/libcap.so.2 (0x00007ff9c62ff000)
    libc.so.6 => /lib64/libc.so.6 (0x00007ff9c6139000)
    /lib64/ld-linux-x86-64.so.2 (0x00007ff9c6326000)
    $

    Signed-off-by: Igor Lubashev
    Acked-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Alexey Budankov
    Cc: James Morris
    Cc: Mathieu Poirier
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Suzuki Poulouse
    [ split from a larger patch ]
    Link: http://lkml.kernel.org/r/8a1e76cf5c7c9796d0d4d240fbaa85305298aafa.1565188228.git.ilubashe@akamai.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Igor Lubashev
     

19 Jun, 2019

2 commits

  • We were renanimg 'main' to 'main_zstd' but then using 'main_libzstd();'
    in the main() for test-all.c, causing this:

    $ cat /tmp/build/perf/feature/test-all.make.output
    test-all.c: In function ‘main’:
    test-all.c:236:2: error: implicit declaration of function ‘main_test_libzstd’; did you mean ‘main_test_zstd’? [-Werror=implicit-function-declaration]
    main_test_libzstd();
    ^~~~~~~~~~~~~~~~~
    main_test_zstd
    cc1: all warnings being treated as errors
    $

    I.e. what was supposed to be the fast path feature test was _always_
    failing, duh, fix it.

    Cc: Adrian Hunter
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Alexey Budankov
    Fixes: 3b1c5d965971 ("tools build: Implement libzstd feature check, LIBZSTD_DIR and NO_LIBZSTD defines")
    Link: https://lkml.kernel.org/n/tip-ma4abk0utroiw4mwpmvnjlru@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • A few odd old distros (rhel5, 6, yeah, lots of those out in use, in many
    cases we want to use upstream perf on it) have the slang header files in
    /usr/include/slang/, so add a test that will be performed only when
    test-all.c (the one with the most common sane settings) fails, either
    because we're in one of these odd distros with slang/slang.h or because
    something else failed (say libelf is not present).

    So for the common case nothing changes, no additional test is performed.

    Next step is to check in perf the result of these tests.

    Cc: Adrian Hunter
    Cc: Florian Fainelli
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Fixes: 1955c8cf5e26 ("perf tools: Don't hardcode host include path for libslang")
    Link: https://lkml.kernel.org/n/tip-2sy7hbwkx68jr6n97qxgg0c6@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

18 Jun, 2019

3 commits

  • Hardcoding /usr/include/slang is fundamentally incompatible with cross
    compilation and will lead to the inability for a cross-compiled
    environment to properly detect whether slang is available or not.

    If /usr/include/slang is necessary that is a distribution specific
    knowledge that could be solved with either a standard pkg-config .pc
    file (which slang has) or simply overriding CFLAGS accordingly, but the
    default perf Makefile should be clean of all of that.

    Signed-off-by: Florian Fainelli
    Cc: Alexander Shishkin
    Cc: Alexey Budankov
    Cc: bcm-kernel-feedback-list@broadcom.com
    Cc: Jakub Kicinski
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Quentin Monnet
    Cc: Stanislav Fomichev
    Fixes: ef7b93a11904 ("perf report: Librarize the annotation code and use it in the newt browser")
    Link: http://lkml.kernel.org/r/20190614183949.5588-1-f.fainelli@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Florian Fainelli
     
  • Cc: Adrian Hunter
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-3h6fa866w6ao0wsbyqz9nrm8@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Laura reported that the perf build failed in fedora when we got a glibc
    that provides gettid(), which I reproduced using fedora rawhide with the
    glibc-devel-2.29.9000-26.fc31.x86_64 package.

    Add a feature check to avoid providing a gettid() helper in such
    systems.

    On a fedora rawhide system with this patch applied we now get:

    [root@7a5f55352234 perf]# grep gettid /tmp/build/perf/FEATURE-DUMP
    feature-gettid=1
    [root@7a5f55352234 perf]# cat /tmp/build/perf/feature/test-gettid.make.output
    [root@7a5f55352234 perf]# ldd /tmp/build/perf/feature/test-gettid.bin
    linux-vdso.so.1 (0x00007ffc6b1f6000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f04e0a74000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f04e0c47000)
    [root@7a5f55352234 perf]# nm /tmp/build/perf/feature/test-gettid.bin | grep -w gettid
    U gettid@@GLIBC_2.30
    [root@7a5f55352234 perf]#

    While on a fedora:29 system:

    [acme@quaco perf]$ grep gettid /tmp/build/perf/FEATURE-DUMP
    feature-gettid=0
    [acme@quaco perf]$ cat /tmp/build/perf/feature/test-gettid.make.output
    test-gettid.c: In function ‘main’:
    test-gettid.c:8:9: error: implicit declaration of function ‘gettid’; did you mean ‘getgid’? [-Werror=implicit-function-declaration]
    return gettid();
    ^~~~~~
    getgid
    cc1: all warnings being treated as errors
    [acme@quaco perf]$

    Reported-by: Laura Abbott
    Tested-by: Laura Abbott
    Acked-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Florian Weimer
    Cc: Namhyung Kim
    Cc: Stephane Eranian
    Link: https://lkml.kernel.org/n/tip-yfy3ch53agmklwu9o7rlgf9c@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

21 May, 2019

1 commit


02 Apr, 2019

1 commit

  • Implement libzstd feature check, NO_LIBZSTD and LIBZSTD_DIR defines to
    override Zstd library sources or disable the feature from the command
    line:

    $ make -C tools/perf LIBZSTD_DIR=/path/to/zstd/sources/ clean all
    $ make -C tools/perf NO_LIBZSTD=1 clean all

    Auto detection feature status is reported just before compilation
    starts. If your system has some version of the zstd library
    preinstalled then the build system finds and uses it during the build.

    If you still prefer to compile with some other version of zstd library
    you have capability to refer the compilation to that version using
    LIBZSTD_DIR define.

    Signed-off-by: Alexey Budankov
    Reviewed-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/9b4cd8b0-10a3-1f1e-8d6b-5922a7ca216b@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexey Budankov
     

29 Mar, 2019

1 commit

  • The following error was thrown when compiling `tools/perf` using OpenCSD
    v0.11.1. This patch fixes said error.

    CC util/intel-pt-decoder/intel-pt-log.o
    CC util/cs-etm-decoder/cs-etm-decoder.o
    util/cs-etm-decoder/cs-etm-decoder.c: In function
    ‘cs_etm_decoder__buffer_range’:
    util/cs-etm-decoder/cs-etm-decoder.c:370:2: error: enumeration value
    ‘OCSD_INSTR_WFI_WFE’ not handled in switch [-Werror=switch-enum]
    switch (elem->last_i_type) {
    ^~~~~~
    CC util/intel-pt-decoder/intel-pt-decoder.o
    cc1: all warnings being treated as errors

    Because `OCSD_INSTR_WFI_WFE` case was added only in v0.11.0, the minimum
    required OpenCSD library version for this patch is no longer v0.10.0.

    Signed-off-by: Solomon Tan
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Mathieu Poirier
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Robert Walker
    Cc: Suzuki K Poulouse
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/20190322052255.GA4809@w-OptiPlex-7050
    Signed-off-by: Arnaldo Carvalho de Melo

    Solomon Tan
     

21 Mar, 2019

1 commit

  • Commit 003ca0fd2286 ("Refactor disassembler selection") in the binutils
    repo, which changed the disassembler() function signature, so we must
    use the feature test introduced in fb982666e380 ("tools/bpftool: fix
    bpftool build with bintutils >= 2.9") to deal with that.

    Committer testing:

    After adding the missing function call to test-all.c, and:

    FEATURE_CHECK_LDFLAGS-disassembler-four-args = -bfd -lopcodes

    And the fallbacks for cases where we need -liberty and sometimes -lz to
    tools/perf/Makefile.config, we get:

    $ make -C tools/perf O=/tmp/build/perf install-bin
    make: Entering directory '/home/acme/git/perf/tools/perf'
    BUILD: Doing 'make -j8' parallel build

    Auto-detecting system features:
    ... dwarf: [ on ]
    ... dwarf_getlocations: [ on ]
    ... glibc: [ on ]
    ... gtk2: [ on ]
    ... libaudit: [ on ]
    ... libbfd: [ on ]
    ... libelf: [ on ]
    ... libnuma: [ on ]
    ... numa_num_possible_cpus: [ on ]
    ... libperl: [ on ]
    ... libpython: [ on ]
    ... libslang: [ on ]
    ... libcrypto: [ on ]
    ... libunwind: [ on ]
    ... libdw-dwarf-unwind: [ on ]
    ... zlib: [ on ]
    ... lzma: [ on ]
    ... get_cpuid: [ on ]
    ... bpf: [ on ]
    ... libaio: [ on ]
    ... disassembler-four-args: [ on ]
    CC /tmp/build/perf/jvmti/libjvmti.o
    CC /tmp/build/perf/builtin-bench.o

    $
    $

    The feature detection test-all.bin gets successfully built and linked:

    $ ls -la /tmp/build/perf/feature/test-all.bin
    -rwxrwxr-x. 1 acme acme 2680352 Mar 19 11:07 /tmp/build/perf/feature/test-all.bin
    $ nm /tmp/build/perf/feature/test-all.bin | grep -w disassembler
    0000000000061f90 T disassembler
    $

    Time to move on to the patches that make use of this disassembler()
    routine in binutils's libopcodes.

    Signed-off-by: Song Liu
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexei Starovoitov
    Cc: Daniel Borkmann
    Cc: Jakub Kicinski
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Roman Gushchin
    Cc: Stanislav Fomichev
    Link: http://lkml.kernel.org/r/20190312053051.2690567-13-songliubraving@fb.com
    [ split from a larger patch, added missing FEATURE_CHECK_LDFLAGS-disassembler-four-args ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Song Liu
     

15 Feb, 2019

5 commits

  • Since this feature test is included in test-all.c, the feature detection
    fast path compile/link phase, it can't leave any defines behind, as it
    can affect the tests included after it, so remove it.

    Reported-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Alexei Starovoitov
    Cc: Andrii Nakryiko
    Cc: Daniel Borkmann
    Cc: Jakub Kicinski
    Cc: Jin Yao
    Cc: Namhyung Kim
    Cc: Song Liu
    Cc: Yonghong Song
    Link: https://lkml.kernel.org/n/tip-lg3kpd9tzypc797vb1f42u6k@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • When a test is in the FEATURE_TESTS_BASIC list in tools/build/Makefile.feature
    must be added to tools/build/feature/test-all.c, because the successfull
    compilation and linking of that test-all.bin file means that all the
    features listed in FEATURE_TESTS_BASIC are present in the system, so we
    don't have to go on feature by feature test building them.

    Since reallocarray() is expected to be present in modern systems, it has
    a place in FEATURE_TESTS_BASIC, so that we speed up the build process
    building just that file.

    For older systems, such as ubuntu:16.04 (build failure reported by Jin
    Yao) debian:8, and for the current flagship RHEL distro, RHEL7, the
    build will fail as test-all.bin (without test-reallocarray.c included)
    passes but reallocarray() isn't present, making the build fail with:

    CC /tmp/build/perf/libbpf.o
    MKDIR /tmp/build/perf/fs/
    CC /tmp/build/perf/fs/tracing_path.o
    LD /tmp/build/perf/fd/libapi-in.o
    CC /tmp/build/perf/bpf.o
    libbpf.c: In function 'bpf_object__add_program':
    libbpf.c:367:10: error: implicit declaration of function 'reallocarray' [-Werror=implicit-function-declaration]
    progs = reallocarray(progs, nr_progs + 1, sizeof(progs[0]));
    ^
    libbpf.c:367:2: error: nested extern declaration of 'reallocarray' [-Werror=nested-externs]
    progs = reallocarray(progs, nr_progs + 1, sizeof(progs[0]));
    ^
    libbpf.c:367:8: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
    progs = reallocarray(progs, nr_progs + 1, sizeof(progs[0]));
    ^
    libbpf.c: In function 'bpf_object__elf_collect':
    libbpf.c:887:10: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
    reloc = reallocarray(reloc, nr_reloc,
    ^
    libbpf.c: In function 'bpf_program__reloc_text':
    libbpf.c:1394:12: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
    new_insn = reallocarray(prog->insns, new_cnt, sizeof(*insn));
    ^
    CC /tmp/build/perf/nlattr.o

    Even with:

    $ grep reallocarray /tmp/build/perf/FEATURE-DUMP
    feature-reallocarray=1
    $

    Which ubuntu:16.04.5 LTS doesn't have:

    perfbuilder@38a153a1bba8:/$ head -2 /etc/os-release
    NAME="Ubuntu"
    VERSION="16.04.5 LTS (Xenial Xerus)"
    perfbuilder@38a153a1bba8:/$ find /usr/include/ -name "*.h" | xargs grep -w reallocarray
    perfbuilder@38a153a1bba8:/$

    Fix it by including it to test-all.c, which ends up forcing the
    individual tests to be triggered and for the build process to notice
    that indeed reallocarray() is not there:

    perfbuilder@38a153a1bba8:/$ cat /tmp/build/perf/feature/test-all.make.output
    In file included from test-all.c:178:0:
    test-reallocarray.c: In function 'main_test_reallocarray':
    test-reallocarray.c:7:11: error: implicit declaration of function 'reallocarray' [-Werror=implicit-function-declaration]
    return !!reallocarray(NULL, 1, 1);
    ^
    cc1: all warnings being treated as errors
    perfbuilder@38a153a1bba8:/$

    That is the only test that is failing on Ubuntu 16.03.5 LTS, so all
    tests are forced:

    perfbuilder@38a153a1bba8:/tmp/build/perf/feature$ ls -lSr *.make.output

    -rw-r--r--. 1 perfbuilder perfbuilder 0 Feb 14 15:00 test-dwarf.make.output
    -rw-r--r--. 1 perfbuilder perfbuilder 0 Feb 14 14:16 test-cplus-demangle.make.output
    -rw-r--r--. 1 perfbuilder perfbuilder 0 Feb 14 15:00 test-bpf.make.output
    -rw-r--r--. 1 perfbuilder perfbuilder 0 Feb 14 15:00 test-backtrace.make.output
    -rw-r--r--. 1 perfbuilder perfbuilder 104 Feb 14 15:00 test-bionic.make.output
    -rw-r--r--. 1 perfbuilder perfbuilder 107 Feb 14 15:00 test-libunwind-x86.make.output
    -rw-r--r--. 1 perfbuilder perfbuilder 115 Feb 14 15:00 test-libunwind-aarch64.make.output
    -rw-r--r--. 1 perfbuilder perfbuilder 122 Feb 14 15:00 test-libbabeltrace.make.output
    -rw-r--r--. 1 perfbuilder perfbuilder 254 Feb 14 15:00 test-reallocarray.make.output
    -rw-r--r--. 1 perfbuilder perfbuilder 312 Feb 14 15:00 test-all.make.output
    perfbuilder@38a153a1bba8:/tmp/build/perf/feature$

    And that reallocarray() one shows:

    perfbuilder@38a153a1bba8:/tmp/build/perf/feature$ cat test-reallocarray.make.output
    test-reallocarray.c: In function 'main':
    test-reallocarray.c:7:11: error: implicit declaration of function 'reallocarray' [-Werror=implicit-function-declaration]
    return !!reallocarray(NULL, 1, 1);
    ^
    cc1: all warnings being treated as errors
    perfbuilder@38a153a1bba8:/tmp/build/perf/feature$

    Which now generates the expected result:

    perfbuilder@38a153a1bba8:~$ grep reallocarray /tmp/build/perf/FEATURE-DUMP
    feature-reallocarray=0
    perfbuilder@38a153a1bba8:~$

    The fallback mechanism kicks in and libbpf and perf are again buildable
    in systems without reallocarray():

    $ cat tools/include/tools/libc_compat.h
    // SPDX-License-Identifier: (LGPL-2.0+ OR BSD-2-Clause)
    /* Copyright (C) 2018 Netronome Systems, Inc. */

    #ifndef __TOOLS_LIBC_COMPAT_H
    #define __TOOLS_LIBC_COMPAT_H

    #include
    #include

    #ifdef COMPAT_NEED_REALLOCARRAY
    static inline void *reallocarray(void *ptr, size_t nmemb, size_t size)
    {
    size_t bytes;

    if (unlikely(check_mul_overflow(nmemb, size, &bytes)))
    return NULL;
    return realloc(ptr, bytes);
    }
    #endif
    #endif
    $

    Reported-by: Jin Yao
    Acked-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Alexei Starovoitov
    Cc: Andrii Nakryiko
    Cc: Daniel Borkmann
    Cc: Jakub Kicinski
    Cc: Namhyung Kim
    Cc: Song Liu
    Cc: Yonghong Song
    Fixes: 531b014e7a2f ("tools: bpf: make use of reallocarray")
    Link: https://lkml.kernel.org/n/tip-aonqku8axii8rxki5g11w40b@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • As it is not normally available on x86_64 not being tested on test-all.c
    but being in FEATURE_TESTS_BASIC ends up implying that those features
    are present, which leads to trying to link with those libraries and a
    build failure now that test-all.c is finally again building
    successfully:

    /usr/bin/ld: cannot find -lunwind-x86
    /usr/bin/ld: cannot find -lunwind-aarch64
    collect2: error: ld returned 1 exit status
    make[3]: *** [Makefile:199: /tmp/build/perf/plugin_jbd2.so] Error 1
    make[3]: *** Waiting for unfinished jobs....
    /usr/bin/ld: cannot find -lunwind-x86
    /usr/bin/ld: cannot find -lunwind-aarch64

    So remove those features from there and explicitely test them.

    And then move this patch to just before the last one that allows this to
    be exposed, so that we keep the tree bisectable.

    With all this in place we get, at this point:

    $ ldd /tmp/build/perf/feature/test-libunwind.bin
    linux-vdso.so.1 (0x00007fffa09c6000)
    libunwind-x86_64.so.8 => /lib64/libunwind-x86_64.so.8 (0x00007fbcf4451000)
    libunwind.so.8 => /lib64/libunwind.so.8 (0x00007fbcf4435000)
    liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fbcf440c000)
    libelf.so.1 => /lib64/libelf.so.1 (0x00007fbcf43f2000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fbcf422c000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fbcf4211000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fbcf4491000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fbcf41ed000)
    libz.so.1 => /lib64/libz.so.1 (0x00007fbcf41d3000)
    $ cat /tmp/build/perf/feature/test-libunwind-x86.make.output
    test-libunwind-x86.c:2:10: fatal error: libunwind-x86.h: No such file or directory
    #include
    ^~~~~~~~~~~~~~~~~
    compilation terminated.
    $ cat /tmp/build/perf/feature/test-libunwind-aarch64.make.output
    test-libunwind-aarch64.c:2:10: fatal error: libunwind-aarch64.h: No such file or directory
    #include
    ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    $
    $ ldd ~/bin/perf | grep unwind
    libunwind-x86_64.so.8 => /lib64/libunwind-x86_64.so.8 (0x00007f5ceb24b000)
    libunwind.so.8 => /lib64/libunwind.so.8 (0x00007f5ceb22f000)
    $

    Cc: Adrian Hunter
    Cc: He Kuang
    Cc: Jean Pihet
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Cc: Will Deacon
    Link: https://lkml.kernel.org/n/tip-vs6kwqsvwk7oxhs6z9mq87pp@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Since it is not yet that generally available, avoid testing for the
    presence of libcoresight in the fast path test-all.bin feature test.

    # dnf search opencsd
    No matches found.
    # dnf search OpenCSD
    No matches found.
    # cat /etc/fedora-release
    Fedora release 29 (Twenty Nine)
    #

    I.e. right now, in my system test-all.bin is failing all the time since
    Fedora29 doesn't have libopencsd available:

    $ cat /tmp/build/perf/feature/test-all.make.output
    In file included from test-all.c:174:
    test-libopencsd.c:2:10: fatal error: opencsd/c_api/opencsd_c_api.h: No such file or directory
    #include
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.

    See:

    6ab2b762befd ("perf build: Disable libbabeltrace check by default")

    For the rationale, as soon as libopencsd becomes more generally packaged
    and available, we do the same thing we did with babeltrace, enabling it
    by default, as done in:

    24787afbcd01 ("perf tools: Enable LIBBABELTRACE by default")

    For now, to explicitely ask for opencsd, make sure you have it installed
    and use:

    make -C tools/perf CORESIGHT=1

    The feature test output will be there as an empty file:

    $ ls -la /tmp/build/perf/feature/test-libopencsd.make.output

    Because the binary used for the feature check was successfully built:

    $ ls -la /tmp/build/perf/feature/test-libopencsd.bin
    -rwxrwxr-x. 1 acme acme 18336 Feb 12 14:49 /tmp/build/perf/feature/test-libopencsd.bin
    $ ldd /tmp/build/perf/feature/test-libopencsd.bin
    linux-vdso.so.1 (0x00007fffe18cc000)
    libopencsd_c_api.so.0 => /lib64/libopencsd_c_api.so.0 (0x00007fb8e67f6000)
    libopencsd.so.0 => /lib64/libopencsd.so.0 (0x00007fb8e676f000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fb8e65a9000)
    libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fb8e6411000)
    libm.so.6 => /lib64/libm.so.6 (0x00007fb8e628d000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fb8e6272000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fb8e6828000)
    $

    And the resulting perf binary will be linked with it:

    -rw-rw-r--. 1 acme acme 0 Feb 12 14:49 /tmp/build/perf/feature/test-libopencsd.make.output
    $ ldd ~/bin/perf | grep opencsd
    libopencsd_c_api.so.0 => /lib64/libopencsd_c_api.so.0 (0x00007fd43097f000)
    libopencsd.so.0 => /lib64/libopencsd.so.0 (0x00007fd4308f8000)
    $

    To make sure this gets built before pushing things upstream I have a
    ubuntu:19.04-x-arm64 container that has:

    [root@quaco x-arm64]# grep CORESIGHT Dockerfile
    ENV EXTRA_MAKE_ARGS=CORESIGHT=1
    [root@quaco x-arm64]#

    So that I always build with libopencsd before pushing things upstream.

    Cc: Adrian Hunter
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Kim Phillips
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Mathieu Poirier
    Cc: Mike Leach
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Suzuki Poulouse
    Link: https://lkml.kernel.org/n/tip-20vyy39jw9jgrijesi30fgox@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Since we get all the tests in a single .c file for a first test,
    tools/build/feature/test-all.c, if individual tests set that define and
    fail to undef it at its end, then it the test-all.c build will fail due
    to defining _GNU_SOURCE multiple times, getting us to the slow path,
    so undef it at the end in tests that define it.

    Cc: Adrian Hunter
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-w6s00jfo1xabgphzczadl59b@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

21 Dec, 2018

1 commit

  • Current libbfd feature test unconditionally links against -liberty and -lz.
    While it's required on some systems (e.g. opensuse), it's completely
    unnecessary on the others, where only -lbdf is sufficient (debian).
    This patch streamlines (and renames) the following feature checks:

    feature-libbfd - only link against -lbfd (debian),
    see commit 2cf9040714f3 ("perf tools: Fix bfd
    dependency libraries detection")
    feature-libbfd-liberty - link against -lbfd and -liberty
    feature-libbfd-liberty-z - link against -lbfd, -liberty and -lz (opensuse),
    see commit 280e7c48c3b8 ("perf tools: fix BFD
    detection on opensuse")

    (feature-liberty{,-z} were renamed to feature-libbfd-liberty{,z}
    for clarity)

    The main motivation is to fix this feature test for bpftool which is
    currently broken on debian (libbfd feature shows OFF, but we still
    unconditionally link against -lbfd and it works).

    Tested on debian with only -lbfd installed (without -liberty); I'd
    appreciate if somebody on the other systems can test this new detection
    method.

    Signed-off-by: Stanislav Fomichev
    Acked-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Mathieu Poirier
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/4dfc634cfcfb236883971b5107cf3c28ec8a31be.1542328222.git.sdf@google.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Stanislav Fomichev
     

18 Dec, 2018

2 commits

  • This patch adds support for generating instruction samples from trace of
    AArch32 programs using the A32 and T32 instruction sets.

    T32 has variable 2 or 4 byte instruction size, so the conversion between
    addresses and instruction counts requires extra information from the
    trace decoder, requiring version 0.10.0 of OpenCSD. A check for the
    OpenCSD library version has been added to the feature check for OpenCSD.

    Signed-off-by: Robert Walker
    Reviewed-by: Mathieu Poirier
    Tested-by: Leo Yan
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: coresight@lists.linaro.org
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/1543839526-30348-1-git-send-email-robert.walker@arm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Robert Walker
     
  • This will be used by 'perf record' to speed up reading the perf ring
    buffer.

    Committer testing:

    $ make -C tools/perf O=/tmp/build/perf
    make: Entering directory '/home/acme/git/perf/tools/perf'
    BUILD: Doing 'make -j8' parallel build

    Auto-detecting system features:
    ... dwarf: [ on ]
    ... dwarf_getlocations: [ on ]
    ... glibc: [ on ]
    ... gtk2: [ OFF ]
    ... libaudit: [ OFF ]
    ... libbfd: [ OFF ]
    ... libelf: [ on ]
    ... libnuma: [ OFF ]
    ... numa_num_possible_cpus: [ OFF ]
    ... libperl: [ OFF ]
    ... libpython: [ OFF ]
    ... libslang: [ on ]
    ... libcrypto: [ on ]
    ... libunwind: [ on ]
    ... libdw-dwarf-unwind: [ on ]
    ... zlib: [ on ]
    ... lzma: [ on ]
    ... get_cpuid: [ on ]
    ... bpf: [ on ]
    ... libaio: [ on ]

    $ ls -la /tmp/build/perf/feature/test-libaio.*
    -rwxrwxr-x. 1 acme acme 18296 Nov 26 08:49 /tmp/build/perf/feature/test-libaio.bin
    -rw-rw-r--. 1 acme acme 1165 Nov 26 08:49 /tmp/build/perf/feature/test-libaio.d
    -rw-rw-r--. 1 acme acme 0 Nov 26 08:49 /tmp/build/perf/feature/test-libaio.make.output
    $
    $ grep -i aio /tmp/build/perf/FEATURE-DUMP
    feature-libaio=1
    $

    Signed-off-by: Alexey Budankov
    Tested-by: Arnaldo Carvalho de Melo
    Reviewed-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/5fcda10c-6c63-68df-383a-c6d9e5d1f918@linux.intel.com
    [ split from a larger patch ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexey Budankov
     

22 Nov, 2018

2 commits

  • The Compiled Method Load Record (cmlr) is JDK specific interface to
    access JVM stack info. This makes the jvmti agent code not compile under
    another jdk, which does not support that.

    Separating jvmti cmlr check into special feature check, and adding
    HAVE_JVMTI_CMLR macro to indicate that.

    Mark cmlr code in jvmti/libjvmti.c with HAVE_JVMTI_CMLR, so we can
    compile it on system without cmlr support.

    This change makes the jvmti compile with java-1.8.0-ibm package. It's
    without the line numbers support, but the rest works.

    Adding NO_JVMTI_CMLR compile variable for testing.

    Signed-off-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Ben Gainey
    Cc: Gustavo Luiz Duarte
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/20181121154341.21521-1-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • A new 'perf bench epoll' will use this, and to disable it for older
    systems, add a feature test for this API.

    This is just a simple program that if successfully compiled, means that
    the feature is present, at least at the library level, in a build that
    sets the output directory to /tmp/build/perf (using O=/tmp/build/perf),
    we end up with:

    $ ls -la /tmp/build/perf/feature/test-eventfd*
    -rwxrwxr-x. 1 acme acme 8176 Nov 21 15:58 /tmp/build/perf/feature/test-eventfd.bin
    -rw-rw-r--. 1 acme acme 588 Nov 21 15:58 /tmp/build/perf/feature/test-eventfd.d
    -rw-rw-r--. 1 acme acme 0 Nov 21 15:58 /tmp/build/perf/feature/test-eventfd.make.output
    $ ldd /tmp/build/perf/feature/test-eventfd.bin
    linux-vdso.so.1 (0x00007fff3bf3f000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fa984061000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fa984417000)
    $ grep eventfd -A 2 -B 2 /tmp/build/perf/FEATURE-DUMP
    feature-dwarf=1
    feature-dwarf_getlocations=1
    feature-eventfd=1
    feature-fortify-source=1
    feature-sync-compare-and-swap=1
    $

    The main thing here is that in the end we'll have -DHAVE_EVENTFD in
    CFLAGS, and then the 'perf bench' entry needing that API can be
    selectively pruned.

    Cc: Adrian Hunter
    Cc: Andrew Morton
    Cc: David Ahern
    Cc: Davidlohr Bueso
    Cc: Jason Baron
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: https://lkml.kernel.org/n/tip-wkeldwob7dpx6jvtuzl8164k@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

20 Nov, 2018

1 commit


16 Aug, 2018

1 commit

  • Pull networking updates from David Miller:
    "Highlights:

    - Gustavo A. R. Silva keeps working on the implicit switch fallthru
    changes.

    - Support 802.11ax High-Efficiency wireless in cfg80211 et al, From
    Luca Coelho.

    - Re-enable ASPM in r8169, from Kai-Heng Feng.

    - Add virtual XFRM interfaces, which avoids all of the limitations of
    existing IPSEC tunnels. From Steffen Klassert.

    - Convert GRO over to use a hash table, so that when we have many
    flows active we don't traverse a long list during accumluation.

    - Many new self tests for routing, TC, tunnels, etc. Too many
    contributors to mention them all, but I'm really happy to keep
    seeing this stuff.

    - Hardware timestamping support for dpaa_eth/fsl-fman from Yangbo Lu.

    - Lots of cleanups and fixes in L2TP code from Guillaume Nault.

    - Add IPSEC offload support to netdevsim, from Shannon Nelson.

    - Add support for slotting with non-uniform distribution to netem
    packet scheduler, from Yousuk Seung.

    - Add UDP GSO support to mlx5e, from Boris Pismenny.

    - Support offloading of Team LAG in NFP, from John Hurley.

    - Allow to configure TX queue selection based upon RX queue, from
    Amritha Nambiar.

    - Support ethtool ring size configuration in aquantia, from Anton
    Mikaev.

    - Support DSCP and flowlabel per-transport in SCTP, from Xin Long.

    - Support list based batching and stack traversal of SKBs, this is
    very exciting work. From Edward Cree.

    - Busyloop optimizations in vhost_net, from Toshiaki Makita.

    - Introduce the ETF qdisc, which allows time based transmissions. IGB
    can offload this in hardware. From Vinicius Costa Gomes.

    - Add parameter support to devlink, from Moshe Shemesh.

    - Several multiplication and division optimizations for BPF JIT in
    nfp driver, from Jiong Wang.

    - Lots of prepatory work to make more of the packet scheduler layer
    lockless, when possible, from Vlad Buslov.

    - Add ACK filter and NAT awareness to sch_cake packet scheduler, from
    Toke Høiland-Jørgensen.

    - Support regions and region snapshots in devlink, from Alex Vesker.

    - Allow to attach XDP programs to both HW and SW at the same time on
    a given device, with initial support in nfp. From Jakub Kicinski.

    - Add TLS RX offload and support in mlx5, from Ilya Lesokhin.

    - Use PHYLIB in r8169 driver, from Heiner Kallweit.

    - All sorts of changes to support Spectrum 2 in mlxsw driver, from
    Ido Schimmel.

    - PTP support in mv88e6xxx DSA driver, from Andrew Lunn.

    - Make TCP_USER_TIMEOUT socket option more accurate, from Jon
    Maxwell.

    - Support for templates in packet scheduler classifier, from Jiri
    Pirko.

    - IPV6 support in RDS, from Ka-Cheong Poon.

    - Native tproxy support in nf_tables, from Máté Eckl.

    - Maintain IP fragment queue in an rbtree, but optimize properly for
    in-order frags. From Peter Oskolkov.

    - Improvde handling of ACKs on hole repairs, from Yuchung Cheng"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1996 commits)
    bpf: test: fix spelling mistake "REUSEEPORT" -> "REUSEPORT"
    hv/netvsc: Fix NULL dereference at single queue mode fallback
    net: filter: mark expected switch fall-through
    xen-netfront: fix warn message as irq device name has '/'
    cxgb4: Add new T5 PCI device ids 0x50af and 0x50b0
    net: dsa: mv88e6xxx: missing unlock on error path
    rds: fix building with IPV6=m
    inet/connection_sock: prefer _THIS_IP_ to current_text_addr
    net: dsa: mv88e6xxx: bitwise vs logical bug
    net: sock_diag: Fix spectre v1 gadget in __sock_diag_cmd()
    ieee802154: hwsim: using right kind of iteration
    net: hns3: Add vlan filter setting by ethtool command -K
    net: hns3: Set tx ring' tc info when netdev is up
    net: hns3: Remove tx ring BD len register in hns3_enet
    net: hns3: Fix desc num set to default when setting channel
    net: hns3: Fix for phy link issue when using marvell phy driver
    net: hns3: Fix for information of phydev lost problem when down/up
    net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero
    net: hns3: Add support for serdes loopback selftest
    bnxt_en: take coredump_record structure off stack
    ...

    Linus Torvalds
     

21 Jul, 2018

1 commit


18 Jul, 2018

2 commits


14 Jul, 2018

1 commit

  • perf propagates its feature check results to libbpf. This means
    features for which perf probes must be a superset of libbpf's
    required features. perf depends on FEATURE_TESTS_BASIC for its list
    of features.

    commit 531b014e7a2f ("tools: bpf: make use of reallocarray") added
    reallocarray use to libbpf, make perf also perform the reallocarray
    feature check.

    Fixes: 531b014e7a2f ("tools: bpf: make use of reallocarray")
    Reported-by: Guenter Roeck
    Signed-off-by: Jakub Kicinski
    Tested-by: Guenter Roeck
    Signed-off-by: Daniel Borkmann

    Jakub Kicinski
     

12 Jul, 2018

4 commits

  • The final link of fixdep uses LDFLAGS but not the existing HOSTLDFLAGS.
    Fix this.

    Signed-off-by: Laura Abbott
    Acked-by: Jiri Olsa
    Signed-off-by: Masahiro Yamada

    Laura Abbott
     
  • Commit 0c3b7e42616f ("tools build: Add support for host programs format")
    introduced host_c_flags which referenced CHOSTFLAGS. The actual name of the
    variable is HOSTCFLAGS. Fix this up.

    Fixes: 0c3b7e42616f ("tools build: Add support for host programs format")
    Signed-off-by: Laura Abbott
    Acked-by: Jiri Olsa
    Signed-off-by: Masahiro Yamada

    Laura Abbott
     
  • In 2016 GNU Make made a backwards incompatible change to the way '#'
    characters were handled in Makefiles when used inside functions or
    macros:

    http://git.savannah.gnu.org/cgit/make.git/commit/?id=c6966b323811c37acedff05b57

    Due to this change, when attempting to run `make prepare' I get a
    spurious make syntax error:

    /home/earnest/linux/tools/objtool/.fixdep.o.cmd:1: *** missing separator. Stop.

    When inspecting `.fixdep.o.cmd' it includes two lines which use
    unescaped comment characters at the top:

    \# cannot find fixdep (/home/earnest/linux/tools/objtool//fixdep)
    \# using basic dep data

    This is because `tools/build/Build.include' prints these '\#'
    characters:

    printf '\# cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \
    printf '\# using basic dep data\n\n' >> $(dot-target).cmd; \

    This completes commit 9564a8cf422d ("Kbuild: fix # escaping in .cmd files
    for future Make").

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=197847
    Cc: Randy Dunlap
    Cc: Rasmus Villemoes
    Cc: stable@vger.kernel.org
    Signed-off-by: Paul Menzel
    Signed-off-by: Masahiro Yamada

    Paul Menzel
     
  • reallocarray() is a safer variant of realloc which checks for
    multiplication overflow in case of array allocation. Since it's
    not available in Glibc < 2.26 import kernel's overflow.h and
    add a static inline implementation when needed. Use feature
    detection to probe for existence of reallocarray.

    Signed-off-by: Jakub Kicinski
    Reviewed-by: Quentin Monnet
    Reviewed-by: Jiong Wang
    Signed-off-by: Daniel Borkmann

    Jakub Kicinski
     

10 Apr, 2018

1 commit

  • I tried building using a freshly built Make (4.2.1-69-g8a731d1), but
    already the objtool build broke with

    orc_dump.c: In function ‘orc_dump’:
    orc_dump.c:106:2: error: ‘elf_getshnum’ is deprecated [-Werror=deprecated-declarations]
    if (elf_getshdrnum(elf, &nr_sections)) {

    Turns out that with that new Make, the backslash was not removed, so cpp
    didn't see a #include directive, grep found nothing, and
    -DLIBELF_USE_DEPRECATED was wrongly put in CFLAGS.

    Now, that new Make behaviour is documented in their NEWS file:

    * WARNING: Backward-incompatibility!
    Number signs (#) appearing inside a macro reference or function invocation
    no longer introduce comments and should not be escaped with backslashes:
    thus a call such as:
    foo := $(shell echo '#')
    is legal. Previously the number sign needed to be escaped, for example:
    foo := $(shell echo '\#')
    Now this latter will resolve to "\#". If you want to write makefiles
    portable to both versions, assign the number sign to a variable:
    C := \#
    foo := $(shell echo '$C')
    This was claimed to be fixed in 3.81, but wasn't, for some reason.
    To detect this change search for 'nocomment' in the .FEATURES variable.

    This also fixes up the two make-cmd instances to replace # with $(pound)
    rather than with \#. There might very well be other places that need
    similar fixup in preparation for whatever future Make release contains
    the above change, but at least this builds an x86_64 defconfig with the
    new make.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=197847
    Cc: Randy Dunlap
    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Masahiro Yamada

    Rasmus Villemoes
     

08 Mar, 2018

3 commits

  • So we can see the output of feature compile in following files:

    tools/build/feature/test-llvm.make.output
    tools/build/feature/test-llvm-version.make.output
    tools/build/feature/test-clang.make.output

    Signed-off-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20180307155020.32613-20-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • So they can follow the OUTPUT variable setup as the rest of the
    features.

    Signed-off-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20180307155020.32613-19-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • So we can see the status when we build perf, like:

    $ make LIBCLANGLLVM=1 VF=1
    ... cxx: [ on ]
    ... llvm: [ on ]
    ... llvm-version: [ on ]
    ... clang: [ on ]

    Signed-off-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20180307155020.32613-18-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

01 Feb, 2018

1 commit

  • Pull networking updates from David Miller:

    1) Significantly shrink the core networking routing structures. Result
    of http://vger.kernel.org/~davem/seoul2017_netdev_keynote.pdf

    2) Add netdevsim driver for testing various offloads, from Jakub
    Kicinski.

    3) Support cross-chip FDB operations in DSA, from Vivien Didelot.

    4) Add a 2nd listener hash table for TCP, similar to what was done for
    UDP. From Martin KaFai Lau.

    5) Add eBPF based queue selection to tun, from Jason Wang.

    6) Lockless qdisc support, from John Fastabend.

    7) SCTP stream interleave support, from Xin Long.

    8) Smoother TCP receive autotuning, from Eric Dumazet.

    9) Lots of erspan tunneling enhancements, from William Tu.

    10) Add true function call support to BPF, from Alexei Starovoitov.

    11) Add explicit support for GRO HW offloading, from Michael Chan.

    12) Support extack generation in more netlink subsystems. From Alexander
    Aring, Quentin Monnet, and Jakub Kicinski.

    13) Add 1000BaseX, flow control, and EEE support to mvneta driver. From
    Russell King.

    14) Add flow table abstraction to netfilter, from Pablo Neira Ayuso.

    15) Many improvements and simplifications to the NFP driver bpf JIT,
    from Jakub Kicinski.

    16) Support for ipv6 non-equal cost multipath routing, from Ido
    Schimmel.

    17) Add resource abstration to devlink, from Arkadi Sharshevsky.

    18) Packet scheduler classifier shared filter block support, from Jiri
    Pirko.

    19) Avoid locking in act_csum, from Davide Caratti.

    20) devinet_ioctl() simplifications from Al viro.

    21) More TCP bpf improvements from Lawrence Brakmo.

    22) Add support for onlink ipv6 route flag, similar to ipv4, from David
    Ahern.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1925 commits)
    tls: Add support for encryption using async offload accelerator
    ip6mr: fix stale iterator
    net/sched: kconfig: Remove blank help texts
    openvswitch: meter: Use 64-bit arithmetic instead of 32-bit
    tcp_nv: fix potential integer overflow in tcpnv_acked
    r8169: fix RTL8168EP take too long to complete driver initialization.
    qmi_wwan: Add support for Quectel EP06
    rtnetlink: enable IFLA_IF_NETNSID for RTM_NEWLINK
    ipmr: Fix ptrdiff_t print formatting
    ibmvnic: Wait for device response when changing MAC
    qlcnic: fix deadlock bug
    tcp: release sk_frag.page in tcp_disconnect
    ipv4: Get the address of interface correctly.
    net_sched: gen_estimator: fix lockdep splat
    net: macb: Handle HRESP error
    net/mlx5e: IPoIB, Fix copy-paste bug in flow steering refactoring
    ipv6: addrconf: break critical section in addrconf_verify_rtnl()
    ipv6: change route cache aging logic
    i40e/i40evf: Update DESC_NEEDED value to reflect larger value
    bnxt_en: cleanup DIM work on device shutdown
    ...

    Linus Torvalds
     

25 Jan, 2018

1 commit

  • The Open CoreSight Decoding Library (openCSD) is a free and open library
    to decode traces collected by the CoreSight hardware infrastructure.

    This patch adds the required mechanic to recognise the presence of the
    openCSD library on a system and set up miscellaneous flags to be used in
    the compilation of the trace decoding feature.

    Signed-off-by: Mathieu Poirier
    Cc: Adrian Hunter
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Kim Phillips
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Mike Leach
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Suzuki Poulouse
    Link: http://lkml.kernel.org/r/1516211539-5166-2-git-send-email-mathieu.poirier@linaro.org
    Link: http://lkml.kernel.org/r/1516635644-24819-1-git-send-email-mathieu.poirier@linaro.org
    [ Merged missing test-libopencsd.c file, provided later by Mathieu ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Mathieu Poirier
     

17 Jan, 2018

1 commit

  • bfd.h is requiring including of config.h except when PACKAGE or
    PACKAGE_VERSION are defined.

    /* PR 14072: Ensure that config.h is included first. */
    #if !defined PACKAGE && !defined PACKAGE_VERSION
    #error config.h must be included before this header
    #endif

    This check has been introduced since May-2012. It doesn't show up in bfd.h
    on some Linux distribution, probably because distributions have remove it
    when building the package.

    However, sometimes the user might just build libfd from source code then
    link bpftool against it. For this case, bfd.h will be original that we need
    to define PACKAGE or PACKAGE_VERSION.

    Acked-by: Jakub Kicinski
    Signed-off-by: Jiong Wang
    Signed-off-by: Daniel Borkmann

    Jiong Wang