modality-probe manifest-gen

Command: modality-probe manifest-gen <source path>

Generate Modality component definition files from instrumentation macro invocations found in the provided source tree.

# Example

$ modality-probe manifest-gen --lang c --file-extension c --component-name test-component --output-path src/test-component src
Adding probe PRODUCER_PROBE, ID 118856317 to src/test-component/probes.csv
Adding probe CONSUMER_PROBE, ID 924402791 to src/test-component/probes.csv
Adding event PRODUCER_STARTED, ID 1 to src/test-component/events.csv
Adding event PRODUCER_SHUTDOWN, ID 2 to src/test-component/events.csv
Adding event PRODUCER_MEASUREMENT_SAMPLED, ID 3 to src/test-component/events.csv
Adding event PRODUCER_SAMPLE_DELTA_OK, ID 4 to src/test-component/events.csv
Adding event PRODUCER_MEASUREMENT_SENT, ID 5 to src/test-component/events.csv
Adding event CONSUMER_STARTED, ID 6 to src/test-component/events.csv
Adding event CONSUMER_SHUTDOWN, ID 7 to src/test-component/events.csv
Adding event CONSUMER_MEASUREMENT_RECVD, ID 8 to src/test-component/events.csv
Updated component test-component in src/test-component/Component.toml

# Options

<source path> - Path to a directory containing files with Modality instrumentation macros. Modality will scan the entire source tree below this directory.

--component-name <component-name> - Component name used when generating a component manifest. Defaults to component.

--event-id-offset <event-id-offset> - Integer to start numbering event IDs from. Defaults to 1.

--exclude <exclude-patterns>... - Exclude files that match the given pattern.

--external-event <external-events>... - Supply additional event manifest entries that are external to the source code being searched. The format is JSON and minimally must include the event name string field. If the id field is absent, an event ID will be generated following the same rules used for in-source instrumentation.

Example <external-event> manifest entry:

'{
   "id":1,
   "name":"FOO",
   "description": "Event FOO",
   "tags": "tag-a;tag-b",
   "type_hint": "U32",
   "file": "file.c",
   "line": 11 
}'

--external-probe <external-probes>... - Supply additional probe manifest entries that are external to the source code being searched. The format is JSON and minimally must include the probe name string field. If the id field is absent, a probe ID will be generated following the same rules used for in-source instrumentation.

Example <external-probe> manifest entry:

'{
   "id":1, 
   "name":"FOO",
   "description": "Probe FOO",
   "tags": "tag-a;tag-b",
   "file": "file.c",
   "line": 11 
}'

--file-extension <file-extensions>... - Limit the source code searching to files with matching extensions.

-l, --lang <lang> - Language, either c or rust. If not specified then guess based on file extensions.

-o, --output-path <output-path> - Output path for generated component files. Defaults to component.

--probe-id-range <probe-id-range> - Constrain the generated probe ID to a specific range. This can be either <inclusive_start>..<exclusive_end> or <inclusive_start>..=<inclusive_end>. The range values are unsigned 32-bit integers and must be non-zero.

--regen-component-id - Regenerate the component IDs instead of using existing IDs (if present).

-v, --verbose - Provide verbose output.