24 Aug, 2018

1 commit

  • [ Upstream commit 8b247a92ebd0cda7dec49a6f771d9c4950f3d3ad ]

    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
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Laura Abbott
     

17 Jul, 2018

1 commit

  • commit 9feeb638cde083c737e295c0547f1b4f28e99583 upstream.

    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
    Signed-off-by: Greg Kroah-Hartman

    Paul Menzel
     

11 Jul, 2018

1 commit

  • commit 9564a8cf422d7b58f6e857e3546d346fa970191e upstream.

    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
    Signed-off-by: Greg Kroah-Hartman

    Rasmus Villemoes
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

29 Aug, 2017

1 commit


10 Aug, 2017

1 commit


05 Aug, 2017

1 commit

  • The BPF feature test as well as libbpf is missing the __NR_bpf
    define for s390 and currently refuses to compile (selftest suite
    depends on libbpf as well). Similar issue was fixed some time
    ago via b0c47807d31d ("bpf: Add sparc support to tools and
    samples."), just do the same and add definitions.

    Signed-off-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

30 Jul, 2017

1 commit


19 Jul, 2017

1 commit

  • And provide an alternative implementation to keep perf building on older
    distros as we're about to add initial support for namespaces.

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

    Arnaldo Carvalho de Melo
     

06 Jun, 2017

1 commit

  • This allows to detect -s (--silent) option without checking GNU Make
    version.

    As commit e36aaea28972 ("kbuild: Fix silent builds with make-4")
    pointed out, GNU Make 4.x changed the way/order it presents the
    command line options into MAKEFLAGS.

    In Make 3.8x, 's' is always the first in a group of short options.
    The group may be prefixed with '-' in some cases.

    In Make 4.x, 's' is always the last in a group of short options.

    As commit e6ac89fabd03 ("kbuild: Correctly deal with make options
    which contain an 's'") addressed, we also need to deal with long
    options that contain 's', like --warn-undefined-variables.

    Test cases:

    [1] command line input: make --silent
    -> MAKEFLAGS for Make 3.8x: s
    -> MAKEFLAGS for Make 4.x : s

    [2] command line input: make -srR
    -> MAKEFLAGS for Make 3.8x: sRr
    -> MAKEFLAGS for Make 4.x : rRs

    [3] command line input: make -s -rR --warn-undefined-variables
    -> MAKEFLAGS for Make 3.8x: --warn-undefined-variables -sRr
    -> MAKEFLAGS for Make 4.x : rRs --warn-undefined-variables

    My idea to cater to all the cases more easily is to filter out long
    options (--%), then search 's' with $(findstring ...). This way will
    be more future-proof even if future versions of Make put 's' in the
    middle of the group.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

16 May, 2017

1 commit

  • Pull networking fixes from David Miller:

    1) Track alignment in BPF verifier so that legitimate programs won't be
    rejected on !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS architectures.

    2) Make tail calls work properly in arm64 BPF JIT, from Deniel
    Borkmann.

    3) Make the configuration and semantics Generic XDP make more sense and
    don't allow both generic XDP and a driver specific instance to be
    active at the same time. Also from Daniel.

    4) Don't crash on resume in xen-netfront, from Vitaly Kuznetsov.

    5) Fix use-after-free in VRF driver, from Gao Feng.

    6) Use netdev_alloc_skb_ip_align() to avoid unaligned IP headers in
    qca_spi driver, from Stefan Wahren.

    7) Always run cleanup routines in BPF samples when we get SIGTERM, from
    Andy Gospodarek.

    8) The mdio phy code should bring PHYs out of reset using the shared
    GPIO lines before invoking bus->reset(). From Florian Fainelli.

    9) Some USB descriptor access endian fixes in various drivers from
    Johan Hovold.

    10) Handle PAUSE advertisements properly in mlx5 driver, from Gal
    Pressman.

    11) Fix reversed test in mlx5e_setup_tc(), from Saeed Mahameed.

    12) Cure netdev leak in AF_PACKET when using timestamping via control
    messages. From Douglas Caetano dos Santos.

    13) netcp doesn't support HWTSTAMP_FILTER_ALl, reject it. From Miroslav
    Lichvar.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (52 commits)
    ldmvsw: stop the clean timer at beginning of remove
    ldmvsw: unregistering netdev before disable hardware
    net: netcp: fix check of requested timestamping filter
    ipv6: avoid dad-failures for addresses with NODAD
    qed: Fix uninitialized data in aRFS infrastructure
    mdio: mux: fix device_node_continue.cocci warnings
    net/packet: fix missing net_device reference release
    net/mlx4_core: Use min3 to select number of MSI-X vectors
    macvlan: Fix performance issues with vlan tagged packets
    net: stmmac: use correct pointer when printing normal descriptor ring
    net/mlx5: Use underlay QPN from the root name space
    net/mlx5e: IPoIB, Only support regular RQ for now
    net/mlx5e: Fix setup TC ndo
    net/mlx5e: Fix ethtool pause support and advertise reporting
    net/mlx5e: Use the correct pause values for ethtool advertising
    vmxnet3: ensure that adapter is in proper state during force_close
    sfc: revert changes to NIC revision numbers
    net: ch9200: add missing USB-descriptor endianness conversions
    net: irda: irda-usb: fix firmware name on big-endian hosts
    net: dsa: mv88e6xxx: add default case to switch
    ...

    Linus Torvalds
     

13 May, 2017

1 commit

  • Pull perf updates/fixes from Ingo Molnar:
    "Mostly tooling updates, but also two kernel fixes: a call chain
    handling robustness fix and an x86 PMU driver event definition fix"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/callchain: Force USER_DS when invoking perf_callchain_user()
    tools build: Fixup sched_getcpu feature test
    perf tests kmod-path: Don't fail if compressed modules aren't supported
    perf annotate: Fix AArch64 comment char
    perf tools: Fix spelling mistakes
    perf/x86: Fix Broadwell-EP DRAM RAPL events
    perf config: Refactor a duplicated code for obtaining config file name
    perf symbols: Allow user probes on versioned symbols
    perf symbols: Accept symbols starting at address 0
    tools lib string: Adopt prefixcmp() from perf and subcmd
    perf units: Move parse_tag_value() to units.[ch]
    perf ui gtk: Move gtk .so name to the only place where it is used
    perf tools: Move HAS_BOOL define to where perl headers are used
    perf memswap: Split the byteswap memory range wrappers from util.[ch]
    perf tools: Move event prototypes from util.h to event.h
    perf buildid: Move prototypes from util.h to build-id.h

    Linus Torvalds
     

12 May, 2017

1 commit

  • Add a new field, "prog_flags", and an initial flag value
    BPF_F_STRICT_ALIGNMENT.

    When set, the verifier will enforce strict pointer alignment
    regardless of the setting of CONFIG_EFFICIENT_UNALIGNED_ACCESS.

    The verifier, in this mode, will also use a fixed value of "2" in
    place of NET_IP_ALIGN.

    This facilitates test cases that will exercise and validate this part
    of the verifier even when run on architectures where alignment doesn't
    matter.

    Signed-off-by: David S. Miller
    Acked-by: Daniel Borkmann

    David S. Miller
     

04 May, 2017

1 commit

  • We have tools/build/feature/test-all.c to speed up feature testing,
    doing all tests at once, but then all tests in this file should normally
    pass.

    That is not the case with the sched-getcpu one, that wasn't passing when
    included from test-all.c because it needs to have _GNU_SOURCE defined
    before including sched.h, but _GNU_SOURCE is defined by a header
    included from another feature test included earlier in test-all.d,
    test-libpython.c, resulting in:

    $ cat /tmp/build/perf/feature/test-all.make.output
    In file included from test-all.c:121:0:
    test-sched_getcpu.c:1:0: error: "_GNU_SOURCE" redefined [-Werror]
    #define _GNU_SOURCE

    In file included from /usr/include/python2.7/pyconfig.h:6:0,
    from /usr/include/python2.7/Python.h:8,
    from test-libpython.c:1,
    from test-all.c:13:
    /usr/include/python2.7/pyconfig-64.h:1177:0: note: this is the location of the previous definition
    #define _GNU_SOURCE 1

    cc1: all warnings being treated as errors

    Which would trigger testing the tests individually, when that
    _GNU_SOURCE redefinition would not take place, and the whole process
    would continue, just slower... Fix it.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Fixes: 120010cb1eea ("tools build: Add test for sched_getcpu()")
    Link: http://lkml.kernel.org/n/tip-3qp1it69xsc4w8gnuu1e9ayh@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

03 May, 2017

1 commit

  • Pull networking updates from David Millar:
    "Here are some highlights from the 2065 networking commits that
    happened this development cycle:

    1) XDP support for IXGBE (John Fastabend) and thunderx (Sunil Kowuri)

    2) Add a generic XDP driver, so that anyone can test XDP even if they
    lack a networking device whose driver has explicit XDP support
    (me).

    3) Sparc64 now has an eBPF JIT too (me)

    4) Add a BPF program testing framework via BPF_PROG_TEST_RUN (Alexei
    Starovoitov)

    5) Make netfitler network namespace teardown less expensive (Florian
    Westphal)

    6) Add symmetric hashing support to nft_hash (Laura Garcia Liebana)

    7) Implement NAPI and GRO in netvsc driver (Stephen Hemminger)

    8) Support TC flower offload statistics in mlxsw (Arkadi Sharshevsky)

    9) Multiqueue support in stmmac driver (Joao Pinto)

    10) Remove TCP timewait recycling, it never really could possibly work
    well in the real world and timestamp randomization really zaps any
    hint of usability this feature had (Soheil Hassas Yeganeh)

    11) Support level3 vs level4 ECMP route hashing in ipv4 (Nikolay
    Aleksandrov)

    12) Add socket busy poll support to epoll (Sridhar Samudrala)

    13) Netlink extended ACK support (Johannes Berg, Pablo Neira Ayuso,
    and several others)

    14) IPSEC hw offload infrastructure (Steffen Klassert)"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (2065 commits)
    tipc: refactor function tipc_sk_recv_stream()
    tipc: refactor function tipc_sk_recvmsg()
    net: thunderx: Optimize page recycling for XDP
    net: thunderx: Support for XDP header adjustment
    net: thunderx: Add support for XDP_TX
    net: thunderx: Add support for XDP_DROP
    net: thunderx: Add basic XDP support
    net: thunderx: Cleanup receive buffer allocation
    net: thunderx: Optimize CQE_TX handling
    net: thunderx: Optimize RBDR descriptor handling
    net: thunderx: Support for page recycling
    ipx: call ipxitf_put() in ioctl error path
    net: sched: add helpers to handle extended actions
    qed*: Fix issues in the ptp filter config implementation.
    qede: Fix concurrency issue in PTP Tx path processing.
    stmmac: Add support for SIMATIC IOT2000 platform
    net: hns: fix ethtool_get_strings overflow in hns driver
    tcp: fix wraparound issue in tcp_lp
    bpf, arm64: fix jit branch offset related to ldimm64
    bpf, arm64: implement jiting of BPF_XADD
    ...

    Linus Torvalds
     

23 Apr, 2017

1 commit


13 Apr, 2017

1 commit

  • This change is a follow up of https://lkml.org/lkml/2017/2/2/16

    The patch above avoided redefining CC, CXX and PKG_CONFIG in feature
    detection. The patch was not merged due to a unsolved concern with the
    -MD flag.

    Later, commit c8c188679ccf ("tools build: Use the same CC for feature
    detection and actual build") did the change for CC and CXX but not
    PKG_CONFIG.

    This patch makes PKG_CONFIG consistent with CC and CXX and moves the -MD
    to CFLAGS, as suggested by Jiri in the thread above.

    Signed-off-by: David Carrillo-Cisneros
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: He Kuang
    Cc: Jiri Olsa
    Cc: Masami Hiramatsu
    Cc: Paul Turner
    Cc: Peter Zijlstra
    Cc: Simon Que
    Cc: Stephane Eranian
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/20170412064919.92449-3-davidcc@google.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Carrillo-Cisneros
     

12 Apr, 2017

1 commit

  • ( This is a rebased version of https://lkml.org/lkml/2017/2/7/662 )

    Python's CC and link Makefile variables were not passed to feature
    detection, causing feature detection to use system's Python rather than
    PYTHON_CONFIG's one. This created a mismatch between the detected Python
    support and the one actually used by perf when PYTHON_CONFIG is
    specified.

    Fix it by moving Python's variable initialization to before feature
    detection and pass FLAGS_PYTHON_EMBED to Python's feature detection's
    build target.

    Signed-off-by: David Carrillo-Cisneros
    Acked-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: He Kuang
    Cc: Masami Hiramatsu
    Cc: Paul Turner
    Cc: Peter Zijlstra
    Cc: Simon Que
    Cc: Stephane Eranian
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/20170412064919.92449-2-davidcc@google.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Carrillo-Cisneros
     

04 Mar, 2017

2 commits

  • When build with: 'make CC=clang' we were not using that CC to do
    feature detection, which resulted in features being detected with gcc
    and then the actual tools being built with clang.

    Most of the time these compilers are compatible enough, so no
    problem was being noticed.

    As soon as a system with an old enough clang, one that hasn't
    the cpuid.h header is used, and a gcc with it, the "get_cpuid" feature
    will be found available but then code that will use can't be compiled.

    Noticed with this combination:

    / $ gcc --version | head -1
    gcc (Alpine 6.3.0) 6.3.0
    / $ clang --version | head -1
    clang version 3.8.1 (tags/RELEASE_381/final)
    / $ cat /etc/alpine-release
    3.5.0
    / $

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

    Arnaldo Carvalho de Melo
     
  • Instead of trying to go on adding more ifdef conditions, do a feature
    test and define HAVE_SCHED_GETCPU_SUPPORT instead, then use it to
    provide the prototype. No need to change the stub, as it is already a
    __weak symbol.

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

    Arnaldo Carvalho de Melo
     

18 Feb, 2017

1 commit

  • Ingo reported following build failure:

    On Sat, Feb 11, 2017 at 12:12:34PM +0100, Ingo Molnar wrote:
    >
    > So I had this oldish 32-bit 15.10 Ubuntu installation around (fully updated), and
    > trying to build perf gave me:
    >
    > deimos:~/tip/tools/perf> make
    > BUILD: Doing 'make -j4' parallel build
    > make[3]: *** No rule to make target '/usr/include/x86_64-linux-gnu/sys/types.h', needed by 'fixdep.o'. Stop.
    > Makefile:42: recipe for target 'fixdep-in.o' failed
    > make[2]: *** [fixdep-in.o] Error 2
    > /home/mingo/tip/tools/build/Makefile.include:4: recipe for target 'fixdep' failed
    > make[1]: *** [fixdep] Error 2
    > Makefile:68: recipe for target 'all' failed
    > make: *** [all] Error 2
    >
    > Now this got a bit better after I did a 'make mrproper' in the kernel tree:
    >
    > deimos:~/tip/tools/perf> make
    > BUILD: Doing 'make -j4' parallel build
    > HOSTCC fixdep.o
    > /home/mingo/tip/tools/build/fixdep: 1: /home/mingo/tip/tools/build/fixdep: Syntax error: "(" unexpected
    > /home/mingo/tip/tools/build/Makefile.build:101: recipe for target 'fixdep.o' failed
    > make[3]: *** [fixdep.o] Error 2
    > Makefile:42: recipe for target 'fixdep-in.o' failed
    > make[2]: *** [fixdep-in.o] Error 2
    > /home/mingo/tip/tools/build/Makefile.include:4: recipe for target 'fixdep' failed
    > make[1]: *** [fixdep] Error 2
    > Makefile:68: recipe for target 'all' failed
    > make: *** [all] Error 2
    >
    > After some digging it turns out that my 'fixdep' binary was 64-bit:
    >
    > deimos:~/tip/tools/perf> file /home/mingo/tip/tools/build/fixdep
    > /home/mingo/tip/tools/build/fixdep: ELF 64-bit LSB executable, x86-64, version 1
    > (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux
    > 2.6.32, BuildID[sha1]=d527f736b57b5ba47210fbcb562a3b52867d21c1, not stripped
    >
    > But it did not get cleaned out by 'make clean'.
    >
    > Only after I did a 'make clean' in tools/ itself, did it get built properly.

    It shows we don't clean up properly the fixdep objects, so adding
    special rule for that.

    Signed-off-by: Jiri Olsa
    Reported-by: Ingo Molnar
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1487340058-10496-2-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

27 Jan, 2017

1 commit

  • When doing a kernel build with 'make -s', everything is silenced except
    the objtool build. That's because the tools tree support for silent
    builds is some combination of missing and broken.

    Three changes are needed to fix it:

    - Makefile: propagate '-s' to the sub-make's MAKEFLAGS variable so the
    tools Makefiles can see it.

    - tools/scripts/Makefile.include: fix the tools Makefiles' ability to
    recognize '-s'. The MAKE_VERSION and MAKEFLAGS checks are copied from
    the top-level Makefile. This silences the "DESCEND objtool" message.

    - tools/build/Makefile.build: add support to the tools Build files for
    recognizing '-s'. Again the MAKE_VERSION and MAKEFLAGS checks are
    copied from the top-level Makefile. This silences all the object
    compile/link messages.

    Reported-and-Tested-by: Peter Zijlstra
    Signed-off-by: Josh Poimboeuf
    Cc: Jiri Olsa
    Cc: Michal Marek
    Link: http://lkml.kernel.org/r/e8967562ef640c3ae9a76da4ae0f4e47df737c34.1484799200.git.jpoimboe@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Josh Poimboeuf
     

18 Dec, 2016

1 commit

  • Pull kbuild updates from Michal Marek:

    - prototypes for x86 asm-exported symbols (Adam Borowski) and a warning
    about missing CRCs (Nick Piggin)

    - asm-exports fix for LTO (Nicolas Pitre)

    - thin archives improvements (Nick Piggin)

    - linker script fix for CONFIG_LD_DEAD_CODE_DATA_ELIMINATION (Nick
    Piggin)

    - genksyms support for __builtin_va_list keyword

    - misc minor fixes

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    x86/kbuild: enable modversions for symbols exported from asm
    kbuild: fix scripts/adjust_autoksyms.sh* for the no modules case
    scripts/kallsyms: remove last remnants of --page-offset option
    make use of make variable CURDIR instead of calling pwd
    kbuild: cmd_export_list: tighten the sed script
    kbuild: minor improvement for thin archives build
    kbuild: modpost warn if export version crc is missing
    kbuild: keep data tables through dead code elimination
    kbuild: improve linker compatibility with lib-ksyms.o build
    genksyms: Regenerate parser
    kbuild/genksyms: handle va_list type
    kbuild: thin archives for multi-y targets
    kbuild: kallsyms allow 3-pass generation if symbols size has changed

    Linus Torvalds
     

11 Dec, 2016

1 commit


07 Dec, 2016

1 commit

  • Cancel builtin llvm and clang support when LLVM version is less than
    3.9.0: following commits uses newer API.

    Since Clang/LLVM's API is not guaranteed to be stable, add a
    test-llvm-version.cpp feature checker, issue warning if LLVM found in
    compiling environment is not tested yet.

    Committer Notes:

    Testing it:

    Environment:

    $ cat /etc/fedora-release
    Fedora release 25 (Twenty Five)
    $ rpm -q llvm-devel clang-devel
    llvm-devel-3.8.0-1.fc25.x86_64
    clang-devel-3.8.0-2.fc25.x86_64
    $

    Before:

    $ make -k LIBCLANGLLVM=1 O=/tmp/build/perf -C tools/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
    Warning: tools/arch/arm/include/uapi/asm/kvm.h differs from kernel
    INSTALL GTK UI
    LINK /tmp/build/perf/perf
    /tmp/build/perf/libperf.a(libperf-in.o): In function `perf::createCompilerInvocation(llvm::SmallVector, llvm::StringRef&, clang::DiagnosticsEngine&)':
    /home/acme/git/linux/tools/perf/util/c++/clang.cpp:56: undefined reference to `clang::tooling::newInvocation(clang::DiagnosticsEngine*, llvm::SmallVector const&)'
    /tmp/build/perf/libperf.a(libperf-in.o): In function `perf::getModuleFromSource(llvm::SmallVector, llvm::StringRef, llvm::IntrusiveRefCntPtr)':
    /home/acme/git/linux/tools/perf/util/c++/clang.cpp:68: undefined reference to `clang::CompilerInstance::CompilerInstance(std::shared_ptr, bool)'
    /home/acme/git/linux/tools/perf/util/c++/clang.cpp:69: undefined reference to `clang::CompilerInstance::createDiagnostics(clang::DiagnosticConsumer*, bool)'

    After:

    Makefile.config:807: No suitable libLLVM found, disabling builtin clang and llvm support. Please install llvm-dev(el) (>= 3.9.0)

    Updating the environment to a locally built LLVM 4.0 + clang 3.9 (forgot
    to git pull, duh) combo, all works as expected, it is properly detected
    and built into the resulting perf binary.

    Signed-off-by: Wang Nan
    Reported-and-Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexei Starovoitov
    Cc: He Kuang
    Cc: Jiri Olsa
    Cc: Joe Stringer
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/20161206072230.7651-1-wangnan0@huawei.com
    [ Change the warning message a bit (add 'suitable' and 'builtin'), clarifying it, see committer notes above ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     

06 Dec, 2016

6 commits

  • We've been hit several times by a Makefile bug where line indented by
    tab was falsely considered as target command.

    We prevent this by always using space indentation for everything except
    for the target commands.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1480884178-8072-3-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Putting extra line between dependencies and cmd_* definition
    to make it more readable.

    Before:

    $ cat .builtin-top.o.cmd
    ...
    /home/jolsa/kernel/linux-perf/tools/include/linux/stringify.h \
    /home/jolsa/kernel/linux-perf/tools/include/linux/time64.h
    cmd_builtin-top.o := gcc -Wp,-MD,./.builtin-top.o.d -Wp,-MT,builtin-...
    ...

    After:

    $ cat .builtin-top.o.cmd
    ...
    /home/jolsa/kernel/linux-perf/tools/include/linux/stringify.h \
    /home/jolsa/kernel/linux-perf/tools/include/linux/time64.h

    cmd_builtin-top.o := gcc -Wp,-MD,./.builtin-top.o.d -Wp,-MT,builtin-...
    ...

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1480884178-8072-2-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Check if basic clang compiling environment is ready.

    Doesn't like 'llvm-config --libs' which can returns llvm libraries in right
    order and duplicates some libraries if necessary, there's no correspondence for
    clang libraries (-lclangxxx). to avoid extra complexity and to avoid new clang
    breaking libraries ordering, use --start-group and --end-group.

    In this test case, manually identify required clang libs and hope it to be
    stable. Putting all clang libraries here is possible (use make's wildcard), but
    then feature checking becomes very slow.

    Signed-off-by: Wang Nan
    Cc: Alexei Starovoitov
    Cc: He Kuang
    Cc: Jiri Olsa
    Cc: Joe Stringer
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/20161126070354.141764-9-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     
  • Check if basic LLVM compiling environment is ready.

    Use llvm-config to detect include and library directories. Avoid using
    'llvm-config --cxxflags' because its result contain some unwanted flags
    like --sysroot (if LLVM is built by yocto).

    Use '?=' to set LLVM_CONFIG, so explicitly passing LLVM_CONFIG to make
    would override it.

    Use 'llvm-config --libs BPF' to check if BPF backend is compiled in.
    Since now BPF bytecode is the only required backend, no need to waste
    time linking llvm and clang if BPF backend is missing. This also
    introduce an implicit requirement that LLVM should be new enough. Old
    LLVM doesn't support BPF backend.

    Signed-off-by: Wang Nan
    Cc: Alexei Starovoitov
    Cc: He Kuang
    Cc: Jiri Olsa
    Cc: Joe Stringer
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/20161126070354.141764-8-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     
  • Clang doesn't support multiple arguments being passed to -Wp, so split
    them.

    Fixes this error:
    HOSTCC tools/objtool/fixdep.o
    cat: tools/objtool/.fixdep.o.d: No such file or directory

    Signed-off-by: Peter Foley
    Tested-by: Arnaldo Carvalho de Melo
    Acked-by: Jiri Olsa
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/20161128024346.17371-1-pefoley2@pefoley.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Peter Foley
     
  • The fixdep tool, among other things, replaces the target of the object
    in the gcc generated dependency output file.

    The parsing code assumes there's only single target in the rule but this
    is not always the case as described in here:

    https://gcc.gnu.org/ml/gcc-help/2016-11/msg00099.html

    Make the fixdep code smart enough to skip all the possible targets.

    Signed-off-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Acked-by: Peter Foley
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/20161201130025.GA16430@krava
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

14 Nov, 2016

2 commits

  • Adding support to detect jvmti support. It is not plugged into the
    FEATURE_TESTS machinery, because it's quite rare and will be used
    separately from perf via feature_check call.

    Signed-off-by: Jiri Olsa
    Tested-by: Stephane Eranian
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: William Cohen
    Link: http://lkml.kernel.org/r/1478093749-5602-3-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Adding support to remove options from final CFLAGS for both object file
    and build target. It's now possible to remove CFLAGS options like:

    CFLAGS_REMOVE_krava.o += -Wstrict-prototypes

    Committer notes:

    This comes from the kernel's kbuild infrastructure, the subset that is
    supported in tools/ is being documented at tools/build/Documentation/Build.txt.

    Signed-off-by: Jiri Olsa
    Tested-by: Stephane Eranian
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: William Cohen
    Link: http://lkml.kernel.org/r/1478093749-5602-2-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

06 Oct, 2016

2 commits

  • Check if g++ is available. The result will be used by builtin clang and
    LLVM support. Since LLVM requires C++11, this feature detector checks
    std::move().

    Signed-off-by: Wang Nan
    Cc: Alexei Starovoitov
    Cc: He Kuang
    Cc: Jiri Olsa
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1474874832-134786-3-git-send-email-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     
  • Add new rule to compile .cpp file to .o use g++. C++ support is required
    for built-in clang and LLVM support.

    Linker side support will be introduced by following commits.

    Signed-off-by: Wang Nan
    Cc: Alexei Starovoitov
    Cc: He Kuang
    Cc: Jiri Olsa
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1474874832-134786-2-git-send-email-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     

03 Oct, 2016

2 commits

  • It is used in the build process, so stop suppressing its build in tools
    cross builds.

    Signed-off-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Andi Kleen
    Cc: Madhavan Srinivasan
    Cc: Peter Zijlstra
    Cc: Sukadev Bhattiprolu
    Cc: linuxppc-dev@lists.ozlabs.org
    Link: http://lkml.kernel.org/r/20160927141846.GA6589@krava
    [ Use HOSTCC on the $(OUTPUT)fixdep target, it was using the x-compiler
    to link fixdep-in.o, that was correctly built with HOSTCC and thus failing ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • In some cases, like for fixdep and shortly for jevents, we need to build a tool
    to run on the host that will be used in building a tool, such as perf, that is
    being cross compiled, so do like the kernel and provide HOSTCC, HOSTLD and HOSTAR
    to do that.

    Signed-off-by: Jiri Olsa
    Requested-by: Andi Kleen
    Requested-and-Tested-by: Arnaldo Carvalho de Melo
    Cc: Madhavan Srinivasan
    Cc: Peter Zijlstra
    Cc: Sukadev Bhattiprolu
    Cc: linuxppc-dev@lists.ozlabs.org
    Link: http://lkml.kernel.org/r/20160927141846.GA6589@krava
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

14 Jul, 2016

1 commit

  • This checks whether sys/sdt.h is available or not, which is required for
    DTRACE_PROBE().

    We can disable this feature by passing NO_SDT=1 when building.

    This flag will be used for SDT test case and further SDT events in
    perftools.

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

    Masami Hiramatsu
     

13 Jul, 2016

1 commit

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

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

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

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

    Arnaldo Carvalho de Melo
     

05 Jul, 2016

1 commit

  • That appeared after 0.140, and will be used in the SDT code, so, to
    avoid bisection break on older systems, add a feature detection and
    provide a stub with a pr_debug() to keep it building.

    Cc: Ananth N Mavinakayanahalli
    Cc: Brendan Gregg
    Cc: Hemant Kumar
    Cc: Masami Hiramatsu
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-80y0eldgweorqnwha9rvfxjr@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo