diff --git a/GPL/Events/Helpers.h b/GPL/Events/Helpers.h index 9045cd86..ba1fb3a3 100644 --- a/GPL/Events/Helpers.h +++ b/GPL/Events/Helpers.h @@ -14,11 +14,6 @@ const volatile int consumer_pid = 0; -#if BPF_DEBUG_TRACE == 0 -#undef bpf_printk -#define bpf_printk(fmt, ...) -#endif - // Compiler barrier, used to prevent compile-time insns reordering and optimizations. #define barrier() asm volatile("" ::: "memory") diff --git a/GPL/Events/Process/Probe.bpf.c b/GPL/Events/Process/Probe.bpf.c index 78569371..bc4ea749 100644 --- a/GPL/Events/Process/Probe.bpf.c +++ b/GPL/Events/Process/Probe.bpf.c @@ -372,6 +372,7 @@ static int tty_write__enter(struct kiocb *iocb, struct iov_iter *from) } const struct iovec *iov; + bpf_printk("hello %d", FIELD_OFFSET(iov_iter, __iov)); if (FIELD_OFFSET(iov_iter, __iov) > 0) { iov = (struct iovec *)from + FIELD_OFFSET(iov_iter, __iov); } else { diff --git a/non-GPL/Events/Lib/EbpfEvents.c b/non-GPL/Events/Lib/EbpfEvents.c index 4b8474c2..b6a59d26 100644 --- a/non-GPL/Events/Lib/EbpfEvents.c +++ b/non-GPL/Events/Lib/EbpfEvents.c @@ -69,13 +69,10 @@ static int resolve_btf_field_off_recur(struct btf *btf, for (int i = 0; i < btf_vlen(t); i++, m++) { const char *name = btf__name_by_offset(btf, m->name_off); - printf("field off: %s @ %d+%d", name, base_off, m->offset); if (name == NULL) continue; - if (strcmp(name, field) == 0) { - printf("[OK] %s @ %d+%d", name, base_off, m->offset); + if (strcmp(name, field) == 0) return base_off + m->offset; - } const struct btf_type *m_type = btf__type_by_id(btf, m->type); if (!btf_is_struct(m_type) && !btf_is_union(m_type)) @@ -89,7 +86,6 @@ static int resolve_btf_field_off_recur(struct btf *btf, return ret; } - printf("not found: %d+%d", base_off, m->offset); return -1; } @@ -273,8 +269,9 @@ static int probe_fill_relos(struct btf *btf, struct EventProbe_bpf *obj) } err = err ?: FILL_FUNC_RET_IDX(obj, btf, vfs_rename); - if (BTF_FIELD_EXISTS(btf, iov_iter, __iov)) - err = err ?: FILL_FIELD_OFFSET(obj, btf, iov_iter, __iov); + FILL_FIELD_OFFSET(obj, btf, iov_iter, __iov); + // if (BTF_FIELD_EXISTS(btf, iov_iter, __iov)) + // err = err ?: FILL_FIELD_OFFSET(obj, btf, iov_iter, __iov); return err; }