Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Apr 08, 2022
    • Niklas Söderlund's avatar
      samples/bpf, xdpsock: Fix race when running for fix duration of time · f9a66610
      Niklas Söderlund authored
      [ Upstream commit 8fa42d78 ]
      
      When running xdpsock for a fix duration of time before terminating
      using --duration=<n>, there is a race condition that may cause xdpsock
      to terminate immediately.
      
      When running for a fixed duration of time the check to determine when to
      terminate execution is in is_benchmark_done() and is being executed in
      the context of the poller thread,
      
          if (opt_duration > 0) {
                  unsigned long dt = (get_nsecs() - start_time);
      
                  if (dt >= opt_duration)
                          benchmark_done = true;
          }
      
      However start_time is only set after the poller thread have been
      created. This leaves a small window when the poller thread is starting
      and calls is_benchmark_done() for the first time that start_time is not
      yet set. In that case start_time have its initial value of 0 and the
      duration check fails as it do not correlate correctly for the
      applications start time and imme...
      f9a66610
  2. Jan 11, 2022
    • Jiri Olsa's avatar
      ftrace/samples: Add missing prototypes direct functions · 786a335f
      Jiri Olsa authored
      commit 0daf5cb2 upstream.
      
      There's another compilation fail (first here [1]) reported by kernel
      test robot for W=1 clang build:
      
        >> samples/ftrace/ftrace-direct-multi-modify.c:7:6: warning: no previous
        prototype for function 'my_direct_func1' [-Wmissing-prototypes]
           void my_direct_func1(unsigned long ip)
      
      Direct functions in ftrace direct sample modules need to have prototypes
      defined. They are already global in order to be visible for the inline
      assembly, so there's no problem.
      
      The kernel test robot reported just error for ftrace-direct-multi-modify,
      but I got same errors also for the rest of the modules touched by this patch.
      
      [1] 67d4f6e3 ftrace/samples: Add missing prototype for my_direct_func
      
      Link: https://lkml.kernel.org/r/20211219135317.212430-1-jolsa@kernel.org
      
      
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Fixes: e1067a07 ("ftrace/samples: Add module to test multi direct modify interface")
      F...
      786a335f
  3. Nov 18, 2021
  4. Sep 18, 2021
  5. Sep 15, 2021
  6. Jul 14, 2021
  7. Jun 10, 2021
  8. Jun 03, 2021
  9. May 19, 2021
  10. May 14, 2021
  11. Mar 17, 2021
  12. Mar 08, 2021
    • Suman Anna's avatar
      TEMP: samples/rpmsg: add compatible to support PDK IPC firmware images · b326f145
      Suman Anna authored
      
      Add a specific compatible "ti.ipc4.ping-pong" to the rpmsg device id
      list of the rpmsg client sample driver so that it can be properly probed
      with the rpmsg devices published and used by the current TI PDK IPC sample
      firmware images. This provides a kernel-level unit-test for the basic
      rpmsg communication with the various remote processors on various TI K3
      SoCs like AM65x, J721E, J7200 etc.
      
      This is needed until the current firmwares are updated to use the
      standard "rpmsg-client-sample" device name instead of the custom
      "ti.ipc4.ping-pong" device name.
      
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      b326f145
  13. Mar 04, 2021
  14. Dec 30, 2020
  15. Nov 30, 2020
  16. Oct 28, 2020
  17. Oct 27, 2020
  18. Oct 21, 2020
    • Daniel Borkmann's avatar
      bpf, libbpf: Guard bpf inline asm from bpf_tail_call_static · 3652c9a1
      Daniel Borkmann authored
      Yaniv reported a compilation error after pulling latest libbpf:
      
        [...]
        ../libbpf/src/root/usr/include/bpf/bpf_helpers.h:99:10: error:
        unknown register name 'r0' in asm
                           : "r0", "r1", "r2", "r3", "r4", "r5");
        [...]
      
      The issue got triggered given Yaniv was compiling tracing programs with native
      target (e.g. x86) instead of BPF target, hence no BTF generated vmlinux.h nor
      CO-RE used, and later llc with -march=bpf was invoked to compile from LLVM IR
      to BPF object file. Given that clang was expecting x86 inline asm and not BPF
      one the error complained that these regs don't exist on the former.
      
      Guard bpf_tail_call_static() with defined(__bpf__) where BPF inline asm is valid
      to use. BPF tracing programs on more modern kernels use BPF target anyway and
      thus the bpf_tail_call_static() function will be available for them. BPF inline
      asm is supported since clang 7 (clang <= 6 otherwise throws same above error),
      and __bpf_unreach...
      3652c9a1
  19. Oct 13, 2020
    • Hui Su's avatar
      mm,kmemleak-test.c: move kmemleak-test.c to samples dir · 1abbef4f
      Hui Su authored
      
      kmemleak-test.c is just a kmemleak test module, which also can not be used
      as a built-in kernel module.  Thus, i think it may should not be in mm
      dir, and move the kmemleak-test.c to samples/kmemleak/kmemleak-test.c.
      Fix the spelling of built-in by the way.
      
      Signed-off-by: default avatarHui Su <sh_def@163.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Cc: Divya Indi <divya.indi@oracle.com>
      Cc: Tomas Winkler <tomas.winkler@intel.com>
      Cc: David Howells <dhowells@redhat.com>
      Link: https://lkml.kernel.org/r/20200925183...
      1abbef4f
  20. Oct 11, 2020
  21. Oct 07, 2020
  22. Oct 06, 2020
  23. Oct 02, 2020