Add an event counter for functional (derivative) evaluations