Patent ID: 11921613
Assignee: MICROSOFT TECHNOLOGY LICENSING, LLC
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 7:
8. A computing system for automatic performance telemetry comprising:
one or more processing units; and
a computer-readable medium having encoded thereon computer-readable instructions to cause the one or more processing units to:
intercept a runtime compilation of a function into processor executable instructions;
determine that the function comprises an asynchronous function, wherein the asynchronous function comprises a plurality of code sections, wherein the asynchronous function is associated with a state machine variable that stores a state machine value associated with a next code section to execute, and wherein the asynchronous function is iteratively re-entered to execute a code section of the plurality of code sections identified by the state machine variable;
modify the asynchronous function by:
inserting instructions configured to retrieve a first current system time;
inserting instructions configured to, while executing an initial code section of the plurality of code sections, store, in the state machine variable, a reference to a data structure that contains the first current system time and a state machine value;
identifying a return instruction within the asynchronous function;
inserting, before the return instruction, instructions configured to:
retrieve a second current system time,
retrieve the first current system time from the entry in the data structure referenced by the state machine variable,
compute an elapsed execution time by subtracting the first current system time from the second current system time, and
output the elapsed execution time; and

pass the modified asynchronous function to the compiler, causing the compiler to be translated into processor executable instructions.