title: How to run the eBPF examples from `[linux_source_root]/samples/bpf`?
body: <p>I'm new to eBPf, I saw <a href="https://elixir.bootlin.com/linux/v5.17.9/source/samples/bpf" rel="nofollow noreferrer">some examples in the kernel sources</a>, I wonder how to run these examples?</p>
  <p>What I know is that eBPF programs are running in kernel and user applications are running in userspace. I learned from toturial that eBPF programs can be written in python, eg:</p>
  <pre class="lang-py prettyprint-override"><code>#!/usr/bin/python
  from bcc import BPF
  
  prog = &quot;&quot;&quot;
  int hello(void *ctx) {
      bpf_trace_printk(&quot;Hello world\\n&quot;);
      return 0;
  }
  &quot;&quot;&quot;
  
  b = BPF(text=prog)
  
  # attach the program to an event
  clone = b.get_syscall_fnname(&quot;clone&quot;)
  b.attach_kprobe(event=clone, fn_name=&quot;hello&quot;)
  b.trace_print()
  </code></pre>
  <p>I can directly use the command <code>./helloworld.py</code> to make it run.</p>
  <p>But the files in <a href="https://elixir.bootlin.com/linux/v5.17.9/source/samples/bpf/sockex1_kern.c" rel="nofollow noreferrer">linux source file</a> are hard for me to get them run like the python above.</p>