Conversation
nscottnichols
left a comment
There was a problem hiding this comment.
LGTM, will let @Kerilk do approval
Kerilk
left a comment
There was a problem hiding this comment.
Revert changes to sampling library.
|
No, I didn't do the change for fun. Nothing fundamental changed, but some stuff needed change. I can add back |
|
The only things that needed to change in those files was extracting the heartbeats. One possible improvement is delaying the thread creation to when the sampling list is not empty, and wait for the thread to die when the last event is unregistered. The reason for the register/unregister is that you may want to start and stop sampling programmatically. Plugins should unregister their events, though I agree that in practice the cleanup of the library should be good enough. |
I will add it back. Even if I don't see how can we using in the current algorithm. The pluging just call expose one function, who will be called once, who will call registration. I suppose the plugin so can spawn fork in the Require change in the lib:
But I agree unreleated to the PR, we can do in another one. |
|
|
@Kerilk These changes seem to restore most of the original My remaining question is, where should new sampling plugins be added to the code? The one option, as currently demonstrated in this PR, is to have each sampling plugin live in its backend directory. The What are your thoughts on the current state of the PR and my question above? |
|
For code generation purposes, I think it is simpler to have sampling plugins with their respective backends. For a distribution perspective I think the current scheme works. I have questions about the capitalization though, here is the list of files we have currently: I think we should be consistent about naming our libraries, and I like the capitalized version better to be honnest.
|
|
Consistency always good! I guess I just got triped by I will try to make a |
|
We can't change the ones which are not ours like |
|
I was thinking about
Will be simplest to always CamelCase if we can. (or whatever our convension is called, snake of something) |
|
I forgot about non-installed libraries. Agreed, Camel case is good and we should use it consistently when possible. |
|
Ok pushed, ready to merge (even if the CI is falling, it's unrelated to that...). |
Sorry for the big PR, the diff is bigger than expected because I'm stupid but, in short the change are small.
We now have one
thapi_sampling_daemon, who can open somelibThapiSamplingPluging.so.libThapiSamplingPlugingjust need to expose athapi_register_sampling_pluginfunction, and inside callthapi_register_sampling.In short we:
libThapiSampling.soregister,init, andsampling_loopthapi_sampling_register.hheader, exposing onlyregister, the only header than sampling plugin needthapi_sampling.hfor thethapi_sampling_daemonsosampling_loopandinit.This will help nathan and is new CXI plugin sample.
In the futur we can maybe clean
thapi_sampling_daemon(we don't need pthread protection anymore) and theze_sampling_pluging(no need to dl_open anymore, we can just call directly the pointers)