This is an automated email from the ASF dual-hosted git repository.

liuhan pushed a commit to branch tmp_disable_reading
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git


The following commit(s) were added to refs/heads/tmp_disable_reading by this 
push:
     new 3899fad  update
3899fad is described below

commit 3899fadf645a0c8c89f88967537c543153b5e92f
Author: mrproliu <[email protected]>
AuthorDate: Sat Dec 21 16:44:04 2024 +0800

    update
---
 bpf/include/queue.h    | 22 +++++++++++-----------
 pkg/tools/btf/queue.go |  1 +
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/bpf/include/queue.h b/bpf/include/queue.h
index c6b532c..1dce8e3 100644
--- a/bpf/include/queue.h
+++ b/bpf/include/queue.h
@@ -36,26 +36,26 @@ struct {
 static __always_inline void *rover_reserve_buf(void *map, __u64 size) {
        static const int zero = 0;
 
-       if (bpf_core_enum_value_exists(enum bpf_func_id,
-                                      BPF_FUNC_ringbuf_reserve))
-               return bpf_ringbuf_reserve(map, size, 0);
+//     if (bpf_core_enum_value_exists(enum bpf_func_id,
+//                                    BPF_FUNC_ringbuf_reserve))
+//             return bpf_ringbuf_reserve(map, size, 0);
 
        return bpf_map_lookup_elem(&rover_data_heap, &zero);
 }
 
 static __always_inline void rover_discard_buf(void *buf)
 {
-       if (bpf_core_enum_value_exists(enum bpf_func_id,
-                                      BPF_FUNC_ringbuf_discard))
-               bpf_ringbuf_discard(buf, 0);
+//     if (bpf_core_enum_value_exists(enum bpf_func_id,
+//                                    BPF_FUNC_ringbuf_discard))
+//             bpf_ringbuf_discard(buf, 0);
 }
 
 static __always_inline long rover_submit_buf(void *ctx, void *map, void *buf, 
__u64 size) {
-       if (bpf_core_enum_value_exists(enum bpf_func_id,
-                                      BPF_FUNC_ringbuf_submit)) {
-               bpf_ringbuf_submit(buf, 0);
-               return 0;
-       }
+//     if (bpf_core_enum_value_exists(enum bpf_func_id,
+//                                    BPF_FUNC_ringbuf_submit)) {
+//             bpf_ringbuf_submit(buf, 0);
+//             return 0;
+//     }
 
        return bpf_perf_event_output(ctx, map, BPF_F_CURRENT_CPU, buf, size);
 }
\ No newline at end of file
diff --git a/pkg/tools/btf/queue.go b/pkg/tools/btf/queue.go
index c07a15c..fd89be1 100644
--- a/pkg/tools/btf/queue.go
+++ b/pkg/tools/btf/queue.go
@@ -49,6 +49,7 @@ func isRingbufAvailable() bool {
                buf.Close()
 
                ringbufAvailable = err == nil
+               ringbufAvailable = false
 
                if ringbufAvailable {
                        log.Infof("detect the ring buffer is available in 
current system for enhancement of data queue")

Reply via email to