There used to be a nice tool, DTSendSignalFlag, part of the DTPerformanceSession framework, by which you could programmatically insert flags into I
DTSendSignalFlag
DTPerformanceSession
2019
Signpost has been updated with an easier API. Video here (Time: 20:40)
Time: 20:40
https://developer.apple.com/videos/play/wwdc2019/411/
See Debugging CPU Performance in Apple logging documentation.
https://developer.apple.com/documentation/os/logging