A method of instrumenting a software program, having a plurality of locations and an operating state when executed, with at least one probe function adapted to record information on the operating state at a location within the software program, the software program being executed on a platform having specific calling conventions, the method comprising modifying the software program to cause a wrapper function (220, 260, 320, 360) to execute, the wrapper function allowing the probe function to be called without violating the specific calling conventions of the platform by creating a new stack frame in a stack dynamically upon each call to a function to allocate storage to be used by the function, and where the new stack frame is popped from the stack when the function finishes execution to allow other portions of the software program to re-use said allocated storage, wherein modifying the software program comprises: identifying a first location in a first function to be instrumented within the software program, the first function being distinct from the probe function and the wrapper function; determining whether the first location is an entry point of the first function; when the first location is an entry point of the first function: identifying an instruction in the software program that causes the first function to execute; replacing in the software program the instruction that causes the first function to execute with an instruction that causes the wrapper function to execute; and including within the wrapper function an instruction that causes the first function to execute; determining whether the first location is an exit point of the first function; and when the first location is an exit point of the first function: identifying an instruction in the software program that is in the first function and that causes an instruction at a target location to execute; replacing in the software program the identified instruction with an instruction that causes the wrapper function to execute; and including within the wrapper function an instruction that causes the instruction at the target location to execute. identifying a first location in a first function to be instrumented within the software program, the first function being distinct from the probe function and the wrapper function; determining whether the first location is an entry point of the first function; when the first location is an entry point of the first function: identifying an instruction in the software program that causes the first function to execute; replacing in the software program the instruction that causes the first function to execute with an instruction that causes the wrapper function to execute; and including within the wrapper function an instruction that causes the first function to execute; identifying an instruction in the software program that causes the first function to execute; replacing in the software program the instruction that causes the first function to execute with an instruction that causes the wrapper function to execute; and including within the wrapper function an instruction that causes the first function to execute; determining whether the first location is an exit point of the first function; and when the first location is an exit point of the first function: identifying an instruction in the software program that is in the first function and that causes an instruction at a target location to execute; replacing in the software program the identified instruction with an instruction that causes the wrapper function to execute; and including within the wrapper function an instruction that causes the instruction at the target location to execute. identifying an instruction in the software program that is in the first function and that causes an instruction at a target location to execute; replacing in the software program the identified instruction with an instruction that causes the wrapper function to execute; and including within the wrapper function an instruction that causes the instruction at the target location to execute.