1. 11 2月, 2019 3 次提交
  2. 09 2月, 2019 4 次提交
  3. 08 2月, 2019 2 次提交
    • Y
      tools/bpf: add log_level to bpf_load_program_attr · a4021a35
      Yonghong Song 提交于
      The kernel verifier has three levels of logs:
          0: no logs
          1: logs mostly useful
        > 1: verbose
      
      Current libbpf API functions bpf_load_program_xattr() and
      bpf_load_program() cannot specify log_level.
      The bcc, however, provides an interface for user to
      specify log_level 2 for verbose output.
      
      This patch added log_level into structure
      bpf_load_program_attr, so users, including bcc, can use
      bpf_load_program_xattr() to change log_level. The
      supported log_level is 0, 1, and 2.
      
      The bpf selftest test_sock.c is modified to enable log_level = 2.
      If the "verbose" in test_sock.c is changed to true,
      the test will output logs like below:
        $ ./test_sock
        func#0 @0
        0: R1=ctx(id=0,off=0,imm=0) R10=fp0,call_-1
        0: (bf) r6 = r1
        1: R1=ctx(id=0,off=0,imm=0) R6_w=ctx(id=0,off=0,imm=0) R10=fp0,call_-1
        1: (61) r7 = *(u32 *)(r6 +28)
        invalid bpf_context access off=28 size=4
      
        Test case: bind4 load with invalid access: src_ip6 .. [PASS]
        ...
        Test case: bind6 allow all .. [PASS]
        Summary: 16 PASSED, 0 FAILED
      
      Some test_sock tests are negative tests and verbose verifier
      log will be printed out as shown in the above.
      Signed-off-by: NYonghong Song <yhs@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      a4021a35
    • A
      tools/bpf: add missing strings.h include · 62b8cea6
      Andrii Nakryiko 提交于
      Few files in libbpf are using bzero() function (defined in strings.h header), but
      don't include corresponding header. When libbpf is added as a dependency to pahole,
      this undeterministically causes warnings on some machines:
      
      bpf.c:225:2: warning: implicit declaration of function 'bzero' [-Wimplicit-function-declaration]
        bzero(&attr, sizeof(attr));
          ^~~~~
      Signed-off-by: NAndrii Nakryiko <andriin@fb.com>
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      62b8cea6
  4. 07 2月, 2019 1 次提交
  5. 06 2月, 2019 9 次提交
  6. 05 2月, 2019 11 次提交
  7. 04 2月, 2019 1 次提交
  8. 02 2月, 2019 9 次提交