I have the following lines of code in one of the functions I want to track time for, using instruments. When I run the app on simulator from instruments, the measured times with os_signpost do show up and I can accurately measure what I need.
Then I switch to device, same code. However, as it runs on device instruments does not show the measured times. It only show this:
the os_signpost times do not show up at all.
So, all works great on simulator, but not when I switch to my iPhone device.
Any idea?
let spid = OSSignpostID(log: SignpostLog.myLog, object: myObj as AnyObject)
defer { os_signpost(.end, log: SignpostLog.myLog, name: "operation1", signpostID: spid) }
os_signpost(.begin, log: SignpostLog.myLog, name: "operation1", signpostID: spid)
Make sure you did not disable OS_ACTIVITY_MODE
via an environment variable (see screenshot below)
I removed it and everything worked =)
Turns out os_signpost would not show up because the recording was set to immediate. Setting it to Deferred made it so I could run the app, then stop recording and then instruments shows the custom os_signpost I had in code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With