1. 18 12月, 2020 1 次提交
    • J
      tools build: Add missing libcap to test-all.bin target · 09d59c2f
      Jiri Olsa 提交于
      We're missing -lcap in test-all.bin target, so in case it's the only
      library missing (if more are missing test-all.bin fails anyway), we will
      falsely claim that we detected it and fail build, like:
      
        $ make
        ...
        Auto-detecting system features:
        ...                         dwarf: [ on  ]
        ...            dwarf_getlocations: [ on  ]
        ...                         glibc: [ on  ]
        ...                        libbfd: [ on  ]
        ...                libbfd-buildid: [ on  ]
        ...                        libcap: [ on  ]
        ...                        libelf: [ on  ]
        ...                       libnuma: [ on  ]
        ...        numa_num_possible_cpus: [ on  ]
        ...                       libperl: [ on  ]
        ...                     libpython: [ on  ]
        ...                     libcrypto: [ on  ]
        ...                     libunwind: [ on  ]
        ...            libdw-dwarf-unwind: [ on  ]
        ...                          zlib: [ on  ]
        ...                          lzma: [ on  ]
        ...                     get_cpuid: [ on  ]
        ...                           bpf: [ on  ]
        ...                        libaio: [ on  ]
        ...                       libzstd: [ on  ]
        ...        disassembler-four-args: [ on  ]
      
        ...
      
          CC       builtin-ftrace.o
      
        In file included from builtin-ftrace.c:29:
        util/cap.h:11:10: fatal error: sys/capability.h: No such file or directory
           11 | #include <sys/capability.h>
              |          ^~~~~~~~~~~~~~~~~~
        compilation terminated.
      
      Fixes: 74d5f3d0 ("tools build: Add capability-related feature detection")
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Igor Lubashev <ilubashe@akamai.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20201203230836.3751981-1-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      09d59c2f
  2. 09 9月, 2020 1 次提交
    • A
      tools feature: Add missing -lzstd to the fast path feature detection · 6c014694
      Arnaldo Carvalho de Melo 提交于
      We were failing that due to GTK2+ and then for the ZSTD test, which made
      test-all.c, the fast path feature detection file to fail and thus
      trigger building all of the feature tests, slowing down the test.
      
      Eventually the ZSTD test would be built and would succeed, since it had
      the needed -lzstd, avoiding:
      
        $ cat /tmp/build/perf/feature/test-all.make.output
        /usr/bin/ld: /tmp/ccRRJQ4u.o: in function `main_test_libzstd':
        /home/acme/git/perf/tools/build/feature/test-libzstd.c:8: undefined reference to `ZSTD_createCStream'
        /usr/bin/ld: /home/acme/git/perf/tools/build/feature/test-libzstd.c:9: undefined reference to `ZSTD_freeCStream'
        collect2: error: ld returned 1 exit status
        $
      
      Fix it by adding -lzstd to the test-all target.
      
      Now I need an entry to 'perf test' to make sure that
      /tmp/build/perf/feature/test-all.make.output is empty...
      
      Fixes: 3b1c5d96 ("tools build: Implement libzstd feature check, LIBZSTD_DIR and NO_LIBZSTD defines")
      Reviewed-by: NAlexei Budankov <alexey.budankov@linux.intel.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: http://lore.kernel.org/lkml/20200904202611.GJ3753976@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6c014694
  3. 05 9月, 2020 2 次提交
    • A
      perf tools: Make GTK2 support opt-in · 4751bddd
      Arnaldo Carvalho de Melo 提交于
      This is bitrotting, nobody is stepping up to work on it, and since we
      treat warnings as errors, feature detection is failing in its main,
      faster test (tools/build/feature/test-all.c) because of the GTK+2
      infobar check.
      
      So make this opt-in, at some point ditch this if nobody volunteers to
      take care of this.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4751bddd
    • A
      tools features: Add feature test to check if libbfd has buildid support · e71e19a9
      Arnaldo Carvalho de Melo 提交于
      Which is needed by the PE executable support, for instance.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jacek Caban <jacek@codeweavers.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e71e19a9
  4. 19 8月, 2020 1 次提交
  5. 14 8月, 2020 1 次提交
    • F
      perf build-ids: Fall back to debuginfod query if debuginfo not found · c7a14fdc
      Frank Ch. Eigler 提交于
      During a perf-record, use the -ldebuginfod API to query a debuginfod
      server, should the debug data not be found in the usual system
      locations.  If successful, the usual $HOME/.debug dir is populated.
      
      Tested with:
      
        $ find .
        .
        ./ctags-debuginfo-5.8-26.fc31.x86_64.rpm
        ./usr
        ./usr/lib
        ./usr/lib/debug
        ./usr/lib/debug/.build-id
        ./usr/lib/debug/.build-id/ca
        ./usr/lib/debug/.build-id/ca/46f6ae6a0cee57d85abc1d461c49074248908d
        ./usr/lib/debug/.build-id/ca/46f6ae6a0cee57d85abc1d461c49074248908d.debug
        ./usr/lib/debug/usr
        ./usr/lib/debug/usr/bin
        ./usr/lib/debug/usr/bin/ctags-5.8-26.fc31.x86_64.debug
      
        $ debuginfod  -F .
        ...
      
        $ rm -rf ~/.debug/ ; mkdir ~/.debug
      
        $ perf record make tags
          BUILD:   Doing 'make -j8' parallel build
          GEN      tags
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.107 MB perf.data (1483 samples) ]
      
        $ find ~/.debug | grep ctags
        /home/jolsa/.debug/usr/bin/ctags
        /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d
        /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d/elf
        /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d/probes
      
        $ rm -rf ~/.debug/ ; mkdir ~/.debug
      
        $ DEBUGINFOD_URLS=http://localhost:8002 perf record make tags
          BUILD:   Doing 'make -j8' parallel build
          GEN      tags
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.108 MB perf.data (1531 samples) ]
      
        $ find ~/.debug | grep ctag
        /home/jolsa/.debug/usr/bin/ctags
        /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d
        /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d/debug
        /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d/elf
        /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d/probes
      
      Note the 'debug' file is created in the last run.
      
      Note that currently the debuginfo data are downloaded only on record path,
      we still need add this support to perf build-id/report.. and test ;-)
      Tested-by: NJiri Olsa <jolsa@kernel.org>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Signed-off-by: NFrank Ch. Eigler <fche@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c7a14fdc
  6. 31 7月, 2020 1 次提交
    • T
      tools build feature: Use CC and CXX from parent · e3232c2f
      Thomas Hebb 提交于
      commit c8c18867 ("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: c8c18867 ("tools build: Use the same CC for feature detection and actual build")
      Signed-off-by: NThomas Hebb <tommyhebb@gmail.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Igor Lubashev <ilubashe@akamai.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: thomas hebb <tommyhebb@gmail.com>
      Link: http://lore.kernel.org/lkml/0a6e69d1736b0fa231a648f50b0cce5d8a6734ef.1595822871.git.tommyhebb@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e3232c2f
  7. 23 6月, 2020 1 次提交
  8. 30 5月, 2020 1 次提交
    • A
      perf build: Remove libaudit from the default feature checks · a88f70de
      Arnaldo Carvalho de Melo 提交于
      Ingo reported that the libaudit was always appearing as OFF:
      
        Auto-detecting system features:
        ...                         dwarf: [ on  ]
        ...            dwarf_getlocations: [ on  ]
        ...                         glibc: [ on  ]
        ...                          gtk2: [ on  ]
        ...                      libaudit: [ OFF ]
      
      And everything seemed to work, i.e. we were checking for a feature that
      we don't use, causing confusion for people building perf, so work to
      remove that nuisance while making sure that it works when an arch
      doesn't provide the alternative method to generate the syscall id/name
      conversion tables.
      
      Longer explanation of the new modus operandi:
      
        $ make -C tools/perf O=/tmp/build/perf NO_SYSCALL_TABLE=1
        <SNIP>
        Auto-detecting system features:
        ...                         dwarf: [ on  ]
        ...            dwarf_getlocations: [ on  ]
        ...                         glibc: [ on  ]
        ...                          gtk2: [ on  ]
        ...                        libbfd: [ on  ]
        ...                        libcap: [ on  ]
        ...                        libelf: [ on  ]
        ...                       libnuma: [ on  ]
        ...        numa_num_possible_cpus: [ on  ]
        ...                       libperl: [ on  ]
        ...                     libpython: [ on  ]
        ...                     libcrypto: [ on  ]
        ...                     libunwind: [ on  ]
        ...            libdw-dwarf-unwind: [ on  ]
        ...                          zlib: [ on  ]
        ...                          lzma: [ on  ]
        ...                     get_cpuid: [ on  ]
        ...                           bpf: [ on  ]
        ...                        libaio: [ on  ]
        ...                       libzstd: [ on  ]
        ...        disassembler-four-args: [ on  ]
      
        Makefile.config:665: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev
          GEN      /tmp/build/perf/common-cmds.h
          MKDIR    /tmp/build/perf/fd/
          MKDIR    /tmp/build/perf/fs/
        <SNIP>
        $
      
      The libaudit test is forced and it fails when audit-libs-devel isn't available:
      
        $ cat /tmp/build/perf/feature/test-libaudit.make.output
        test-libaudit.c:2:10: fatal error: libaudit.h: No such file or directory
            2 | #include <libaudit.h>
              |          ^~~~~~~~~~~~
        compilation terminated.
        $
      
      If we install audit-libs-devel and rebuild it continues not to be shown as OFF
      in the main auto-detection summary, but again gets tested and this time:
      
        $ rpm -q audit-libs-devel
        audit-libs-devel-3.0-0.15.20191104git1c2f876.fc31.x86_64
        $
      
      The make output for the feature detection comes clean:
      
        $ cat /tmp/build/perf/feature/test-libaudit.make.output
      
      And the feature detection binary is successfully built and is dynamicly linked
      with libaudit:
      
        $ ldd /tmp/build/perf/feature/test-libaudit.bin | grep audit
        	libaudit.so.1 => /lib64/libaudit.so.1 (0x00007f5bf5177000)
        $
      
      As well as the resulting perf binary:
      
        $ ldd /tmp/build/perf/perf | grep audit
        	libaudit.so.1 => /lib64/libaudit.so.1 (0x00007fad511c7000)
        $
      
      And 'perf trace' works using the libaudit method:
      
        $ sudo /tmp/build/perf/perf trace -e nanosleep sleep 1
             0.000 (1000.067 ms): sleep/281872 nanosleep(rqtp: 0x7ffedbbe69d0) = 0
        $
      
      If we leave audit-libs-devel installed but don't disable the use of the best
      method, the one using SYSCALL_TABLE, the default for architectures that provide
      the script to build the syscall id/name mapping using the .tbl files copied
      from the kernel sources, we get:
      
        $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf
        $ make -C tools/perf O=/tmp/build/perf
        Auto-detecting system features:
        ...                         dwarf: [ on  ]
        ...            dwarf_getlocations: [ on  ]
        ...                         glibc: [ on  ]
        ...                          gtk2: [ on  ]
        ...                        libbfd: [ on  ]
        ...                        libcap: [ on  ]
        ...                        libelf: [ on  ]
        ...                       libnuma: [ on  ]
        ...        numa_num_possible_cpus: [ on  ]
        ...                       libperl: [ on  ]
        ...                     libpython: [ on  ]
        ...                     libcrypto: [ on  ]
        ...                     libunwind: [ on  ]
        ...            libdw-dwarf-unwind: [ on  ]
        ...                          zlib: [ on  ]
        ...                          lzma: [ on  ]
        ...                     get_cpuid: [ on  ]
        ...                           bpf: [ on  ]
        ...                        libaio: [ on  ]
        ...                       libzstd: [ on  ]
        ...        disassembler-four-args: [ on  ]
      
          GEN      /tmp/build/perf/common-cmds.h
        <SNIP>
        $
      
      Again, no mention of libaudit being on or OFF and:
      
        $ cat /tmp/build/perf/feature/test-libaudit.make.output
        cat: /tmp/build/perf/feature/test-libaudit.make.output: No such file or directory
        $
      
      We didn't even bother checking for its availability, slightly speeding up the
      build process and:
      
        $ ldd /tmp/build/perf/perf | grep libaudit
        $
      
      We don't link with it, also:
      
        $ sudo /tmp/build/perf/perf trace -e nanosleep sleep 1
             0.000 (1000.053 ms): sleep/299125 nanosleep(rqtp: 0x7ffc24611b50) = 0
        $
      
      And globs become available:
      
        $ sudo /tmp/build/perf/perf trace -e *sleep sleep 1
             0.000 (1000.072 ms): sleep/299136 nanosleep(rqtp: 0x7ffe7a3c4ff0) = 0
        $
      Reported-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a88f70de
  9. 06 5月, 2020 1 次提交
    • S
      tools feature: Add support for detecting libpfm4 · 5ef86146
      Stephane Eranian 提交于
      libpfm4 provides an alternate command line encoding of perf events.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Reviewed-by: NIan Rogers <irogers@google.com>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrii Nakryiko <andriin@fb.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Igor Lubashev <ilubashe@akamai.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiwei Sun <jiwei.sun@windriver.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: bpf@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: yuzhoujian <yuzhoujian@didichuxing.com>
      Link: http://lore.kernel.org/lkml/20200429231443.207201-3-irogers@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5ef86146
  10. 03 4月, 2020 1 次提交
    • N
      perf tools: Add file-handle feature test · 49f550ea
      Namhyung Kim 提交于
      The file handle (FHANDLE) support is configurable so some systems might not
      have it.  So add a config feature item to check it on build time so that we
      don't add the cgroup tracking feature based on that.
      
      Committer notes:
      
      Had to make the test use the same construct as its later use in
      synthetic-events.c, in the next patch in this series. i.e. make it be:
      
      	struct {
      		struct file_handle fh;
      		uint64_t cgroup_id;
      	} handle;
      
      To cope with:
      
          CC       /tmp/build/perf/util/cloexec.o
        util/synthetic-events.c:428:22: error: field 'fh' with   CC       /tmp/build/perf/util/call-path.o
        variable sized type 'struct file_handle' not at the end of a struct or class is a GNU
              extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
                        struct file_handle fh;
                                           ^
        1 error generated.
      
      Deal with this at some point, i.e. investigate if the right thing is to
      remove that -Wgnu-variable-sized-type-not-at-end from our CFLAGS, for
      now do the test the same way as it is used looks more sensible.
      Reported-by: NArnaldo Carvalho de Melo <acme@kernel.org>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20200402015249.3800462-1-namhyung@kernel.org
      [ split from a larger patch, removed blank line at EOF ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      49f550ea
  11. 13 3月, 2020 1 次提交
  12. 14 1月, 2020 1 次提交
  13. 26 11月, 2019 1 次提交
    • J
      perf tools: Allow to link with libbpf dynamicaly · 7b65e203
      Jiri Olsa 提交于
      Currently we support only static linking with kernel's libbpf
      (tools/lib/bpf). This patch adds libbpf package detection and support to
      link perf with it dynamically.
      
      The libbpf package status is displayed with:
      
        $ make VF=1
        Auto-detecting system features:
        ...
        ...                        libbpf: [ on  ]
      
      It's not checked by default, because it's quite new.  Once it's on most
      distros we can switch it on.
      
      For the same reason it's not added to the test-all check.
      
      Perf does not need advanced version of libbpf, so we can check just for
      the base bpf_object__open function.
      
      Adding new compile variable to detect libbpf package and link bpf
      dynamically:
      
        $ make LIBBPF_DYNAMIC=1
          ...
          LINK     perf
        $ ldd perf | grep bpf
          libbpf.so.0 => /lib64/libbpf.so.0 (0x00007f46818bc000)
      
      If libbpf is not installed, build stops with:
      
        Makefile.config:486: *** Error: No libbpf devel library found,\
        please install libbpf-devel.  Stop.
      
      Committer testing:
      
        $ make LIBBPF_DYNAMIC=1 -C tools/perf O=/tmp/build/perf
        make: Entering directory '/home/acme/git/perf/tools/perf'
          BUILD:   Doing 'make -j8' parallel build
        Makefile.config:493: *** Error: No libbpf devel library found, please install libbpf-devel.  Stop.
        make[1]: *** [Makefile.perf:225: sub-make] Error 2
        make: *** [Makefile:70: all] Error 2
        make: Leaving directory '/home/acme/git/perf/tools/perf'
        $
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Toke Høiland-Jørgensen <toke@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
      Cc: Andrii Nakryiko <andriin@fb.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Jesper Dangaard Brouer <brouer@redhat.com>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: bpf@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Link: http://lore.kernel.org/lkml/20191126121253.28253-1-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7b65e203
  14. 13 8月, 2019 1 次提交
    • I
      tools build: Add capability-related feature detection · 74d5f3d0
      Igor Lubashev 提交于
      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:
        <SNIP>
        ...                        libbfd: [ on  ]
        ...                        libcap: [ OFF ]
        ...                        libelf: [ on  ]
        <SNIP>
        Makefile.config:833: No libcap found, disables capability support, please install libcap-devel/libcap-dev
        <SNIP>
        $ 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 <sys/capability.h>
              |          ^~~~~~~~~~~~~~~~~~
        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:
        <SNIP>
        ...                        libbfd: [ on  ]
        ...                        libcap: [ on  ]
        ...                        libelf: [ on  ]
        <SNIP>>
          CC       /tmp/build/perf/jvmti/libjvmti.o
        <SNIP>>
        $ 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: NIgor Lubashev <ilubashe@akamai.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      [ split from a larger patch ]
      Link: http://lkml.kernel.org/r/8a1e76cf5c7c9796d0d4d240fbaa85305298aafa.1565188228.git.ilubashe@akamai.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      74d5f3d0
  15. 08 7月, 2019 1 次提交
    • A
      tools build: Check if gettid() is available before providing helper · 05c78468
      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: NLaura Abbott <labbott@redhat.com>
      Tested-by: NLaura Abbott <labbott@redhat.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Florian Weimer <fweimer@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lkml.kernel.org/n/tip-yfy3ch53agmklwu9o7rlgf9c@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      05c78468
  16. 19 6月, 2019 1 次提交
    • A
      tools build: Add test to check if slang.h is in /usr/include/slang/ · cbefd24f
      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 <adrian.hunter@intel.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Fixes: 1955c8cf ("perf tools: Don't hardcode host include path for libslang")
      Link: https://lkml.kernel.org/n/tip-2sy7hbwkx68jr6n97qxgg0c6@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cbefd24f
  17. 18 6月, 2019 2 次提交
    • F
      perf tools: Don't hardcode host include path for libslang · 1955c8cf
      Florian Fainelli 提交于
      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: NFlorian Fainelli <f.fainelli@gmail.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: bcm-kernel-feedback-list@broadcom.com
      Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin.monnet@netronome.com>
      Cc: Stanislav Fomichev <sdf@google.com>
      Fixes: ef7b93a1 ("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.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1955c8cf
    • A
      tools build: Check if gettid() is available before providing helper · 4541a8bb
      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: NLaura Abbott <labbott@redhat.com>
      Tested-by: NLaura Abbott <labbott@redhat.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Florian Weimer <fweimer@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lkml.kernel.org/n/tip-yfy3ch53agmklwu9o7rlgf9c@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4541a8bb
  18. 02 4月, 2019 1 次提交
  19. 21 12月, 2018 1 次提交
    • S
      perf build: Don't unconditionally link the libbfd feature test to -liberty and -lz · 14541b1e
      Stanislav Fomichev 提交于
      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 2cf90407 ("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 280e7c48 ("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: NStanislav Fomichev <sdf@google.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/4dfc634cfcfb236883971b5107cf3c28ec8a31be.1542328222.git.sdf@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      14541b1e
  20. 18 12月, 2018 1 次提交
    • A
      tools build feature: Check if libaio is available · 2a07d814
      Alexey Budankov 提交于
      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: NAlexey Budankov <alexey.budankov@linux.intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Reviewed-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/5fcda10c-6c63-68df-383a-c6d9e5d1f918@linux.intel.com
      [ split from a larger patch ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2a07d814
  21. 22 11月, 2018 2 次提交
    • J
      perf jvmti: Separate jvmti cmlr check · dd1d0044
      Jiri Olsa 提交于
      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: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ben Gainey <ben.gainey@arm.com>
      Cc: Gustavo Luiz Duarte <gduarte@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/20181121154341.21521-1-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dd1d0044
    • A
      tools build feature: Check if eventfd() is available · 11c6cbe7
      Arnaldo Carvalho de Melo 提交于
      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 <adrian.hunter@intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Davidlohr Bueso <dbueso@suse.de>
      Cc: Jason Baron <jbaron@akamai.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-wkeldwob7dpx6jvtuzl8164k@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      11c6cbe7
  22. 20 11月, 2018 1 次提交
  23. 12 7月, 2018 1 次提交
  24. 08 3月, 2018 2 次提交
  25. 25 1月, 2018 1 次提交
  26. 17 1月, 2018 1 次提交
    • J
      tools: bpftool: add -DPACKAGE when including bfd.h · 39b72ccd
      Jiong Wang 提交于
      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: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NJiong Wang <jiong.wang@netronome.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      39b72ccd
  27. 30 12月, 2017 1 次提交
  28. 05 12月, 2017 1 次提交
  29. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      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 <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  30. 19 7月, 2017 1 次提交
  31. 13 4月, 2017 1 次提交
  32. 12 4月, 2017 1 次提交
  33. 04 3月, 2017 2 次提交
  34. 07 12月, 2016 1 次提交
    • W
      perf build: Check LLVM version in feature check · a940cad3
      Wang Nan 提交于
      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<char const*, 16u>, 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<char const*, 16u> const&)'
        /tmp/build/perf/libperf.a(libperf-in.o): In function `perf::getModuleFromSource(llvm::SmallVector<char const*, 16u>, llvm::StringRef, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>)':
        /home/acme/git/linux/tools/perf/util/c++/clang.cpp:68: undefined reference to `clang::CompilerInstance::CompilerInstance(std::shared_ptr<clang::PCHContainerOperations>, bool)'
        /home/acme/git/linux/tools/perf/util/c++/clang.cpp:69: undefined reference to `clang::CompilerInstance::createDiagnostics(clang::DiagnosticConsumer*, bool)'
        <SNIP>
      
      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: NWang Nan <wangnan0@huawei.com>
      Reported-and-Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexei Starovoitov <ast@fb.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Joe Stringer <joe@ovn.org>
      Cc: Zefan Li <lizefan@huawei.com>
      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: NArnaldo Carvalho de Melo <acme@redhat.com>
      a940cad3
  35. 06 12月, 2016 1 次提交