-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create new plugin API abstractions #1618
Draft
morrone
wants to merge
18
commits into
ovis-hpc:main
Choose a base branch
from
morrone:new_plugin_api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
morrone
commented
Feb 21, 2025
* Converted plugins to configuration objects * Added multi-instance support to samplers: * procnetdev2 * meminfo * avro_kafka store * csv store * sos store * Converted all samplers to support new plugin infrastructure * Changed configuration object reference counting to use ref_t
The `strgp_open()` is only for legacy store path. When the plugin is configured with `decomp_path`, this legacy strgp path should not be executed.
- default 'encoding' to AVRO - sk->g_topic_fmt not set if FMT not given
Add `cfgobj` pointer to `ldmsd_plugin` instance so that the plugin can take `cfgobj` reference. This is required by `json_stream_sampler` to prevent use-after-free in the race of destroying the plugin instance and delivering events on the stream client that still hold the reference to the plugin instance.
This change modifies the load command as follows: load name=config_object_name plugin=plugin_name If 'plugin' is not specified, it defaults to the 'config_object_name'. For example: load name=mem1 plugin=meminfo load name=meminfo plugn_status Results in the followihg: Config Name Plugin Type libpath ------------ ------------------------ ------------ ------------ mem1 meminfo sampler /opt/ovis/lib64/ovis-ldms/libmeminfo.so meminfo meminfo sampler /opt/ovis/lib64/ovis-ldms/libmeminfo.so From: Chris Morrone, [email protected]
The inst_name in the configuration object is confusing considering that the inst_name in other contexts refers to a set. This change uses cfg_name that makes it obvious that the name refers to a configuration object. From: Chris Morrone, [email protected]
From: Chris Morrone, [email protected]
From: Chris Morrone, [email protected]
* Rename "struct ldmsd_sampler_inst" to "struct ldmsd_cfgobj_sampler". * Rename ldmsd_sampler_t to ldmsd_cfgobj_sampler_t (to match previous). * Rename "struct ldmsd_store_inst" to "struct ldmsd_cfgobj_store". * Rename ldmsd_store_t ldmsd_cfgobj_store_t (to match previous). These changes better reflect that these struct are derived from the base struct ldmsd_cfgobj. The typedef names now directly match the underlying struct, with just "_t" appended to the name. Previously the typedef names did not match the struct names. From: Chris Morrone, [email protected] Remove the set_route command. From: Tom Tucker, [email protected]
260160d
to
4595f82
Compare
This builds, but has virtually no testing yet. I share the draft now just so folks know where I'm heading and can provide early feedback. |
4595f82
to
71feec8
Compare
Develop better plugin API abstractions. Make read-only ldmsd's access to the API function pointer structs: struct ldmsd_plugin, struct ldmsd_store, and struct ldmsd_sampler. The plugins now own those structs. Introduce the ldmsd_plug_api.[ch] files, which most importantly include the accessor functions for the new ldmsd_plug_handle_t, which is a opaque to the plugins. ldmsd passes an opaque ldmsd_plug_handle_t to the plugins in each plugin API call. Plugins may use the accessor functions to get and set things through the handle. In particular, a plugin may use ldmsd_plug_context_set() to record its local context pointer in one call, and use ldmsd_plug_context_get() to retrieve its local context pointer. Functions calls constructor() and destructor() are added to the plugin API to simplify plugin multi-instance support. Many plugin functions are now optional. ldmsd checks if they are NULL before calling them. Therefore plugins no longer need to implement empty stub functions that do nothing. The filesingle sampler is upgraded to multi-instance support.
71feec8
to
a83da10
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.