monsdar / CxxProf

CxxProf is a manual instrumented Profiling library for C++. It's goal is to provide easy integration into existing projects with just as little overhead as possible. It should be easy to remove the profiling mechanism during compile and runtime from the code.
GNU General Public License v3.0
58 stars 5 forks source link

generic performance event consumer interface #37

Closed wizfromoz closed 10 years ago

wizfromoz commented 10 years ago

I'd like to be able to attach my own consumer code for performance events, so that I can do whatever my application requires. This would be in addition to what CxxProf already does, ie. storing to SQL DB or sending events over network. This would be just another type of consumers.

In my use case, I want to be able to plot in real-time, using my own setup, a selection of events or plots.

monsdar commented 10 years ago

A solution could be to load multiple DynCxxProf plugins. Currently there is just the network and a test plugin, only one is used at a time.

By simply loading all plugins that are found the user can add his own implementation of what should be done if a certain event occurs. The user code could be in addition to the existing plugins or loaded as standalone.

Is this what you want to do?

wizfromoz commented 10 years ago

In short, yes.

I haven’t had a thorough look into the code yet, so I don’t know if there’s an API that plugin must implement whereby performance event generators pass performance events for handling, or anything extra it would have to do in order to be loaded at startup.

Regards,

Milan

monsdar commented 10 years ago

I just added the ability to load multiple DynCxxProfilers at once with Revision #152 - 281520a4805208b1d7c6ad0b68f8e18d62d7c701. Have a look at the cxxprof_dyn_test component to get a simple example of how such a plugin has to look. You can also check out cxxprof_dyn_network, which does a bit more in terms of measuring time, sending results via network etc.

I'm closing here, just reopen if there are any open points with this issue.