Flight Recorder exposes an Event API, which allows to generate custom events.
Apparently the performance impact of these events is close to nothing when the related Events are not enabled.
Some references: