Skip to content

Commit

Permalink
examples/c/usdt: fix a compilation error
Browse files Browse the repository at this point in the history
Fix 'libbpf: failed to find BTF info for global/extern symbol' erro due
to an uninitialized global variables, which causes problems on Ubuntu
20.04.6 with clang 10.

I was able to compile on a newer ubuntu with a newer version of clang.
However, on a development module (nVidia Orin AGX) running Ubuntu
20.04.6 LTS with clang version 10.0.0-4ubuntu1, it is not possible to
use apt to update clang to a new version. Downloading the source code of
a higher version of clang for compilation is cumbersome.

So I hope that with the change, the project code can be easily compiled
and used in earlier os.

Signed-off-by: Liu Lingze <[email protected]>
  • Loading branch information
GorilaMond authored and anakryiko committed Oct 18, 2023
1 parent 25b7e7b commit 82cea43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/c/usdt.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <bpf/bpf_tracing.h>
#include <bpf/usdt.bpf.h>

pid_t my_pid;
pid_t my_pid = 0;

SEC("usdt/libc.so.6:libc:setjmp")
int BPF_USDT(usdt_auto_attach, void *arg1, int arg2, void *arg3)
Expand Down

0 comments on commit 82cea43

Please sign in to comment.