Skip to content

Commit

Permalink
CI: fix test failure on 5.15 kernel
Browse files Browse the repository at this point in the history
Signed-off-by: Tw <weii.tan>
  • Loading branch information
Tw committed May 9, 2023
1 parent 1afd70c commit 427ccad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v2
- run: sudo apt-get install -y libelf-dev libz-dev
- run: uname -a
- run: zig build test
- run: sudo ./zig-out/bin/test
lint:
Expand Down
6 changes: 2 additions & 4 deletions external/libbpf/src/libbpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2783,17 +2783,15 @@ static int bpf_object__sanitize_btf(struct bpf_object *obj, struct btf *btf)

#ifdef ZIG_BTF_WA
// https://github.com/tw4452852/zbpf/issues/3
else if (!btf_is_var(t) && !btf_is_func(t) && !btf_is_datasec(t) && !btf_is_fwd(t)) {
else if (btf_is_ptr(t)) {
t->name_off = 0;
} else if (btf_is_fwd(t)) {
} else if (btf_is_fwd(t) || btf_is_struct(t)) {
char *name = (char *)btf__name_by_offset(btf, t->name_off);
while (*name) {
if (*name == '.')
*name = '_';
name++;
}
} else if (btf_is_func(t)) {
t->info = BTF_INFO_ENC(BTF_KIND_TYPEDEF, 0, 0);
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion samples/ringbuf.zig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var my_pid = bpf.Map.ArrayMap("my_pid", u32, 1, 0).init();

var n: u32 = 0;

export fn test_ringbuf(_: *opaque {}) linksection("kprobe/do_nanosleep") c_int {
export fn test_ringbuf() linksection("kprobe/do_nanosleep") c_int {
const pid = my_pid.lookup(0) orelse return 1;

const cur_pid = @truncate(u32, helpers.get_current_pid_tgid());
Expand Down

0 comments on commit 427ccad

Please sign in to comment.