Skip to content
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

Why is logging function passed to plugin through a function pointer? #48

Closed
morrone opened this issue May 1, 2019 · 1 comment
Closed

Comments

@morrone
Copy link
Collaborator

morrone commented May 1, 2019

Is there any reason that an ldms sampler plugin could not simply use ldmsd_msg_logger() directly instead of using the function pointer that is passed to the sampler through get_plugin()?

Using the exported symbol directly is much preferable to a plugin implementer when they are using multiple files in their plugin for organizational purposes. Using the function pointer, combined with the ldmsd rule that all globals must be file-scope in samplers results in unnecessary cruft in the code.

@baallan
Copy link
Collaborator

baallan commented May 1, 2019

I proposed an ovis logging library (olog) in ldms v2 (and the code is still in the tree) so that main and plugins would have equal access to the logging symbols via a library. It was rejected at the time. The log functions are in the file with main, which isn't highly portable, so we pass them by pointer currently.

@tom95858 tom95858 closed this as completed May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants