1. Field of the Invention
The invention relates to maintenance and debugging of computer software by execution tracing.
2. Description of the Related Art
Program execution tracing has become a valuable tool for troubleshooting run-time software problems and for remote application support. One of the major problems with this approach is keeping the right balance between completeness of the trace information and the performance penalty of the tracing process. Users of such a tool want to gather enough information to allow them to diagnose the problem. However, tracing of each function call, source line, variable and other run-time information can create an undesirable performance impact on the traced program. Extensive tracing can lead to situations where the traced process is slowed below acceptable levels. In real-life deployment scenarios, it is typically desirable to keep performance penalty within a 5-25% range.
These and other problems are solved by a tracing system that provides automated tuning of execution tracing by adjusting the collection of trace data. In one embodiment, the tuning system can adjust the collection of trace data without the need for program sources or symbolic information, and hence, makes such automated tuning of program execution tracing possible in production environments.
In one embodiment, the user sets an initial tracing profile for a tracing program (tracer) that allows the user to gather a superset of information relevant for software problem troubleshooting. In addition, the user sets an upper limit for the tracing performance penalty. The auto-tuning system monitors the performance penalty induced by the tracer and, when the performance impact is excessive, removes trace points that are causing the most impact on performance. Using the described auto-tuning mechanism, the application operator can limit the performance penalty when access to the application sources and symbolic information is not available. Auto tuning is especially useful for performing software recording in mission-critical and/or time-critical applications, such as servers, real-time applications, etc. The system typically adjusts itself quickly enough (e.g., often in less than a second) and most users do not feel the influence of the tracer.
The auto-tuning process maintains a desired allowable performance penalty by adjusting the trace process to operate within preset limits. This is achieved by automatic adjustment of the trace points in the traced process. In one embodiment, tracing starts with a relatively maximal set of trace points that involves, for example, a list of functions of the traced process or methods of the debugged class. The auto-tuning module checks the performance penalty caused by tracing and turns off those trace points with the highest performance impact until the performance penalty drops below a specified limit.
In one embodiment, the auto-tuning process adapts to a variable CPU load. If the auto tuner system detects that the performance penalty is lower than the preset threshold, it turns on disabled trace points until the trace performance penalty reaches the threshold value.
In one embodiment, the user can mark certain trace points as obligatory for tracing and the auto-tuning procedure will not turn off these trace points.
In one embodiment, the auto-tuning system maintains a desired balance between trace completeness and trace performance penalty. In one embodiment, the system simplifies the trace point setting process and makes the trace-based troubleshooting process more user-friendly.
In one embodiment, the performance impact is specified in terms of program runtime. In one embodiment, the performance impact is specified in terms of CPU utilization. In one embodiment, the performance impact is specified in terms of system throughput. In one embodiment, the performance impact is specified in terms of an amount of time used by the tracing program. In one embodiment, the performance impact is specified in terms of an amount of time penalty caused by tracing.
One embodiment includes specifying an initial trace profile listing a first list of runtime events to be traced, monitoring a performance penalty incurred by tracing execution of a program using the first list of runtime events, determining which of the runtime events produces a relatively larger impact on the performance penalty to produce a second list of one or more runtime events, and removing the second list of events from the first list of events. In one embodiment, the monitoring, determining, and removing are repeated until the performance penalty falls below a desired level. In one embodiment, trace items are returned to the list of runtime events to be traced until the performance penalty approximates a desired level. In one embodiment, the performance criteria includes time taken by a tracing engine compared to time taken by a program being traced. In one embodiment, the list of runtime events is specified without recourse to compiler-generated debug information from the program. In one embodiment, the list of runtime events is specified without recourse to source code from the program. In one embodiment, the list of runtime events is specified using at least a portion of compiler-generated debug information from the program. In one embodiment, the list of runtime events is specified using at least a portion of the source code from the program.
A performance module 108 calculates the tracing performance penalty. At time intervals, when the timer timeout has elapsed, the system adjusts the list of trace points 112 in such a way that the performance penalty stays relatively close to the penalty threshold.
In typical real-world cases, the auto-tuning reduces the performance penalty without substantial loss of significant information because the functions that are called relatively more often (and hence, consume a large recording penalty) are typically low-level functions, such as string manipulators, mouse movement handlers, etc. These functions are usually well debugged and, therefore, are not usually interesting for troubleshooting purposes. Thus, the removal of such functions from the trace list typically does not have a substantial impact on the value of the trace data.
In one embodiment, the following procedure is used for the calculation of the performance penalty.
Calculate an instrumentation time (InstrumentationTime) spent by the tracing engine. The value InstrumentationTime is calculated by summing time differences between entries and exits of the instrumentation engine for a specified interval of time called the TimeInterval.
Calculate the processor time used by the instrumented process (InstrumentedProcessTime). In one embodiment, the value InstrumentedProcessTime is calculated by using a performance counter (such as, for example, PercentProcessorTime on the Windows operating system) for the traced process. In order to take into account fluctuations in the CPU load, the counter values are averaged over the TimeInterval period of time. Time spent by the process is then calculated as InstrumentedProcessTime=TimeInterval*PercentProcessorTime/100.
In one embodiment, an upper level estimate is based on the assumption that the instrumented process uses all of the CPU resources: InstrumentedProcessTime=TimeInterval.
Calculate the CPU time used by the process, without the instrumentation overhead:
ProcessTime=InstrumentedProcessTime−InstrumentationTime.
Calculate performance penalty of the instrumentation:
Penalty=100*InstrumentaionTime/ProcessTime
In one embodiment, the system displays the current recording penalty, and/or the penalty over time, e.g. in a graph, table, display, etc. This can be used to determine the maximum penalty level for the auto-tuning mechanism.
A typical workflow of the tracing system starts with the setting of the tracing or recording profile. A recording profile represents a collection of trace points that are inserted into the traced program. Each trace point is associated with a specific function or a source code line. The recording profile allows the trace user to set what will be recorded during tracing, such as function arguments and return values, local and global variables or calls to library functions, etc.
The results of the initial tracing are shown in
In order to limit the performance penalty, the user selects the Properties dialog by pressing the Properties button 204 as illustrated in
The Auto-tuning dialog 500 has two panes. A right pane 502 shows the list of functions excluded from tracing by the auto-tuning process. The user can force a desired function to stay in the trace list by selecting the desired function in the right pane and pressing the left arrow button 504. The list of functions that are to be retained in the trace appears in the left window. These functions are a part of the recording profile. The user can move functions back to the removed list using the right arrow button 506. The list of functions deleted by the auto-tuning procedure 502 closely corresponds to the list of the most-frequently executed functions that are displayed in the right lower pane 304 in
CPU time usage is only one of several performance characteristics. There are a number of other ways to measure useful performance of an application. For example, in the case of HTTP servers it is accepted practice to measure performance by the number of hits-per-second that the server can serve under stressed conditions. Table 1 below shows the reduction in performance penalty achieved by the auto-tuning process. The sample HTTP server httpsrv.exe was stress-tested in 3 modes: 1) without tracing; 2) complete function-level tracing; and 3) auto-tuned tracing. The results of the experiment presented in the table show that auto-tuning allowed to reduce the performance penalty from 75% to 7%.
Although various embodiments have been described above, other embodiments will be apparent to one of ordinary skill in the art based on the above disclosure. For example, the above equations and calculations are provided by way of example and not by way of limitation. One of ordinary skill in the art will recognize that however the performance penalty is specified and calculated, users will typically adjust the desired penalty value in order to keep the performance impact of tracing within acceptable levels. One of ordinary skill in the art will recognize that many methods of specifying the allowable performance penalty and/or computing the performance penalty can be used. Thus, the invention is limited only by the claims that follow.
The present application claims priority benefit of U.S. Provisional Application No. 60/582,761, titled “SYSTEM AND METHOD FOR AUTOMATED TUNING OF PROGRAM EXECUTION TRACING,” filed Jun. 25, 2004, the entire contents of which is hereby incorporated by reference.
| Number | Name | Date | Kind |
|---|---|---|---|
| 4503495 | Boudreau | Mar 1985 | A |
| 4511960 | Boudreau | Apr 1985 | A |
| 4598364 | Gum et al. | Jul 1986 | A |
| 4782461 | Mick et al. | Nov 1988 | A |
| 4879646 | Iwasaki et al. | Nov 1989 | A |
| 5021949 | Morten et al. | Jun 1991 | A |
| 5121489 | Andrews | Jun 1992 | A |
| 5193180 | Hastings | Mar 1993 | A |
| 5265254 | Blasiak et al. | Nov 1993 | A |
| 5297274 | Jackson | Mar 1994 | A |
| 5335344 | Hastings | Aug 1994 | A |
| 5347649 | Alderson | Sep 1994 | A |
| 5386522 | Evans | Jan 1995 | A |
| 5386565 | Tanaka et al. | Jan 1995 | A |
| 5394544 | Motoyama et al. | Feb 1995 | A |
| 5408650 | Arsenault | Apr 1995 | A |
| 5410685 | Banda et al. | Apr 1995 | A |
| 5421009 | Platt | May 1995 | A |
| 5446876 | Levine et al. | Aug 1995 | A |
| 5450586 | Kuzara et al. | Sep 1995 | A |
| 5465258 | Adams | Nov 1995 | A |
| 5481740 | Kodosky | Jan 1996 | A |
| 5483468 | Chen et al. | Jan 1996 | A |
| 5513317 | Borchardt et al. | Apr 1996 | A |
| 5526485 | Brodsky | Jun 1996 | A |
| 5533192 | Hawley et al. | Jul 1996 | A |
| 5551037 | Fowler et al. | Aug 1996 | A |
| 5574897 | Hermsmeier et al. | Nov 1996 | A |
| 5581697 | Gramlich et al. | Dec 1996 | A |
| 5590354 | Klapproth et al. | Dec 1996 | A |
| 5612898 | Huckins | Mar 1997 | A |
| 5615331 | Toorians et al. | Mar 1997 | A |
| 5632032 | Ault et al. | May 1997 | A |
| 5642478 | Chen et al. | Jun 1997 | A |
| 5657438 | Wygodny et al. | Aug 1997 | A |
| 5732210 | Buzbee | Mar 1998 | A |
| 5740355 | Watanabe et al. | Apr 1998 | A |
| 5745748 | Ahmad et al. | Apr 1998 | A |
| 5771385 | Harper | Jun 1998 | A |
| 5781720 | Parker et al. | Jul 1998 | A |
| 5848274 | Hamby et al. | Dec 1998 | A |
| 5867643 | Sutton | Feb 1999 | A |
| 5870606 | Lindsey | Feb 1999 | A |
| 5896535 | Ronstrom | Apr 1999 | A |
| 5903718 | Marik | May 1999 | A |
| 5928369 | Keyser et al. | Jul 1999 | A |
| 5938778 | John, Jr. et al. | Aug 1999 | A |
| 5940618 | Blandy et al. | Aug 1999 | A |
| 5960198 | Roediger et al. | Sep 1999 | A |
| 5983366 | King | Nov 1999 | A |
| 6003143 | Kim et al. | Dec 1999 | A |
| 6026433 | D'Arlach et al. | Feb 2000 | A |
| 6026438 | Piazza et al. | Feb 2000 | A |
| 6047124 | Marsland | Apr 2000 | A |
| 6065043 | Domenikos et al. | May 2000 | A |
| 6108330 | Bhatia et al. | Aug 2000 | A |
| 6202199 | Wygodny et al. | Mar 2001 | B1 |
| 6219826 | De Pauw et al. | Apr 2001 | B1 |
| 6237138 | Hameluck et al. | May 2001 | B1 |
| 6263456 | Boxall et al. | Jul 2001 | B1 |
| 6282701 | Wygodny et al. | Aug 2001 | B1 |
| 6321375 | Blandy | Nov 2001 | B1 |
| 6360331 | Vert et al. | Mar 2002 | B2 |
| 6374369 | O'Donnell | Apr 2002 | B1 |
| 6415394 | Fruehling et al. | Jul 2002 | B1 |
| 6467052 | Kaler et al. | Oct 2002 | B1 |
| 6490696 | Wood et al. | Dec 2002 | B1 |
| 6507805 | Gordon et al. | Jan 2003 | B1 |
| 6634001 | Anderson et al. | Oct 2003 | B2 |
| 6865508 | Ueki et al. | Mar 2005 | B2 |
| 7058928 | Wygodny et al. | Jun 2006 | B2 |
| 7089536 | Ueki et al. | Aug 2006 | B2 |
| 7114150 | Dimpsey et al. | Sep 2006 | B2 |
| 7386839 | Golender et al. | Jun 2008 | B1 |
| 20020087949 | Golender et al. | Jul 2002 | A1 |
| 20030005414 | Elliott et al. | Jan 2003 | A1 |
| 20040060043 | Frysinger et al. | Mar 2004 | A1 |
| 20060150162 | Mongkolsmai et al. | Jul 2006 | A1 |
| 20060242627 | Wygodny et al. | Oct 2006 | A1 |
| 20080244534 | Golender et al. | Oct 2008 | A1 |
| Number | Date | Country | |
|---|---|---|---|
| 60582761 | Jun 2004 | US |