Skip to content
Snippets Groups Projects
  1. Oct 12, 2019
  2. Oct 11, 2019
  3. Oct 10, 2019
  4. Oct 09, 2019
  5. Oct 08, 2019
  6. Oct 07, 2019
  7. Oct 06, 2019
    • Toke Høiland-Jørgensen's avatar
      libbpf: Add cscope and tags targets to Makefile · a9eb048d
      Toke Høiland-Jørgensen authored
      
      Using cscope and/or TAGS files for navigating the source code is useful.
      Add simple targets to the Makefile to generate the index files for both
      tools.
      
      Signed-off-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Tested-by: default avatarAndrii Nakryiko <andriin@fb.com>
      Acked-by: default avatarAndrii Nakryiko <andriin@fb.com>
      Link: https://lore.kernel.org/bpf/20191004153444.1711278-1-toke@redhat.com
      a9eb048d
    • Alexei Starovoitov's avatar
      Merge branch 'libbpf-api' · b84fbfe2
      Alexei Starovoitov authored
      
      Andrii Nakryiko says:
      
      ====================
      Add bpf_object__open_file() and bpf_object__open_mem() APIs that use a new
      approach to providing future-proof non-ABI-breaking API changes. It relies on
      APIs accepting optional self-describing "opts" struct, containing its own
      size, filled out and provided by potentially outdated (as well as
      newer-than-libbpf) user application. A set of internal helper macros
      (OPTS_VALID, OPTS_HAS, and OPTS_GET) streamline and simplify a graceful
      handling forward and backward compatibility for user applications dynamically
      linked against different versions of libbpf shared library.
      
      Users of libbpf are provided with convenience macro LIBBPF_OPTS that takes
      care of populating correct structure size and zero-initializes options struct,
      which helps avoid obscure issues of unitialized padding. Uninitialized padding
      in a struct might turn into garbage-populated new fields understood by future
      versions of libbpf.
      
      Patch #1 removes enforcement of kern_version in libbpf and always populates
      correct one on behalf of users.
      Patch #2 defines necessary infrastructure for options and two new open APIs
      relying on it.
      Patch #3 fixes bug in bpf_object__name().
      Patch #4 switches two of test_progs' tests to use new APIs as a validation
      that they work as expected.
      
      v2->v3:
      - fix LIBBPF_OPTS() to ensure zero-initialization of padded bytes;
      - pass through name override and relaxed maps flag for open_file() (Toke);
      - fix bpf_object__name() to actually return object name;
      - don't bother parsing and verifying version section (John);
      
      v1->v2:
      - use better approach for tracking last field in opts struct;
      - convert few tests to new APIs for validation;
      - fix bug with using offsetof(last_field) instead of offsetofend(last_field).
      ====================
      
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      b84fbfe2
    • Andrii Nakryiko's avatar
      selftests/bpf: switch tests to new bpf_object__open_{file, mem}() APIs · 928ca75e
      Andrii Nakryiko authored
      
      Verify new bpf_object__open_mem() and bpf_object__open_file() APIs work
      as expected by switching test_attach_probe test to use embedded BPF
      object and bpf_object__open_mem() and test_reference_tracking to
      bpf_object__open_file().
      
      Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      928ca75e
    • Andrii Nakryiko's avatar
      libbpf: fix bpf_object__name() to actually return object name · c9e4c301
      Andrii Nakryiko authored
      
      bpf_object__name() was returning file path, not name. Fix this.
      
      Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      c9e4c301
Loading