Want abstraction over USDT/SDT split in probes

Đang mở
#389 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
networking

Hướng nghiên cứu

Start by surveying the Port::*_probe methods and their repeated cfg_if! branches for SDT, USDT, and no-op behavior. Compare the argument-conversion paths and determine the intended macro or abstraction boundary. Done means current and future DTrace probes can use the shared abstraction without duplicating the conditional probe setup.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

cleanup

Many of the DTrace probes we have in OPTE are structured such that they automatically switch between USDT and SDT probes depending on whether the crate is compiled for userland (cargo test) or as part of the kernel module (xde):

impl Port {
    fn xyz_probe(&self, dir: Direction, pkt: &Packet<Parsed>, msg: String) {
        cfg_if::cfg_if! {
            if #[cfg(all(not(feature = "std"), not(test)))] {
                /* SDT-specific arg conversion: String->CString, ... */
                unsafe {
                    __dtrace_probe_xyz(
                        /* ... pointers to args ... */
                    );
                }
            } else if #[cfg(feature = "usdt")] {
                /* USDT-specific arg conversion */
                crate::opte_provider::xyz!(
                    || (/* ... Rust-friendly args (references, owned types) ... */)
                );
            } else {
                /* feature-flag-driven no-op */
                let (..) = (dir, pkt, msg);
            }
        }
    }
}

Many of the Port::*_probe methods have a structure more or less in line with this, which leads to a lot of duplication and noise. We should define a macro or similar abstraction to simplify the implementation of {current, future} DTrace probes we choose to insert.

Ngôn ngữ chính
Rust
Star
82
Fork
16
Merge trung bình
3 ngày 6 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của oxidecomputer/opte

Tất cả issue của oxidecomputer/opte

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.