oxidecomputer / oxidecomputer/opte

Want SDT probes for `gen_desc()`

Open
#35 1 comment 0 reactions 1 assignee View on GitHub

@rzezeski is already working on this.

Since Feb 4, 2022.

Dominant language
Rust
Stars
77
Forks
11
Avg merge
9d 20h
Merged PRs (30d)
8

Description

It would be nice to have an SDT probe fire anytime a new action descriptor is generated (gen_desc()). This probe could either be generic to all actions or specific to each action.

  1. Generic: Have each action descriptor implement Display and have a generic action-desc-created even whose single argument is a string.

  2. Specific: Have each action create its own SDT probe, e.g. something like snat-desc-created. Then create a repr(C) struct holding the important information of such a descriptor. The probe would then pass a pointer to said structure, allowing the consumer to inspect and format the information in any manner they desire.

Option 2 obviously gives more control, but it also means more code, and making sure that new actions add a probe. Perhaps we can enforce probe creation somehow via a trait? For example:

trait ActionDesc {
    fn fire_create_probe(&self);
}

I lean towards option 2, if only for the fact that it can be extremely useful, when debugging, to be able to programmatically filter matches when using DTrace. Option 1 would require hacks like strstr() or post-processing with awk.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.