How to symbolicate kernel callstacks (or what is kernel.release.t6020)?

Hi everyone,

(I am running on an M2 MacBook Pro 14 inch with 96 GB of memory)

I've been profiling with Instruments to find out why program suddenly goes from full CPU usage (all of my threads active and all cores working) to about 33% CPU usage. An Instruments system trace is showing me a massive performance cliff where I suddenly get taken off the performance cores and only run on efficiency cores. The performance cores are then occupied by "kernel.release.t6020". What is this thing?

I have kernel callstacks enabled but I only get the instruction pointer and have no symbols for any of those callstacks. I'm accustomed to Windows development where kernel symbols are available so you can see deeply into the kernel to know why you're spending time there (for example, semaphore wait or thread scheduling). Is there a way for me to get a similar level of information or kernel symbols so I can see what the kernel is doing?

Around the time I observe the performance cliff, I also noticed in the narrative view some of the preemptions are done "because thread was balanced off CPU i (P Core) to optimize the system's CPU performance". What does this mean? Have I begun to hit some sort of thermal limit?

Here are some example screenshots of what I am seeing in Instruments:

Answered by unpacklo in 819975022

After a bit more searching and investigating, the root cause of my performance problem was caused by App Nap. I only realized this by happenstance while looking through my Instruments capture where my main thread was running "mach_msg2_trap" and the callstack involved "rbs_acquire_appnap_assertion".

Realizing this, I went to use https://developer.apple.com/documentation/foundation/nsprocessinfo/1415995-beginactivitywithoptions with https://developer.apple.com/documentation/foundation/nsactivityoptions/nsactivityuserinitiatedallowingidlesystemsleep and now everything works perfectly.

It would be great if Instruments would more obviously surface App Nap as a state change in the process so it's easier to understand what's going on.

Through a series of coincidences, I discovered that this performance cliff is somehow related to the application being active or inactive (if I keep the app in focus or move the mouse around over the window, performance remains high). My performance question is essentially solved but the question about what "kernel.release.t6020" actually is and an explanation as to why it occurs would be helpful for other users.

Accepted Answer

After a bit more searching and investigating, the root cause of my performance problem was caused by App Nap. I only realized this by happenstance while looking through my Instruments capture where my main thread was running "mach_msg2_trap" and the callstack involved "rbs_acquire_appnap_assertion".

Realizing this, I went to use https://developer.apple.com/documentation/foundation/nsprocessinfo/1415995-beginactivitywithoptions with https://developer.apple.com/documentation/foundation/nsactivityoptions/nsactivityuserinitiatedallowingidlesystemsleep and now everything works perfectly.

It would be great if Instruments would more obviously surface App Nap as a state change in the process so it's easier to understand what's going on.

How to symbolicate kernel callstacks (or what is kernel.release.t6020)?
 
 
Q