we have a firmware profiler agent that is watching the program counter and based on some mapping generated at compilation time we are able to know in which function the software is at any given moment in time. This is extremely useful for monitoring purposes. Currently though we haven't found a neat way to distribute the function name to other agents in the environment, therefore we are kind of stuck with some sort of hierarchical path probes. The current approach, although it works, is very fragile and not a lot reusable.
So one way to come out of this is to simply create events for each specific function call that are gathered in the event_pool and each agent who might need it will get it from the pool. This approach also is not very viable since we will have a huge number of events and potentially a performance hit (to be confirmed).
Another approach that we want to explore, is some sort of 'event subscriber' where each agent subscribes for a specific 'function call event' which then is only activated if someone subscribed for it.
We have not yet implemented anything and would like to hear first from the experts if a better pattern can be leveraged.
Thanks a lot,