title: Printing Hello World using uBPF?
body: <p>I am messing around with uBPF recently and have noticed that I can't seem to implement any print functions within uBPF. I tried adding my code directly to test.c within the VM folder but and have it as a registered function but I am left with relocation errors, leaving me without a solution. I have seen an implementation with OKO but that does not seem to fix my problem either.</p>
  <p>Here is my registered code:</p>
  <pre><code>static void
  register_functions(struct ubpf_vm *vm)
  {
      ubpf_register(vm, 0, &quot;gather_bytes&quot;, gather_bytes);
      ubpf_register(vm, 1, &quot;memfrob&quot;, memfrob);
      ubpf_register(vm, 2, &quot;trash_registers&quot;, trash_registers);
      ubpf_register(vm, 3, &quot;ubpf_printf&quot;, ubpf_printf);
  }
  </code></pre>
  <p>And here is the print function itself:</p>
  <pre><code>static void
  ubpf_printf(const char *fmt, ...)
  {
      va_list args;
      va_start(args, fmt);
      char str[MAX_PRINTF_LENGTH];
      if (vsnprintf(str, MAX_PRINTF_LENGTH, fmt, args) &gt;= 0)
          VLOG_ERR(&quot;%s&quot;, str);
      va_end(args);
  }
  </code></pre>
  <p>My question is how do I implement a print function that can print whatever I want?</p>
  <p>Edit: Adding the error itself, after implementing my test function within test.c. The vlog.h file is there but I still seem to get the error.</p>
  <pre><code>make -C vm
  make: Entering directory '/home/pi/Desktop/ubpfModified/vm'
  cc -Wall -Werror -Iinc -O2 -g -Wunused-parameter   -c -o test.o test.c
  test.c:32:10: fatal error: /home/pi/Desktop/ubpf/vm/vlog.h: No such file or directory
     32 | #include &quot;/home/pi/Desktop/ubpf/vm/vlog.h&quot;
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  make: *** [&lt;builtin&gt;: test.o] Error 1
  make: Leaving directory '/home/pi/Desktop/ubpfModified/vm'
  </code></pre>