Nothing Special   »   [go: up one dir, main page]

WO1999024904A1 - Apparatus and method for logging information relating to function calls to a function library - Google Patents

Apparatus and method for logging information relating to function calls to a function library Download PDF

Info

Publication number
WO1999024904A1
WO1999024904A1 PCT/US1998/023363 US9823363W WO9924904A1 WO 1999024904 A1 WO1999024904 A1 WO 1999024904A1 US 9823363 W US9823363 W US 9823363W WO 9924904 A1 WO9924904 A1 WO 9924904A1
Authority
WO
WIPO (PCT)
Prior art keywords
function
call
data
log file
library
Prior art date
Application number
PCT/US1998/023363
Other languages
French (fr)
Inventor
Terry Michaels
Robert Bisbee
Richard W. Davis, Iii
Original Assignee
Intergraph Corporation
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Intergraph Corporation filed Critical Intergraph Corporation
Priority to EP98955239A priority Critical patent/EP1027652A1/en
Publication of WO1999024904A1 publication Critical patent/WO1999024904A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program

Definitions

  • This invention generally relates to function libraries and, more particularly, to identifying function calls that are transmitted from executing application programs to functions in function libraries.
  • OPENGL TM is a known application program interface that includes a specialized library of graphics functions. Functions in the OPENGL TM function library are called by executing programs to render drawings on a computer display device. In a manner similar to many other function libraries, calls to
  • OPENGL TM functions typically include the function name and parameters (a/k/a "arguments") to be processed by the function.
  • Figure 1 schematically shows an exemplary prior art system 100 that utilizes a function library 102 for controlling computer hardware 104.
  • the function library 102 may be the OPENGL TM function library and the hardware 104 may be a display device.
  • the disclosed prior art system 100 includes an executing application program 104 that directs function calls to the function library 102.
  • the function calls each include the information that is necessary for performing a desired operation (e.g., rendering drawings on the display device).
  • the function call information may include the name of the function library 102 to receive the call, the name of the function in the designated library 102 to be accessed, and the function parameters.
  • the hardware driver 106 then converts the generic library message into a driver message having the hardware specific instructions for controlling the hardware 104 to perform the desired function.
  • Programs may malfunction (i.e., have "bugs") when improper calls are made to functions in the function libraries. Such bugs may occur, for example, in programs utilizing the OPENGL TM application program interface. Accordingly, prior to release to desired end users, application programs like that show in figure 1 typically are tested by selected users (often software developers) to determine if the programs operate as intended. Since the tested programs include no source code and include only executable program code to be received by intended end-users (i.e.,' 'executable software"), the selected users testing the programs cannot review the program source code to locate bugs in the source code. Improper function calls therefore cannot be identified by the testing users.
  • debugger Even with the assistance of a debugging program ("debugger"), improper function calls that cause programs to malfunction still cannot be located when the improper calls are made by executable software. Specifically, as is known by those skilled in the art, debuggers cannot identify the functions and their parameters when used on the executable software because debuggers require the source code to identify function calls.
  • an apparatus for logging data relating to a call from a program to a function library includes a mechanism for intercepting the call from the program, and a mechanism for storing the data relating to the intercepted call in a log file.
  • the apparatus also includes a mechanism for transmitting the intercepted call to the function library either while the data is being stored in the log file, or after the data is stored in the log file.
  • the program is an application program and the function library is a dynamic link library.
  • the data in the log file includes the name of the function and input parameters to the function.
  • a text program may be executed to display the stored data on a display device.
  • the data is stored in the log file in a predetermined format. That format may be in the form of computer program source code such as, for example, program source code in the "C" programming language.
  • the source code may be compiled to form a log executable file that may be run to display a graphical image on a display device.
  • This aspect of the invention preferably stores the log file in a nonvolatile storage medium.
  • a graphical user interface may be provided for entering configuration information relating to the log file.
  • the configuration information may be the name of the function library containing the functions to be logged.
  • Figure 1 schematically shows an exemplary prior art system that utilizes a function library for controlling computer hardware.
  • Figure 2 illustrates the system architecture for an exemplary computer system on which the disclosed method and apparatus for logging function calls can be implemented.
  • Figure 3 shows a preferred logging system for implementing the disclosed apparatus and method for logging function calls.
  • Figure 4 shows a preferred process that may be utilized by the logging system for logging a function call.
  • Figure 5 schematically shows a graphical user interface that may be utilized in preferred embodiments of the invention to configure the logging system.
  • Figure 6 shows a preferred process for displaying a log file.
  • Figure 7 shows a preferred process for controlling hardware with an executable log file.
  • a method and apparatus for logging function calls first intercepts function calls transmitted from an application program to functions in a function library. Once intercepted, information relating to the function calls are stored in a log file (identified as log file 310 in figure 3) that preferably is stored in a non-volatile storage medium.
  • the log file may be formatted as a text file that can be displayed on a display device by a text editing application program.
  • the text in the log file is formatted as source code for compilation by a software compiler to produce an executable code file.
  • the executable code file then may be run to display a graphical image on a display device.
  • Figure 2 illustrates the system architecture for an exemplary computer system 200, such as an IBM THINKPAD 701 ® computer (distributed by International Business Machines of Armonk, New York), on which the disclosed method and apparatus for logging information relating to function calls can be implemented.
  • the exemplary computer system of Figure 2 is discussed for descriptive purposes only, however, and should not be considered a limitation of the invention. Although the description below may refer to terms commonly used in describing particular computer systems, the described concepts apply equally to other computer systems, including systems having architectures that are dissimilar to that shown in Figure 2.
  • the computer 200 includes a central processing unit (CPU) 205 having a conventional microprocessor, random access memory (RAM) 210 for temporary storage of information, and read only memory (ROM) 215 for permanent storage of read only information.
  • CPU central processing unit
  • RAM random access memory
  • ROM read only memory
  • a memory controller 200 is provided for controlling system RAM 210.
  • a bus controller 225 is provided for controlling a bus 230, and an interrupt controller 235 is provided for receiving and processing various interrupt signals from the other system components.
  • Mass storage may be provided by known non-volatile storage media, such as a diskette 242, a digital versatile disk (not shown), a CD-ROM 247, or a hard disk 252. Data and software may be exchanged with the computer system 200 via removable media, such as the diskette 242 and the CD-ROM 247.
  • the diskette 242 is insertable into a diskette drive 241, which utilizes a diskette drive controller 240 to interface with the bus 230.
  • the CD-ROM 247 is insertable into a CD-ROM drive 246, which utilizes a CD-ROM drive controller 245 to interface with the bus 230.
  • the hard disk 252 is part of a fixed disk drive 251 , which utilizes a hard drive controller 250 to interface with the bus 230.
  • User input to the computer 200 may be provided by a number of devices.
  • a keyboard 256 and a mouse 257 may be connected to the bus 330 by a keyboard and mouse controller 255.
  • An audio transducer 296, which may act as both a microphone and a speaker, is connected to the bus 230 by audio controller 297.
  • other input devices such as a pen and/or tablet and a microphone for voice input, may be connected to computer 200 through bus 230 and an appropriate controller.
  • a direct memory access (DMA) controller 260 is provided for performing direct memory access to system RAM 210.
  • a visual display may be generated by a video controller 265, which controls a display device 270.
  • a network adapter 290 also may be included to enable the computer system 200 to be interconnected to a network 295 via a network bus 291.
  • the network 295 which may be a local area network (LAN), a wide area network (WAN), or the Internet, may utilize general purpose communication lines that interconnect a plurality of network devices.
  • the computer system 200 preferably is controlled and coordinated by operating system software, such as the WINDOWS NT ® operating system (available from Microsoft Corp., Redmond, WA). Among other computer system control functions, the operating system controls allocation of system resources and performs tasks such as process scheduling, memory management, networking, and I/O services.
  • the operating system preferable includes an OPENGL TM application program interface for rendering non-trivial graphical indicia on the display device 270.
  • Figure 3 shows a preferred system (hereinafter "logging system 300") for implementing the apparatus and method for logging information relating to function calls (hereinafter referred to as "logging function calls").
  • the system includes an interceptor function library 302 for intercepting function calls directed from an executing application program 304 to a system function library 306 (e.g., a dynamic link library).
  • the interceptor function library 302 includes a plurality of functions having the same names as the functions in the system function library 306. For example, if the system function library 306 includes a function named "shade", the interceptor function library 302 also will have a function named "shade.” It is important to note, however, that although the functions in the interceptor function library 302 have the same name as those in the system function library 306, they perform vastly different tasks. Namely, the interceptor functions merely gather and format the data to be stored in the log file 310, and then direct the function call to the system function library 306 for processing. Details of this process are discussed below with reference to figure 4.
  • the logging system 300 further includes a logging function library 308 for storing the formatted data in the log file 310, and a configuration utility 312 for configuring the logging system 300 (discussed below).
  • the logging system 300 preferably is utilized with hardware 314 and a hardware driver 316 for driving the hardware 314.
  • the executing application program 304 is a graphical drawing program such as, for example, Softimage TM (distributed by Microsoft Corp.).
  • the system function library 306 preferably is an OPENGL TM function library
  • the hardware 314 preferably is a computer display device.
  • the logging function library 308, intercept function library, and configuration utility 312 preferably are loaded into the non-volatile memory of the computer system 200 when the logging system 300 is installed.
  • Figure 4 shows a process that may be utilized by the logging system 300 for logging a function call. The process may be repeated each time a function call is made by the application program 304. The process begins at step 400 in which it is determined if the system has been configured to log function calls. The logging system 300 must be configured at least once before it can log function calls. Once configured, designated function calls within the computer system 200 are logged each time the application program 304 executes.
  • logging i.e., the process of storing function calls in a log file 310
  • logging may be turned "off to stop logging any time after the system is configured.
  • logging may be turned "on” again at any subsequent time by either re-configuring the system, or turning the logging function on via a graphical user interface (discussed below).
  • the configuration information may be entered by a user via a graphical user interface
  • GUI 500 (identified as GUI 500 ) that is a part of the configuration utility 312.
  • Information entered into the GUI 500 preferably is stored in the operating system registry (present in the Microsoft NTTM operating system), which includes the operating system configuration and computer system 200 set-up data.
  • Figure 5 schematically shows one such graphical user interface that may be utilized in preferred embodiments of the invention.
  • the GUI 500 includes several fields for enabling a user to enter configuration information into the system.
  • GUI 500 Among the fields in the GUI 500 is a " NAME OF FUNCTION LIBRARY" field 502 for entering the name of the function library to be logged, a "NAME OF EXECUTABLE TO LOG” field 504 for entering the name of the application program 304, and a "LOC ATION OF LOG FILE” field 506 designating the name of the resulting log file 310 and a path statement identifying the intended storage location of the log file 310 within the computer system 200.
  • the log file 310 is stored in the hard disk 252.
  • the logging system 300 logs all function calls from the designated application program 304 to a designated function library each time the application program 304 executes. Accordingly, each subsequent time the program 304 runs, the logging system
  • an "OVERRIDE" field 508 also may be included in the GUI 500 that enables the system to either overwrite an existing log file 310 for the same function library, or to create a new log file 310 in addition to the existing log file 310.
  • Each new log file 310 preferably is stored in the same directory as the existing log file 310 with a name that distinguishes it from related earlier created log files 310 created for the designated program 304.
  • each succeeding log file 310 for a specified program 304 may be named XXXI, XXX2, XXX3, ...XXXN, where N is an integer indicating the number of times the program 304 has been logged.
  • the "OVERRIDE” field 508, for example, may be a box or button that, when selected, alternatively displays "OVERRIDE YES” or "OVERRIDE NO.”
  • the override button preferably is defaulted to override existing log files 310 because of the large amount of memory (e.g., ten megabytes in many graphical applications) that may be required for such files.
  • the GUI 500 also may include additional buttons such as a "FUNCTIONS ONLY" button 510 for logging the function names only and not the input parameters required for the functions. In the preferred embodiment, the system is set to default to logging both the functions and their input parameters.
  • the GUI 500 also may include a "LOGGING ON/OFF' button 512 to turn the logging function on or off.
  • step 400 if the system has not been configured or logging is off, then the process skips to step 406 (discussed below). Conversely, if the system has been configured and logging is on, then the process continues to step 402 in which the intercept function library intercepts a function call transmitted from the program 304 to the system function library 306.
  • the configuration utility 312 both assigns the name of the system function library 306 to the intercept function library, and renames the system function library 306. It should be noted, however, that the configuration utility 312 subsequently renames the system function library 306 to its initial name when logging is turned off. Accordingly, when logging is on, function calls (which include a header having the name of the function library having the function) locate and execute the function in the intercept function library because such function library name matches the function library name in the function call header.
  • the function in the intercept function library that receives the function call consequently gathers the required data from the function call and formats the data into a character string in a predefined format. More particularly, when the "FUNCTION ONLY" button 510 in the GUI 500 is not selected, the receiving function reads the call, which includes, among other things, the name of the function and the input parameters to that function. The function name and its parameters thus are copied into the character string and transmitted to the logging function library 308. Conversely, when the "FUNCTION ONLY" button 510 in the GUI 500 has been selected, then only the function is copied into the character string and transmitted to the logging function library 308. The process then proceeds to step 404 and 406 substantially simultaneously.
  • the process may proceed to step 406 after step 404 is completed, or may proceed to step 404 after step 406 is completed.
  • the data is logged by a logging function in the logging function library 308. More particularly, the logging function first determines if the current function call is the first function call from the designated program 304 to the designated function library to be logged. If it is the first such function call, then the logging function initializes a log file 310 to store the data. As suggested above, it determines if another log file 310 has been created for the designated program 304 and function library and reacts accordingly. The logging function then determines if logging is on or off. If logging is off, then the received text string is not stored in the log file 310. If logging is on, then the received text string is stored in the log file 310 in the format received.
  • the receiving function in the intercept function library 302 directs the function call to the system function library 306 for processing.
  • the function in the system function library 306 directs to the hardware driver 316 a library message having generic instructions for controlling the hardware 314 (step 408).
  • the hardware driver 316 responsively directs a hardware message to the hardware 314 with hardware specific instructions for performing a specified task such as, for example, darkening a pixel on a computer display device.
  • the log file 310 may be displayed on a display device after all of the calls have been logged.
  • Figure 6 shows a preferred process for displaying the log file 310. The process begins at step 600 in which a text program is executed.
  • the text program may be any text program such as, for example, MICROSOFT WORD 97 TM , distributed by Microsoft Corp.
  • the process continues to step 602 in which the text program accesses the log file 310.
  • the location of the log file 310 is that designated in the GUI 500.
  • the text program then is controlled to display the text in the log file 310 (step 604).
  • the log file 310 preferably includes a plurality of strings in a selected format having the function names and function parameters.
  • Function parameters may include, among other things, integers, characters, text, and other functions in the function library with their own input parameters.
  • the text strings are formatted into programming source code in the "C" programming language.
  • the configuration utility 312 therefore initializes the log file 310 to include various "C” commands such as "main.”
  • the receiving function in the intercept function library therefore formats the text string into the format of a "C" function call by positioning the function name and the function parameters in the string in an predefined order required for a "C" function call.
  • the configuration utility 312 and receiving function in the intercept function library together format the log file 310 to be in other programming languages such as "C++", JAVA, or FORTRAN.
  • the log file 310 may be compiled to produce an executable file for performing the functions of the logged function calls. Such log file must be the embodiment having both the function calls and their respective input parameters.
  • the executable file then may be run to control the hardware 314 in a substantially identical fashion to that done by the application program 304. For example, if the program 304 is a graphics program calling OPENGL TM functions in an OPENGL TM function library, then the executing compiled log file 310 should produce substantially the same graphical indicia on the display device as the application program 304 had when it generated the function calls.
  • Figure 7 shows a preferred process for controlling the hardware 314 in such fashion. The process begins at step 700 in which the log file 310 is compiled. Once compiled, it may be executed, thereby calling the functions in the system function library 306 (step 702).
  • a user therefore may initiate the logging process by running the configuration utility 312.
  • the logging system 300 repeatedly logs the designated function calls each time the application program 304 is used.
  • the log file 310 may be utilized for many purposes. One use, for example, may be to run software demonstrations showing use of the application program 304. Another use may be to analyze the uncompiled log file 310 to determine if any bugs exist in the application program 304. Analysis may be performed with post processing tools that simplify the analysis process.
  • the interceptor functions in the interceptor function library 302 may be configured to log additional information relating to the function calls.
  • a return value for a function may be intercepted and logged either in the log file 310, or in another log file.
  • the return value may be intercepted by configuring the interceptor function to assign a location in system memory for returning (i.e., temporarily storing) a copy of such return value.
  • the logging function logs it into the designated log file.
  • the interceptor functions also may be configured to log the time required by the system function to execute the called system function ("function execution time"). This time may be ascertained by first recording the time that the call to the system function library was made by the intercepting function ("first time”), and then recording the time that the function execution was completed by the system function ("second time”). The difference between the first time and the second time is the total function execution time.
  • the interceptor functions also may be configured to log the thread identification number of the function call. Specifically, a call may be made to a log function that logs the thread identification number in any log file.
  • a call may be made to a log function that logs the thread identification number in any log file.
  • the disclosed function call logging processes may be implemented as a computer program product for use with a computer system.
  • Such implementation may include a series of computer instructions fixed either on a tangible medium, such as a computer readable media (e.g., a diskette, CD-ROM, ROM, or fixed disk) or transmittable to a computer system, via a modem or other interface device, such as a communications adapter connected to a network over a medium.
  • Medium may be either a tangible medium (e.g., optical or analog communications lines) or a medium implemented with wireless techniques (e.g., microwave, infrared or other transmission techniques).
  • the series of computer instructions embodies all or part of the functionality previously described herein with respect to the system.
  • Such computer instructions can be written in a number of programming languages for use with many computer architectures or operating systems. Furthermore, such instructions may be stored in any memory device, such as semiconductor, magnetic, optical or other memory devices, and may be transmitted using any communications technology, such as optical, infrared, microwave, or other transmission technologies. It is expected that such a computer program product may be distributed as a removable media with accompanying printed or electronic documentation (e.g., shrink wrapped software), preloaded with a computer system

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

An apparatus for logging data relating to a call from a program to a function library includes a mechanism for intercepting the call from the program, and a mechanism for storing the data relating to the intercepted call in a log file. The apparatus also includes a mechanism for transmitting the intercepted call to the function library. The program may be an application program and the library may be a dynamic link library. The data in the log file may include the name of the function and input parameters to the function. A text program may be executed to display the stored data on a display device.

Description

APPARATUS AND METHOD FOR LOGGING INFORMATION RELATING TO FUNCTION CALLS TO A FUNCTION LIBRARY
PRIORITY
This application claims priority from provisional application serial number 60/064,902, filed November 7, 1997, entitled "APPARATUS AND METHOD FOR LOGGING INFORMATION RELATING TO FUNCTION CALLS TO A FUNCTION LIBRARY" and bearing attorney docket number 1247/177, which is incorporated herein, in its entirety, by reference.
FIELD OF THE INVENTION
This invention generally relates to function libraries and, more particularly, to identifying function calls that are transmitted from executing application programs to functions in function libraries.
BACKGROUND OF THE INVENTION
Many application programs call functions in function libraries (e.g., dynamic link libraries) to perform specialized functions. OPENGL, for example, is a known application program interface that includes a specialized library of graphics functions. Functions in the OPENGL function library are called by executing programs to render drawings on a computer display device. In a manner similar to many other function libraries, calls to
OPENGL functions typically include the function name and parameters (a/k/a "arguments") to be processed by the function.
Figure 1 schematically shows an exemplary prior art system 100 that utilizes a function library 102 for controlling computer hardware 104. By way of example, the function library 102 may be the OPENGL function library and the hardware 104 may be a display device. More particularly, the disclosed prior art system 100 includes an executing application program 104 that directs function calls to the function library 102. As noted above, the function calls each include the information that is necessary for performing a desired operation (e.g., rendering drawings on the display device). The function call information may include the name of the function library 102 to receive the call, the name of the function in the designated library 102 to be accessed, and the function parameters. Once the function in the library 102 processes the function parameters, it directs a generic library message to a hardware driver 106. The hardware driver 106 then converts the generic library message into a driver message having the hardware specific instructions for controlling the hardware 104 to perform the desired function.
Programs may malfunction (i.e., have "bugs") when improper calls are made to functions in the function libraries. Such bugs may occur, for example, in programs utilizing the OPENGL application program interface. Accordingly, prior to release to desired end users, application programs like that show in figure 1 typically are tested by selected users (often software developers) to determine if the programs operate as intended. Since the tested programs include no source code and include only executable program code to be received by intended end-users (i.e.,' 'executable software"), the selected users testing the programs cannot review the program source code to locate bugs in the source code. Improper function calls therefore cannot be identified by the testing users.
Even with the assistance of a debugging program ("debugger"), improper function calls that cause programs to malfunction still cannot be located when the improper calls are made by executable software. Specifically, as is known by those skilled in the art, debuggers cannot identify the functions and their parameters when used on the executable software because debuggers require the source code to identify function calls.
Accordingly, it would be desirable to provide a method and apparatus that enables software developers to identify function calls that are directed from executable software to functions in a function library.
SUMMARY OF THE INVENTION
In accordance with one aspect of the invention, an apparatus for logging data relating to a call from a program to a function library includes a mechanism for intercepting the call from the program, and a mechanism for storing the data relating to the intercepted call in a log file. The apparatus also includes a mechanism for transmitting the intercepted call to the function library either while the data is being stored in the log file, or after the data is stored in the log file. In further embodiments, the program is an application program and the function library is a dynamic link library. In other embodiments, the data in the log file includes the name of the function and input parameters to the function. In still other embodiments of the invention, a text program may be executed to display the stored data on a display device.
In accordance with another aspect of the invention, the data is stored in the log file in a predetermined format. That format may be in the form of computer program source code such as, for example, program source code in the "C" programming language. The source code may be compiled to form a log executable file that may be run to display a graphical image on a display device. This aspect of the invention preferably stores the log file in a nonvolatile storage medium. In accordance with other aspects of the invention, a graphical user interface may be provided for entering configuration information relating to the log file. For example, the configuration information may be the name of the function library containing the functions to be logged.
BRIEF DESCRIPTION OF THE DRAWINGS
The foregoing and other objects and advantages of the invention will be appreciated more fully from the following further description thereof with reference to the accompanying drawings wherein: Figure 1 schematically shows an exemplary prior art system that utilizes a function library for controlling computer hardware.
Figure 2 illustrates the system architecture for an exemplary computer system on which the disclosed method and apparatus for logging function calls can be implemented.
Figure 3 shows a preferred logging system for implementing the disclosed apparatus and method for logging function calls.
Figure 4 shows a preferred process that may be utilized by the logging system for logging a function call.
Figure 5 schematically shows a graphical user interface that may be utilized in preferred embodiments of the invention to configure the logging system.
Figure 6 shows a preferred process for displaying a log file. Figure 7 shows a preferred process for controlling hardware with an executable log file.
DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS
In accordance with a preferred embodiment of the invention, a method and apparatus for logging function calls first intercepts function calls transmitted from an application program to functions in a function library. Once intercepted, information relating to the function calls are stored in a log file (identified as log file 310 in figure 3) that preferably is stored in a non-volatile storage medium. The log file may be formatted as a text file that can be displayed on a display device by a text editing application program. In preferred embodiments, the text in the log file is formatted as source code for compilation by a software compiler to produce an executable code file. The executable code file then may be run to display a graphical image on a display device. Figure 2 illustrates the system architecture for an exemplary computer system 200, such as an IBM THINKPAD 701® computer (distributed by International Business Machines of Armonk, New York), on which the disclosed method and apparatus for logging information relating to function calls can be implemented. The exemplary computer system of Figure 2 is discussed for descriptive purposes only, however, and should not be considered a limitation of the invention. Although the description below may refer to terms commonly used in describing particular computer systems, the described concepts apply equally to other computer systems, including systems having architectures that are dissimilar to that shown in Figure 2.
The computer 200 includes a central processing unit (CPU) 205 having a conventional microprocessor, random access memory (RAM) 210 for temporary storage of information, and read only memory (ROM) 215 for permanent storage of read only information. A memory controller 200 is provided for controlling system RAM 210. A bus controller 225 is provided for controlling a bus 230, and an interrupt controller 235 is provided for receiving and processing various interrupt signals from the other system components.
Mass storage may be provided by known non-volatile storage media, such as a diskette 242, a digital versatile disk (not shown), a CD-ROM 247, or a hard disk 252. Data and software may be exchanged with the computer system 200 via removable media, such as the diskette 242 and the CD-ROM 247. The diskette 242 is insertable into a diskette drive 241, which utilizes a diskette drive controller 240 to interface with the bus 230. Similarly, the CD-ROM 247 is insertable into a CD-ROM drive 246, which utilizes a CD-ROM drive controller 245 to interface with the bus 230. Finally, the hard disk 252 is part of a fixed disk drive 251 , which utilizes a hard drive controller 250 to interface with the bus 230.
User input to the computer 200 may be provided by a number of devices. For example, a keyboard 256 and a mouse 257 may be connected to the bus 330 by a keyboard and mouse controller 255. An audio transducer 296, which may act as both a microphone and a speaker, is connected to the bus 230 by audio controller 297. It should be obvious to those reasonably skilled in the art that other input devices, such as a pen and/or tablet and a microphone for voice input, may be connected to computer 200 through bus 230 and an appropriate controller. A direct memory access (DMA) controller 260 is provided for performing direct memory access to system RAM 210. A visual display may be generated by a video controller 265, which controls a display device 270.
A network adapter 290 also may be included to enable the computer system 200 to be interconnected to a network 295 via a network bus 291. The network 295, which may be a local area network (LAN), a wide area network (WAN), or the Internet, may utilize general purpose communication lines that interconnect a plurality of network devices.
The computer system 200 preferably is controlled and coordinated by operating system software, such as the WINDOWS NT® operating system (available from Microsoft Corp., Redmond, WA). Among other computer system control functions, the operating system controls allocation of system resources and performs tasks such as process scheduling, memory management, networking, and I/O services. The operating system preferable includes an OPENGL application program interface for rendering non-trivial graphical indicia on the display device 270. Figure 3 shows a preferred system (hereinafter "logging system 300") for implementing the apparatus and method for logging information relating to function calls (hereinafter referred to as "logging function calls"). The system includes an interceptor function library 302 for intercepting function calls directed from an executing application program 304 to a system function library 306 (e.g., a dynamic link library). The interceptor function library 302 includes a plurality of functions having the same names as the functions in the system function library 306. For example, if the system function library 306 includes a function named "shade", the interceptor function library 302 also will have a function named "shade." It is important to note, however, that although the functions in the interceptor function library 302 have the same name as those in the system function library 306, they perform vastly different tasks. Namely, the interceptor functions merely gather and format the data to be stored in the log file 310, and then direct the function call to the system function library 306 for processing. Details of this process are discussed below with reference to figure 4.
The logging system 300 further includes a logging function library 308 for storing the formatted data in the log file 310, and a configuration utility 312 for configuring the logging system 300 (discussed below). The logging system 300 preferably is utilized with hardware 314 and a hardware driver 316 for driving the hardware 314. In preferred embodiments, the executing application program 304 is a graphical drawing program such as, for example, Softimage (distributed by Microsoft Corp.). In addition, the system function library 306 preferably is an OPENGL function library, and the hardware 314 preferably is a computer display device. The logging function library 308, intercept function library, and configuration utility 312 preferably are loaded into the non-volatile memory of the computer system 200 when the logging system 300 is installed.
Figure 4 shows a process that may be utilized by the logging system 300 for logging a function call. The process may be repeated each time a function call is made by the application program 304. The process begins at step 400 in which it is determined if the system has been configured to log function calls. The logging system 300 must be configured at least once before it can log function calls. Once configured, designated function calls within the computer system 200 are logged each time the application program 304 executes.
In some embodiments, logging (i.e., the process of storing function calls in a log file 310) may be turned "off to stop logging any time after the system is configured. Similarly, logging may be turned "on" again at any subsequent time by either re-configuring the system, or turning the logging function on via a graphical user interface (discussed below). The configuration information may be entered by a user via a graphical user interface
(identified as GUI 500 ) that is a part of the configuration utility 312. Information entered into the GUI 500 preferably is stored in the operating system registry (present in the Microsoft NT™ operating system), which includes the operating system configuration and computer system 200 set-up data. Figure 5 schematically shows one such graphical user interface that may be utilized in preferred embodiments of the invention. The GUI 500 includes several fields for enabling a user to enter configuration information into the system. Among the fields in the GUI 500 is a " NAME OF FUNCTION LIBRARY" field 502 for entering the name of the function library to be logged, a "NAME OF EXECUTABLE TO LOG" field 504 for entering the name of the application program 304, and a "LOC ATION OF LOG FILE" field 506 designating the name of the resulting log file 310 and a path statement identifying the intended storage location of the log file 310 within the computer system 200. In preferred embodiments, the log file 310 is stored in the hard disk 252.
Once configured, the logging system 300 logs all function calls from the designated application program 304 to a designated function library each time the application program 304 executes. Accordingly, each subsequent time the program 304 runs, the logging system
300 either overwrites the existing log file 310 in the hard disk 252, or creates another log file 310. To that end, an "OVERRIDE" field 508 also may be included in the GUI 500 that enables the system to either overwrite an existing log file 310 for the same function library, or to create a new log file 310 in addition to the existing log file 310. Each new log file 310 preferably is stored in the same directory as the existing log file 310 with a name that distinguishes it from related earlier created log files 310 created for the designated program 304. For example, each succeeding log file 310 for a specified program 304 may be named XXXI, XXX2, XXX3, ...XXXN, where N is an integer indicating the number of times the program 304 has been logged. The "OVERRIDE" field 508, for example, may be a box or button that, when selected, alternatively displays "OVERRIDE YES" or "OVERRIDE NO." The override button preferably is defaulted to override existing log files 310 because of the large amount of memory (e.g., ten megabytes in many graphical applications) that may be required for such files. The GUI 500 also may include additional buttons such as a "FUNCTIONS ONLY" button 510 for logging the function names only and not the input parameters required for the functions. In the preferred embodiment, the system is set to default to logging both the functions and their input parameters. The GUI 500 also may include a "LOGGING ON/OFF' button 512 to turn the logging function on or off. Returning to step 400, if the system has not been configured or logging is off, then the process skips to step 406 (discussed below). Conversely, if the system has been configured and logging is on, then the process continues to step 402 in which the intercept function library intercepts a function call transmitted from the program 304 to the system function library 306. Calls are intercepted because during the configuration step, the configuration utility 312 both assigns the name of the system function library 306 to the intercept function library, and renames the system function library 306. It should be noted, however, that the configuration utility 312 subsequently renames the system function library 306 to its initial name when logging is turned off. Accordingly, when logging is on, function calls (which include a header having the name of the function library having the function) locate and execute the function in the intercept function library because such function library name matches the function library name in the function call header.
The function in the intercept function library that receives the function call (i.e., the "receiving function") consequently gathers the required data from the function call and formats the data into a character string in a predefined format. More particularly, when the "FUNCTION ONLY" button 510 in the GUI 500 is not selected, the receiving function reads the call, which includes, among other things, the name of the function and the input parameters to that function. The function name and its parameters thus are copied into the character string and transmitted to the logging function library 308. Conversely, when the "FUNCTION ONLY" button 510 in the GUI 500 has been selected, then only the function is copied into the character string and transmitted to the logging function library 308. The process then proceeds to step 404 and 406 substantially simultaneously. Alternatively, the process may proceed to step 406 after step 404 is completed, or may proceed to step 404 after step 406 is completed. At step 404. the data is logged by a logging function in the logging function library 308. More particularly, the logging function first determines if the current function call is the first function call from the designated program 304 to the designated function library to be logged. If it is the first such function call, then the logging function initializes a log file 310 to store the data. As suggested above, it determines if another log file 310 has been created for the designated program 304 and function library and reacts accordingly. The logging function then determines if logging is on or off. If logging is off, then the received text string is not stored in the log file 310. If logging is on, then the received text string is stored in the log file 310 in the format received.
At step 406, the receiving function in the intercept function library 302 directs the function call to the system function library 306 for processing. After the function call is processed, the function in the system function library 306 directs to the hardware driver 316 a library message having generic instructions for controlling the hardware 314 (step 408). The hardware driver 316 responsively directs a hardware message to the hardware 314 with hardware specific instructions for performing a specified task such as, for example, darkening a pixel on a computer display device. The log file 310 may be displayed on a display device after all of the calls have been logged. Figure 6 shows a preferred process for displaying the log file 310. The process begins at step 600 in which a text program is executed. The text program may be any text program such as, for example, MICROSOFT WORD 97, distributed by Microsoft Corp. The process continues to step 602 in which the text program accesses the log file 310. The location of the log file 310 is that designated in the GUI 500. The text program then is controlled to display the text in the log file 310 (step 604).
As noted above, the log file 310 preferably includes a plurality of strings in a selected format having the function names and function parameters. Function parameters may include, among other things, integers, characters, text, and other functions in the function library with their own input parameters. In the preferred embodiment, the text strings are formatted into programming source code in the "C" programming language. The configuration utility 312 therefore initializes the log file 310 to include various "C" commands such as "main." The receiving function in the intercept function library therefore formats the text string into the format of a "C" function call by positioning the function name and the function parameters in the string in an predefined order required for a "C" function call. In alternative embodiments, the configuration utility 312 and receiving function in the intercept function library together format the log file 310 to be in other programming languages such as "C++", JAVA, or FORTRAN. The log file 310 may be compiled to produce an executable file for performing the functions of the logged function calls. Such log file must be the embodiment having both the function calls and their respective input parameters. The executable file then may be run to control the hardware 314 in a substantially identical fashion to that done by the application program 304. For example, if the program 304 is a graphics program calling OPENGL functions in an OPENGL function library, then the executing compiled log file 310 should produce substantially the same graphical indicia on the display device as the application program 304 had when it generated the function calls. Figure 7 shows a preferred process for controlling the hardware 314 in such fashion. The process begins at step 700 in which the log file 310 is compiled. Once compiled, it may be executed, thereby calling the functions in the system function library 306 (step 702).
A user therefore may initiate the logging process by running the configuration utility 312. Once the configuration data is entered, the logging system 300 repeatedly logs the designated function calls each time the application program 304 is used. The log file 310 may be utilized for many purposes. One use, for example, may be to run software demonstrations showing use of the application program 304. Another use may be to analyze the uncompiled log file 310 to determine if any bugs exist in the application program 304. Analysis may be performed with post processing tools that simplify the analysis process. In addition to logging the function name and/or the function parameters of each designated function, the interceptor functions in the interceptor function library 302 may be configured to log additional information relating to the function calls. For example, a return value for a function may be intercepted and logged either in the log file 310, or in another log file. The return value may be intercepted by configuring the interceptor function to assign a location in system memory for returning (i.e., temporarily storing) a copy of such return value. When the return value is returned by the system function, the logging function logs it into the designated log file.
The interceptor functions also may be configured to log the time required by the system function to execute the called system function ("function execution time"). This time may be ascertained by first recording the time that the call to the system function library was made by the intercepting function ("first time"), and then recording the time that the function execution was completed by the system function ("second time"). The difference between the first time and the second time is the total function execution time.
The interceptor functions also may be configured to log the thread identification number of the function call. Specifically, a call may be made to a log function that logs the thread identification number in any log file. Each of these examples of information relating to the function calls is intended to be exemplary and thus, should not be construed to limit the scope of the invention.
In an alternative embodiment, the disclosed function call logging processes may be implemented as a computer program product for use with a computer system. Such implementation may include a series of computer instructions fixed either on a tangible medium, such as a computer readable media (e.g., a diskette, CD-ROM, ROM, or fixed disk) or transmittable to a computer system, via a modem or other interface device, such as a communications adapter connected to a network over a medium. Medium may be either a tangible medium (e.g., optical or analog communications lines) or a medium implemented with wireless techniques (e.g., microwave, infrared or other transmission techniques). The series of computer instructions embodies all or part of the functionality previously described herein with respect to the system. Those skilled in the art should appreciate that such computer instructions can be written in a number of programming languages for use with many computer architectures or operating systems. Furthermore, such instructions may be stored in any memory device, such as semiconductor, magnetic, optical or other memory devices, and may be transmitted using any communications technology, such as optical, infrared, microwave, or other transmission technologies. It is expected that such a computer program product may be distributed as a removable media with accompanying printed or electronic documentation (e.g., shrink wrapped software), preloaded with a computer system
(e.g., on system ROM or fixed disk), or distributed from a server or electronic bulletin board over the network (e.g., the Internet or World Wide Web).
Although various exemplary embodiments of the invention have been disclosed, it should be apparent to those skilled in the art that various changes and modifications can be made which will achieve some of the advantages of the invention without departing from the true scope of the invention. These and other obvious modifications are intended to be covered by the appended claims.

Claims

1. A method of logging data relating to a call to a function in a function library, the call being made by a program, the method comprising:
A. intercepting the call from the program;
B. storing the data relating to the call in a log file; and
C. transmitting the intercepted call to the function library.
2. The method as defined by claim 1 wherein the program is an application program.
3. The method as defined by claim 1 wherein the data in the log file includes the name of the function.
4. The method as defined by claim 3 wherein the data in the log file includes input parameters to the function.
5. The method as defined by claim 1 wherein the data is stored in a predetermined format.
6. The method as defined by claim 5 wherein the predetermined format is source code.
7. The method as defined by claim 6 wherein the source code is in the C programming language.
8. The method as defined by claim 1 further including the step of:
D. compiling the log file to form a log executable file.
9. The method as defined by claim 8 wherein at least a part of the data is utilized by the function to produce a graphical image, the method further including the step of:
E. running the log executable file to display the graphical image on a display device.
10. The method as defined by claim 1 further including the steps of:
F. providing a graphical user interface having fields for entering configuration information, the configuration information including name of the function library containing the function.
11. The method as defined by claim 1 wherein the function library is a dynamic link library.
12. The method as defined by claim 1 wherein the log file is a text file, the method further comprising:
G. executing a text program to display the data on a display device.
13. The method as defined by claim 1 wherein the data is stored in a nonvolatile disk.
14. An apparatus for logging data relating to a call to a function in a function library, the call being made by a program, the apparatus comprising: means for intercepting the call from the program; means for storing the data relating to the call in a log file; and means for transmitting the intercepted call to the function library.
15. The apparatus as defined by claim 14 wherein the program is an application program.
16. The apparatus as defined by claim 14 wherein the data in the log file includes the name of the function.
17. The apparatus as defined by claim 16 wherein the data in the log file includes input parameters to the function.
18. The apparatus as defined by claim 14 wherein the data is stored in a predetermined format.
19. The apparatus as defined by claim 18 wherein the predetermined format is source code.
20. The apparatus as defined by claim 19 wherein the source code is in the C programming language.
21. The apparatus as defined by claim 14 further including: means for compiling the log file to form a log executable file.
22. The apparatus as defined by claim 21 wherein at least a part of the data is utilized by the function to produce a graphical image, the apparatus further including: means for running the log executable file to display the graphical image on a display device.
23. The apparatus as defined by claim 14 further including: means for providing a graphical user interface having fields for entering configuration information, the configuration information including the name of the function library containing the function.
24. The apparatus as defined by claim 14 wherein the function library is a dynamic link library.
25. The apparatus as defined by claim 14 wherein the log file is a text file, the apparatus further comprising: means for executing a text program to display the data on a display device.
26. The apparatus as defined by claim 14 wherein the data is stored in a nonvolatile disk.
27. A computer program product for use on a computer system for logging data relating to a call to a function in a function library, the call being made by a program, the computer program product comprising a computer usable medium having computer readable program code thereon, the computer readable program code including: program code for intercepting the call from the program; program code for storing the data relating to the call in a log file; and program code for transmitting the intercepted call to the function library.
28. The computer program product as defined by claim 27 wherein the program is an application program.
29. The computer program product as defined by claim 27 wherein the data in the log file includes the name of the function.
30. The computer program product as defined by claim 29 wherein the data in the log file includes input parameters to the function.
31. The computer program product as defined by claim 27 wherein the data is stored in a predetermined format.
32. The computer program product as defined by claim 31 wherein the predetermined format is source code.
33. The computer program product as defined by claim 32 wherein the source code is in the C programming language.
34. The computer program product as defined by claim 27 further including: program code for compiling the log file to form a log executable file.
35. The computer program product as defined by claim 34 wherein at least a part of the data is utilized by the function to produce a graphical image, the computer program product further including: program code for running the log executable file to display the graphical image on a display device.
36. The computer program product as defined by claim 27 further including: program code for providing a graphical user interface having fields for entering configuration information, the configuration information including the name of the function library containing the function.
37. The computer program product as defined by claim 27 wherein the function library is a dynamic link library.
38. The computer program product as defined by claim 27 wherein the log file is a text file, the computer program product further comprising: program code for executing a text program to display the data on a display device.
39. The computer program product as defined by claim 27 wherein the data is stored in a nonvolatile disk.
40. The computer program product as defined by claim 27 wherein the data relating to the call includes a return value from the function in the function library.
41. The computer program product as defined by claim 27 wherein the data relating to the call includes a thread identification string.
42. The computer program product as defined by claim 27 wherein the data relating to the call includes the execution time of the function.
PCT/US1998/023363 1997-11-07 1998-11-03 Apparatus and method for logging information relating to function calls to a function library WO1999024904A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP98955239A EP1027652A1 (en) 1997-11-07 1998-11-03 Apparatus and method for logging information relating to function calls to a function library

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US6490297P 1997-11-07 1997-11-07
US60/064,902 1997-11-07

Publications (1)

Publication Number Publication Date
WO1999024904A1 true WO1999024904A1 (en) 1999-05-20

Family

ID=22058992

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US1998/023363 WO1999024904A1 (en) 1997-11-07 1998-11-03 Apparatus and method for logging information relating to function calls to a function library

Country Status (2)

Country Link
EP (1) EP1027652A1 (en)
WO (1) WO1999024904A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007063422A3 (en) * 2005-12-01 2007-11-08 Exent Technologies Ltd System, method and computer program product for dynamically enhancing an application executing on a computing device
US7406685B2 (en) * 2000-12-13 2008-07-29 Microsoft Corporation System and method for whole-system program analysis
US7596536B2 (en) 2005-12-01 2009-09-29 Exent Technologies, Ltd. System, method and computer program product for dynamically measuring properties of objects rendered and/or referenced by an application executing on a computing device
US8629885B2 (en) 2005-12-01 2014-01-14 Exent Technologies, Ltd. System, method and computer program product for dynamically identifying, selecting and extracting graphical and media objects in frames or scenes rendered by a software application
US20150370687A1 (en) * 2014-06-19 2015-12-24 Linkedln Corporation Unit test generation
US9459990B2 (en) 2012-03-27 2016-10-04 International Business Machines Corporation Automatic and transparent application logging

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100347669C (en) * 2003-12-30 2007-11-07 佳能株式会社 Operation log acquiring method, program and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
"Execution Trace Analysis of OS/2 2.* DLLs Using an Intercept Layer", IBM TECHNICAL DISCLOSURE BULLETIN., vol. 37, no. 3, March 1994 (1994-03-01), NEW YORK US, pages 373 - 375, XP000441507 *
"Method of Tracing Events in Multi-threaded OS/2 Applications", IBM TECHNICAL DISCLOSURE BULLETIN., vol. 36, no. 09A, September 1993 (1993-09-01), NEW YORK US, pages 19 - 21, XP000395297 *
"Tracing the Exported Entry Points in an OS/2 Dynamic Link Library", IBM TECHNICAL DISCLOSURE BULLETIN., vol. 33, no. 6B, November 1990 (1990-11-01), NEW YORK US, pages 140 - 141, XP000108821 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7406685B2 (en) * 2000-12-13 2008-07-29 Microsoft Corporation System and method for whole-system program analysis
WO2007063422A3 (en) * 2005-12-01 2007-11-08 Exent Technologies Ltd System, method and computer program product for dynamically enhancing an application executing on a computing device
US7596536B2 (en) 2005-12-01 2009-09-29 Exent Technologies, Ltd. System, method and computer program product for dynamically measuring properties of objects rendered and/or referenced by an application executing on a computing device
US7596540B2 (en) 2005-12-01 2009-09-29 Exent Technologies, Ltd. System, method and computer program product for dynamically enhancing an application executing on a computing device
US8060460B2 (en) 2005-12-01 2011-11-15 Exent Technologies, Ltd. System, method and computer program product for dynamically measuring properties of objects rendered and/or referenced by an application executing on a computing device
US8069136B2 (en) 2005-12-01 2011-11-29 Exent Technologies, Ltd. System, method and computer program product for dynamically enhancing an application executing on a computing device
US8629885B2 (en) 2005-12-01 2014-01-14 Exent Technologies, Ltd. System, method and computer program product for dynamically identifying, selecting and extracting graphical and media objects in frames or scenes rendered by a software application
US9459990B2 (en) 2012-03-27 2016-10-04 International Business Machines Corporation Automatic and transparent application logging
US20150370687A1 (en) * 2014-06-19 2015-12-24 Linkedln Corporation Unit test generation

Also Published As

Publication number Publication date
EP1027652A1 (en) 2000-08-16

Similar Documents

Publication Publication Date Title
US7437715B2 (en) System and method for generating a set of robot commands based on user entry events in a user interface
US6968539B1 (en) Methods and apparatus for a web application processing system
US8640104B2 (en) Computer method and apparatus for debugging in a dynamic computer language
US6412106B1 (en) Graphical system and method for debugging computer programs
KR101246967B1 (en) Method and apparatus for executing unit tests in application host environment
US5317688A (en) Software agent used to provide instruction to a user for a plurality of computer applications
US5630049A (en) Method and apparatus for testing software on a computer network
EP3338179B1 (en) Graphical representation of data in a program code editor
US5546583A (en) Method and system for providing a client/server interface in a programming language
US7882492B2 (en) Intelligent computer program debugger, and system and method for implementing the same
US20080209405A1 (en) Distributed debugging for a visual programming language
US10061575B2 (en) Managed execution environment for software application interfacing
US20050278318A1 (en) Iterative development with prioritized build
US20040078719A1 (en) Distributed component testing in an enterprise computer system
US8904346B1 (en) Method and system for automated load testing of web applications
US6951012B2 (en) API to increase debug log performance
US6799320B1 (en) Providing binding options for component interfaces
JPH07175654A (en) Context specifications in callback-style programming
JPH11505645A (en) Apparatus and method for simulating a digital system based on a processor
US20080301641A1 (en) Management of Heterogeneous Software Artifacts Through a Common Representation
EP1027652A1 (en) Apparatus and method for logging information relating to function calls to a function library
CN114217789A (en) Function component expansion method, device, equipment, storage medium and program product
CN112988175A (en) Cross-platform application installation package generation method, device, medium and electronic equipment
US20070006121A1 (en) Development activity recipe
EP0352908A2 (en) Computing system and method used to provide instruction to a user for a plurality of computer applications

Legal Events

Date Code Title Description
AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): AT BE CH CY DE DK ES FI FR GB GR IE IT LU MC NL PT SE

121 Ep: the epo has been informed by wipo that ep was designated in this application
DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
WWE Wipo information: entry into national phase

Ref document number: 1998955239

Country of ref document: EP

WWP Wipo information: published in national office

Ref document number: 1998955239

Country of ref document: EP

WWW Wipo information: withdrawn in national office

Ref document number: 1998955239

Country of ref document: EP