1. A method, comprising: detecting a call to execute a function within an application; writing at least one frame of a call stack for the called function into a buffer; detecting a call to end execution of the called function; detecting an event related to execution of the application; and writing the buffer to a persistent storage.