Comments in sys/eventhandler.h make references to "slow handlers" implying that there may be some plan for a faster mechanism, but no comments or code clues exist about what was envisioned. The current mechanism is slow, requiring a global lock be held while searching for a named list by walking the list-of-lists doing strcmp() on each entry.
This change adds a fairly minimal mechanism for pre-defining an event list and keeping a pointer to it as a global var, allowing the event handlers to be invoked without the slow list-lookup step. The new mechanism is completely compatible with the old. For any given event, it will work fine to use both the old EVENTHANDLERS_INVOKE() and the new EVENTHANDLERS_INVOKE_LIST(), so this introduces no incompatibilites with existing code or modules.
From the point of view of wanting to handle an event, there is no change here at all. You continue to register for events by name as always, without needing any particular declaration in scope. The decision to use the new mechanism is purely on the invocation side.
As an example of what's required to convert existing high-frequency events to the new mechanism, this includes a conversion of process and thread related events. Once the basic scheme is hammered out and committed, we can track down and convert other frequent events.