Want abstraction over USDT/SDT split in probes

オープン
#389 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
rust
領域
networking

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
82
フォーク
16
平均マージ
3日 6時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oxidecomputer/opte のほかの issue

oxidecomputer/opte の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。