Skip to content
Snippets Groups Projects
  1. May 21, 2016
  2. May 09, 2016
    • Arnd Bergmann's avatar
      [media] samples: v4l: from Documentation to samples directory · 0185f850
      Arnd Bergmann authored
      
      With the new autoksyms support, we can run into a situation where
      the v4l pci skeleton module is the only one using some exported
      symbols that get dropped because they are never referenced by
      the kernel otherwise, causing a build problem:
      
      ERROR: "vb2_dma_contig_memops" [Documentation/video4linux/v4l2-pci-skeleton.ko] undefined!
      ERROR: "vb2_dma_contig_init_ctx_attrs" [Documentation/video4linux/v4l2-pci-skeleton.ko] undefined!
      ERROR: "v4l2_match_dv_timings" [Documentation/video4linux/v4l2-pci-skeleton.ko] undefined!
      ERROR: "v4l2_find_dv_timings_cap" [Documentation/video4linux/v4l2-pci-skeleton.ko] undefined!
      ERROR: "v4l2_valid_dv_timings" [Documentation/video4linux/v4l2-pci-skeleton.ko] undefined!
      ERROR: "v4l2_enum_dv_timings_cap" [Documentation/video4linux/v4l2-pci-skeleton.ko] undefined!
      ERROR: "vb2_dma_contig_cleanup_ctx" [Documentation/video4linux/v4l2-pci-skeleton.ko] undefined!
      
      Specifically, we do look in the samples directory for users of
      symbols, but not the Documentation directory.
      
      This solves the build problem by moving the connector sample into
      the same directory as the other samples.
      
      Fixes: 23121ca2 ("kbuild: create/adjust generated/autoksyms.h")
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      0185f850
  3. May 06, 2016
  4. Apr 29, 2016
  5. Apr 28, 2016
  6. Apr 15, 2016
  7. Apr 08, 2016
  8. Apr 06, 2016
    • Naveen N. Rao's avatar
      samples/bpf: Enable powerpc support · 138d6153
      Naveen N. Rao authored
      
      Add the necessary definitions for building bpf samples on ppc.
      
      Since ppc doesn't store function return address on the stack, modify how
      PT_REGS_RET() and PT_REGS_FP() work.
      
      Also, introduce PT_REGS_IP() to access the instruction pointer.
      
      Cc: Alexei Starovoitov <ast@fb.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      138d6153
    • Naveen N. Rao's avatar
      samples/bpf: Use llc in PATH, rather than a hardcoded value · 128d1514
      Naveen N. Rao authored
      
      While at it, remove the generation of .s files and fix some typos in the
      related comment.
      
      Cc: Alexei Starovoitov <ast@fb.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      128d1514
    • Naveen N. Rao's avatar
      samples/bpf: Fix build breakage with map_perf_test_user.c · 77e63534
      Naveen N. Rao authored
      
      Building BPF samples is failing with the below error:
      
      samples/bpf/map_perf_test_user.c: In function ‘main’:
      samples/bpf/map_perf_test_user.c:134:9: error: variable ‘r’ has
      initializer but incomplete type
        struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
               ^
      samples/bpf/map_perf_test_user.c:134:21: error: ‘RLIM_INFINITY’
      undeclared (first use in this function)
        struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
                           ^
      samples/bpf/map_perf_test_user.c:134:21: note: each undeclared
      identifier is reported only once for each function it appears in
      samples/bpf/map_perf_test_user.c:134:9: warning: excess elements in
      struct initializer [enabled by default]
        struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
               ^
      samples/bpf/map_perf_test_user.c:134:9: warning: (near initialization
      for ‘r’) [enabled by default]
      samples/bpf/map_perf_test_user.c:134:9: warning: excess elements in
      struct initializer [enabled by default]
      samples/bpf/map_perf_test_user.c:134:9: warning: (near initialization
      for ‘r’) [enabled by default]
      samples/bpf/map_perf_test_user.c:134:16: error: storage size of ‘r’
      isn’t known
        struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
                      ^
      samples/bpf/map_perf_test_user.c:139:2: warning: implicit declaration of
      function ‘setrlimit’ [-Wimplicit-function-declaration]
        setrlimit(RLIMIT_MEMLOCK, &r);
        ^
      samples/bpf/map_perf_test_user.c:139:12: error: ‘RLIMIT_MEMLOCK’
      undeclared (first use in this function)
        setrlimit(RLIMIT_MEMLOCK, &r);
                  ^
      samples/bpf/map_perf_test_user.c:134:16: warning: unused variable ‘r’
      [-Wunused-variable]
        struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
                      ^
      make[2]: *** [samples/bpf/map_perf_test_user.o] Error 1
      
      Fix this by including the necessary header file.
      
      Cc: Alexei Starovoitov <ast@fb.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      77e63534
  9. Apr 01, 2016
    • Jessica Yu's avatar
      livepatch: reuse module loader code to write relocations · 425595a7
      Jessica Yu authored
      
      Reuse module loader code to write relocations, thereby eliminating the need
      for architecture specific relocation code in livepatch. Specifically, reuse
      the apply_relocate_add() function in the module loader to write relocations
      instead of duplicating functionality in livepatch's arch-dependent
      klp_write_module_reloc() function.
      
      In order to accomplish this, livepatch modules manage their own relocation
      sections (marked with the SHF_RELA_LIVEPATCH section flag) and
      livepatch-specific symbols (marked with SHN_LIVEPATCH symbol section
      index). To apply livepatch relocation sections, livepatch symbols
      referenced by relocs are resolved and then apply_relocate_add() is called
      to apply those relocations.
      
      In addition, remove x86 livepatch relocation code and the s390
      klp_write_module_reloc() function stub. They are no longer needed since
      relocation work has been offloaded to module loader.
      
      Lastly, mark the module as a livepatch module so that the module loader
      canappropriately identify and initialize it.
      
      Signed-off-by: default avatarJessica Yu <jeyu@redhat.com>
      Reviewed-by: default avatarMiroslav Benes <mbenes@suse.cz>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>   # for s390 changes
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      425595a7
  10. Mar 09, 2016
  11. Mar 08, 2016
  12. Feb 20, 2016
    • Alexei Starovoitov's avatar
      samples/bpf: offwaketime example · a6ffe7b9
      Alexei Starovoitov authored
      
      This is simplified version of Brendan Gregg's offwaketime:
      This program shows kernel stack traces and task names that were blocked and
      "off-CPU", along with the stack traces and task names for the threads that woke
      them, and the total elapsed time from when they blocked to when they were woken
      up. The combined stacks, task names, and total time is summarized in kernel
      context for efficiency.
      
      Example:
      $ sudo ./offwaketime | flamegraph.pl > demo.svg
      Open demo.svg in the browser as FlameGraph visualization.
      
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a6ffe7b9
  13. Feb 06, 2016
  14. Nov 16, 2015
  15. Nov 03, 2015
    • Daniel Borkmann's avatar
      bpf: add sample usages for persistent maps/progs · 42984d7c
      Daniel Borkmann authored
      
      This patch adds a couple of stand-alone examples on how BPF_OBJ_PIN
      and BPF_OBJ_GET commands can be used.
      
      Example with maps:
      
        # ./fds_example -F /sys/fs/bpf/m -P -m -k 1 -v 42
        bpf: map fd:3 (Success)
        bpf: pin ret:(0,Success)
        bpf: fd:3 u->(1:42) ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/m -G -m -k 1
        bpf: get fd:3 (Success)
        bpf: fd:3 l->(1):42 ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/m -G -m -k 1 -v 24
        bpf: get fd:3 (Success)
        bpf: fd:3 u->(1:24) ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/m -G -m -k 1
        bpf: get fd:3 (Success)
        bpf: fd:3 l->(1):24 ret:(0,Success)
      
        # ./fds_example -F /sys/fs/bpf/m2 -P -m
        bpf: map fd:3 (Success)
        bpf: pin ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/m2 -G -m -k 1
        bpf: get fd:3 (Success)
        bpf: fd:3 l->(1):0 ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/m2 -G -m
        bpf: get fd:3 (Success)
      
      Example with progs:
      
        # ./fds_example -F /sys/fs/bpf/p -P -p
        bpf: prog fd:3 (Success)
        bpf: pin ret:(0,Success)
        bpf sock:4 <- fd:3 attached ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/p -G -p
        bpf: get fd:3 (Success)
        bpf: sock:4 <- fd:3 attached ret:(0,Success)
      
        # ./fds_example -F /sys/fs/bpf/p2 -P -p -o ./sockex1_kern.o
        bpf: prog fd:5 (Success)
        bpf: pin ret:(0,Success)
        bpf: sock:3 <- fd:5 attached ret:(0,Success)
        # ./fds_example -F /sys/fs/bpf/p2 -G -p
        bpf: get fd:3 (Success)
        bpf: sock:4 <- fd:3 attached ret:(0,Success)
      
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      42984d7c
  16. Nov 02, 2015
  17. Oct 28, 2015
Loading