Vortex Studio SDK Advanced - Extension Categories and Filtering Options
Vortex® objects (e.g., parts, assemblies, constraints, collision geometries) are represented as dynamics extensions (VxSim::IDynamics, VxSim::IExtension), creating a lot of noise in the VxProfiler that is impossible to filter out, as all dynamics extensions belong to the same VxProfiler category. While some custom-made VxSim::IProfilingDataCollector extensions can provide their own filtering options, VxProfiler can be configured to collect data only from specific categories that must be registered to the VxProfiler prior to usage. However, the product's CSV provider does not provide any custom filtering. The result is a big CSV file that is complicated to filter.
Users can easily filter out Vortex extensions from the dynamics extensions section, so that they can concentrate on specific sections.
Categories
The VxProfiler is capable of filtering out section based on its categories. The categories are described in VxProfilerICD.h.
The main categories are:
Application
Engine
Graphics
Network
DynamicsExtensions
GraphicsExtensions
Default
Consider the example starting from the Application Post Update section:
Partial Section Hierarchy | Category |
|---|---|
ApplicationUpdate.ModulesPostUpdate | Application |
ApplicationUpdate.ModulesPostUpdate.%ModuleName% (for example, Engine) | Same as Parent, i.e. Application |
ApplicationUpdate.ModulesPostUpdate.Engine.ExtensionsPostStep | Engine |
ApplicationUpdate.ModulesPostUpdate.Engine.ExtensionsPostStep.%EXTENSION% | DynamicsExtensions |
Note %MODULE NAME% is replaced by an actual registered name, called alternate name. The % syntax is not actually relevant, any section can be renamed if their alternate name are registered.%EXTENSION% is the name of the extension formatted like this <Factory Key category name>.<Factory Key feature name>.<parent extension's name>.<extension's name>For example, a Part named MyPart in an assembly named MyAssembly will show up like this : Dynamics.Part.MyAssembly.MyPart. That name is actually registered to the VxProfiler before being used.
The main problem in some past versions is that all extensions are DynamicsExtensions, so it is impossible to select only a specific type of dynamics extensions.
Now, all extensions will register its factory key's category, so rather than DynamicsExtensions, the part will belong to category Dynamics. Likewise, a cable will go under CableSystems, human dynamics under category Human and so on.
New Categories under Engine
The following categories registered by the dynamics module can be filtered by the Profiler:
Dynamics (part, assembly, constraint, collision geometries, etc.)
Content (e.g., mechanism)
Scripting (Python scripts)
Cable Systems
Earthwork Systems
Earthwork Systems Internal
Vehicle Systems
Vehicle Systems Internal
Terrain Systems
VxSensors
Marine
Human
Tree
Console
Debug
<Factory Key category> (Any IDynamics extension not provided by Vortex Product)
But by having each extension belong to its own category, a new problem arose. When turning on filtering, only the selected category will show up. But there are now many more categories, so we need to be able to specify what we want to exclude. The API was revised to allow exclusions.
VxProfiler Changes
Enable All
Previously, categories can be enabled via VxProfiler::enableCategory. The enabled categories will be the only ones provided to VxSim::IProfilingDataCollector if filtering is turned on. Otherwise, all categories are outputs.
However, to disable only a few categories, one would need to know all the categories and enable them all. Since it would be nearly impossible to do so, a new API call was added to enable all the categories.
Disabling Categories from Application Configuration
The ProfilerDisabledCategories field allows you to exclude some categories. At the root level, the field will only be applied if ProfilerEnabledCategories is missing or empty. If that is the case, all categories will be enabled and only those in the list will be filtered out.
At the node level, both can be present and will simply add or remove additional categories from the master list. They are applied in order after the master so if a node disables a category and another one after enables it, it will be enabled.
These lists only have an effect if parameter IsProfilerFilteringEnabled is set to true, otherwise everything is captured.
Application Configuration |
|---|
|
Extensions Categories
Each extension registers its factory key's category to the VxProfiler when loaded, so there is no code needed to register your category. As each VxScopedProfilingSection needs a VxProfilingSectionInfo, one is also automatically registered with the same extension's factory key's category. The section's name is %EXTENSION NAME%. A section name can be replaced by an alternate name, but alternate names need to be registered, see below.
Note Every extension has its category with a corresponding VxProfilingSectionInfo registered but at the moment, only the dynamics module creates sub-sections using the extension's category and thus, can be filtered.
It is recommended for a user making their own extension to have a meaningful category in their factory key so that they can filter on it.
Alternate Names (Advanced Use)
When making your own profiling sections, you have to specify which VxProfilingSectionInfo to use in a specific VxScopedProfilingSection. Each VxProfilingSectionInfo must be registered to the VxProfiler before they are used. If you want to use a section associated to an extension, function getSectionInfo can be used to fetch the extension section; you need to provide the section's category and original name.
When creating a VxScopedProfilingSection, an alternate name can also be given so that the section will be properly named when given to a IProfilingDataCollector.
For performance reasons, rather than using a string, each name has an ID and that is the ID that is being carried around the system, so each alternate name must be registered before being used. Alternate names are meant to be able to re-use the same section but give a different context, e.g., a module running all its extensions in a loop, re-using the same section with a different name. There is no filtering on names, only categories.
As for anything with the VxProfiler, registering your section and alternate name should be done before the simulation is actually started and the values should be kept. There is a cost associated to using the Profiler: alternate name ID and section creation involves some computing that should be done outside of simulation.
API Changes References
VxProfiler |
|---|
|
Example
See See Dynamics Extension Tutorial for usable sample code.
The following is an example of the API.
Usage Example |
|---|
|