主权项 |
1. A method comprising:
causing a compiler to self-determine a hot section in a source code during a first compilation of the source code; sending a command to the compiler, the command causing the compiler to determine a set of insertion points corresponding to a set of hot sections in the source code, an insertion point in the set of insertion points corresponding to a determined hot section; situating, during the first compilation of the source code into a first executable code, the insertion point corresponding to the hot section near a portion of the first executable code corresponding to the hot section; inserting, during the first compilation of the source code, a set of signatures in the first executable code, wherein a signature in the set of signatures is located at the insertion point and comprises a combination of executable no-op instructions which when examined by a debugger inform the debugger that the signature has been inserted by the compiler and not a code in the source code to mark the insertion point, wherein a first signature in the set of signatures comprises a first sequence of only a first number of consecutive no-op instructions to cause a first operation at the debugger, and wherein a second signature in the set of signatures comprises a second sequence of only a second number of consecutive no-op instructions to cause a second operation at the debugger, wherein the correspondence between the first signature and the first operation and the correspondence between the second signature and the second operation are mutually agreed between the compiler and the debugger; executing, during an execution of the first executable in a debugger using a processor and a memory, an instruction to call a counter code; incrementing, responsive to the executing, a counter corresponding to the signature, wherein the counter code is configured to increment the counter in response to the instruction to call the counter code being executed from a location of the signature in the first executable code; providing, to a compiler, a value of the counter corresponding to the location of the signature in the first executable code; and recompiling the source code to form a second executable code, the recompiling optimizing a portion of the second executable code responsive to the value exceeding a threshold, wherein the portion is related to the location of the signature in the first executable code. |