Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
OriGlassman authored and randomname21 committed Oct 27, 2024
1 parent ab6344f commit 202e2cf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/ebpf/c/tracee.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,18 @@ int lkm_seeker_mod_tree_tail(struct pt_regs *ctx)
if (!init_tailcall_program_data(&p, ctx))
return -1;

struct module *m;
if (bpf_core_field_exists(m->mem)) {
struct bpf_iter_num it;
int *v;
bpf_iter_num_new(&it, 2, 5);
while ((v = bpf_iter_num_next(&it))) {
bpf_printk("aaa");
}
bpf_iter_num_destroy(&it);
bpf_printk("bbb");
}

u32 flags = HISTORY_SCAN_FINISHED;

// This method is efficient only when the kernel is compiled with
Expand Down
4 changes: 4 additions & 0 deletions pkg/ebpf/c/vmlinux.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ typedef __kernel_loff_t loff_t;

typedef unsigned short umode_t;

struct bpf_iter_num {
__u64 __opaque[1];
};

struct kernfs_node {
const char *name;
u64 id;
Expand Down

0 comments on commit 202e2cf

Please sign in to comment.