1. 22 10月, 2021 10 次提交
  2. 21 10月, 2021 7 次提交
  3. 20 10月, 2021 4 次提交
    • Q
      bpftool: Turn check on zlib from a phony target into a conditional error · 062e1fc0
      Quentin Monnet 提交于
      One of bpftool's object files depends on zlib. To make sure we do not
      attempt to build that object when the library is not available, commit
      d66fa3c7 ("tools: bpftool: add feature check for zlib") introduced a
      feature check to detect whether zlib is present.
      
      This check comes as a rule for which the target ("zdep") is a
      nonexistent file (phony target), which means that the Makefile always
      attempts to rebuild it. It is mostly harmless. However, one side effect
      is that, on running again once bpftool is already built, make considers
      that "something" (the recipe for zdep) was executed, and does not print
      the usual message "make: Nothing to be done for 'all'", which is a
      user-friendly indicator that the build went fine.
      
      Before, with some level of debugging information:
      
          $ make --debug=m
          [...]
          Reading makefiles...
      
          Auto-detecting system features:
          ...                        libbfd: [ on  ]
          ...        disassembler-four-args: [ on  ]
          ...                          zlib: [ on  ]
          ...                        libcap: [ on  ]
          ...               clang-bpf-co-re: [ on  ]
      
          Updating makefiles....
          Updating goal targets....
           File 'all' does not exist.
                 File 'zdep' does not exist.
                Must remake target 'zdep'.
           File 'all' does not exist.
          Must remake target 'all'.
          Successfully remade target file 'all'.
      
      After the patch:
      
          $ make --debug=m
          [...]
      
          Auto-detecting system features:
          ...                        libbfd: [ on  ]
          ...        disassembler-four-args: [ on  ]
          ...                          zlib: [ on  ]
          ...                        libcap: [ on  ]
          ...               clang-bpf-co-re: [ on  ]
      
          Updating makefiles....
          Updating goal targets....
           File 'all' does not exist.
          Must remake target 'all'.
          Successfully remade target file 'all'.
          make: Nothing to be done for 'all'.
      
      (Note the last line, which is not part of make's debug information.)
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Acked-by: NJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20211009210341.6291-4-quentin@isovalent.com
      062e1fc0
    • Q
      bpftool: Do not FORCE-build libbpf · ced846c6
      Quentin Monnet 提交于
      In bpftool's Makefile, libbpf has a FORCE dependency, to make sure we
      rebuild it in case its source files changed. Let's instead make the
      rebuild depend on the source files directly, through a call to the
      "$(wildcard ...)" function. This avoids descending into libbpf's
      directory if there is nothing to update.
      
      Do the same for the bootstrap libbpf version.
      
      This results in a slightly faster operation and less verbose output when
      running make a second time in bpftool's directory.
      
      Before:
      
          Auto-detecting system features:
          ...                        libbfd: [ on  ]
          ...        disassembler-four-args: [ on  ]
          ...                          zlib: [ on  ]
          ...                        libcap: [ on  ]
          ...               clang-bpf-co-re: [ on  ]
      
          make[1]: Entering directory '/root/dev/linux/tools/lib/bpf'
          make[1]: Entering directory '/root/dev/linux/tools/lib/bpf'
          make[1]: Nothing to be done for 'install_headers'.
          make[1]: Leaving directory '/root/dev/linux/tools/lib/bpf'
          make[1]: Leaving directory '/root/dev/linux/tools/lib/bpf'
      
      After:
      
          Auto-detecting system features:
          ...                        libbfd: [ on  ]
          ...        disassembler-four-args: [ on  ]
          ...                          zlib: [ on  ]
          ...                        libcap: [ on  ]
          ...               clang-bpf-co-re: [ on  ]
      
      Other ways to clean up the output could be to pass the "-s" option, or
      to redirect the output to >/dev/null, when calling make recursively to
      descend into libbpf's directory. However, this would suppress some
      useful output if something goes wrong during the build. A better
      alternative would be to pass "--no-print-directory" to the recursive
      make, but that would still leave us with some noise for
      "install_headers". Skipping the descent into libbpf's directory if no
      source file has changed works best, and seems the most logical option
      overall.
      Reported-by: NAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Acked-by: NJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20211009210341.6291-3-quentin@isovalent.com
      ced846c6
    • Q
      bpftool: Fix install for libbpf's internal header(s) · 34e3ab14
      Quentin Monnet 提交于
      We recently updated bpftool's Makefile to make it install the headers
      from libbpf, instead of pulling them directly from libbpf's directory.
      There is also an additional header, internal to libbpf, that needs be
      installed. The way that bpftool's Makefile installs that particular
      header is currently correct, but would break if we were to modify
      $(LIBBPF_INTERNAL_HDRS) to make it point to more than one header.
      
      Use a static pattern rule instead, so that the Makefile can withstand
      the addition of other headers to install.
      
      The objective is simply to make the Makefile more robust. It should
      _not_ be read as an invitation to import more internal headers from
      libbpf into bpftool.
      
      Fixes: f012ade1 ("bpftool: Install libbpf headers instead of including the dir")
      Reported-by: NAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Acked-by: NJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20211009210341.6291-2-quentin@isovalent.com
      34e3ab14
    • Q
      libbpf: Remove Makefile warnings on out-of-sync netlink.h/if_link.h · d51b6b22
      Quentin Monnet 提交于
      Although relying on some definitions from the netlink.h and if_link.h
      headers copied into tools/include/uapi/linux/, libbpf does not need
      those headers to stay entirely up-to-date with their original versions,
      and the warnings emitted by the Makefile when it detects a difference
      are usually just noise. Let's remove those warnings.
      Suggested-by: NAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20211010002528.9772-1-quentin@isovalent.com
      d51b6b22
  4. 19 10月, 2021 1 次提交
  5. 09 10月, 2021 18 次提交