1. Field of the Invention
This invention relates in general to a computer programming, and more particularly to a method, system and program storage device for providing request trace data in a user mode device interface.
2. Description of Related Art
In a highly competitive market environment, “time to market with superior quality” is the key focus in developing a new product. For a well-established development team with years of experience in software development, the reusability of existing software is the very key to achieving the goals of delivering a new product in the most efficient way with superior quality. Given the stiff competition in the market environment, what a new product is required to do is constantly increasing and how much it is allowed to cost is reducing. For a software product development, the demanding requirements and pressure of lowering cost are translated into the need for the reuse of existing software functions in various hardware platforms. One of the focus items to achieve high software reusability is to develop the software functions with the encapsulation of a platform they are operating on. The platform includes the actual hardware and the operating systems.
One key consideration in selecting a platform for a product is whether the software can best perform in privileged mode or user mode. The traditional thinking is software can best perform in privileged mode. However, given the advancing technology in hardware platform development, operating in user mode may be a much better choice given different product requirements. The built-in protection provided by all modern operating systems for a software running in user mode, the ease of managing a program in a user mode, and the improved system stability with new software functions isolated from kernel are significant benefits of implementing a software project in user mode.
For a software product family to maintain high reusability across a range of products that may be operating in various platforms, a consistent device interface is a key for the software functions it provides to be invoked consistently. A software product consists of a set of key software components and software applications, which may be implemented as collaborating privileged and user mode applications to provide the functionality intended by the software product. In a user mode implementation of a real-time software application, the software product also provides a user mode device interface using socket interface.
For a real-time user application to run on a particular platform that has a relatively small file system using Compact Flash (CF) memory, it must manage the resource allocation within the file systems space constraints. In order to provide proper maintenance and support for the user mode device interface, it is critical to build in First Time Data Capture (FTDC) capability in this interface. In this case, the main user application includes the device interface server and it has a rich set of run-time trace functions. The trace is easily accomplished on the device interface server side. However, on the device interface client side, which is typically a utility program making a device interface request to the device interface server, the trace facility relies on what is available if any at all in the design of the utility program. In the device interface, there is a key trace requirement that traces which program (with program name) is making which device interface request at the time when a request is made. Such information is only available in a utility program. Unfortunately, most of the utility programs use a primitive command, such as “printf”, to print out text strings to standard output or log files during program execution as the only trace facility.
There are several problems with this approach. First, if the printf output is only for standard output, such trace is only useful when a user is “watching” the screen, which is very limited to a service person with privileged authority to gain such access in a customer environment. Such trace is only useful in a development environment.
Second, if the text strings are saved to a log file, the owner of the utility program will then have additional responsibility and work to ensure the log file is managed under another system management program so the log file will not take up too much space in the file system over time. Without proper management of a log file by a long running program, the log file may eventually fill up the file systems and cause the whole system to crash in the worst case.
There is a need for a method, system and program storage device for providing request trace data in a user mode device interface without creating additional utility log files.
To overcome the limitations in the prior art described above, and to overcome other limitations that will become apparent upon reading and understanding the present specification, the present invention discloses a method, system and program storage device for providing request trace data in a user mode device interface.
The present invention solves the above-described problems by providing a trace utility for a user device interface. The trace facility is incorporated in a user mode device interface. Upon the receipt of a device interface request from a client application, it sends a “device open” packet, which includes request trace data, to the main server application. The main server application then generates a trace entry on behalf of the client application making the user mode device interface request.
A user device interface according to an embodiment of the present invention includes a trace utility for generating a device open packet having request trace data therein for forwarding to a main user application trace facility in response to receipt of a device interface request from a client application.
In another embodiment of the present invention, a computing system is provided. The computing system includes a processor having a user mode and a protected kernel mode and a memory, coupled to the processor, the memory including program code, executing in the processor, for providing a user mode device interface, the user mode device interface processing a device interface request by generating a device open packet having request trace data therein for forwarding to a main user application trace facility in response to receipt of a device interface request from a client application.
In another embodiment of the present invention, a program storage device that includes program instructions executable by a processing device to perform operations for providing a user mode device interface for providing request trace data is provided. The operations include generating a device open packet having request trace data therein in response to receipt of a device interface request from a client application and forwarding the device open packet having request trace data therein to a main user application trace facility.
These and various other advantages and features of novelty which characterize the invention are pointed out with particularity in the claims annexed hereto and form a part hereof. However, for a better understanding of the invention, its advantages, and the objects obtained by its use, reference should be made to the drawings which form a further part hereof, and to accompanying descriptive matter, in which there are illustrated and described specific examples of an apparatus in accordance with the invention.
Referring now to the drawings in which like reference numbers represent corresponding parts throughout:
In the following description of the embodiments, reference is made to the accompanying drawings that form a part hereof, and in which is shown by way of illustration the specific embodiments in which the invention may be practiced. It is to be understood that other embodiments may be utilized because structural changes may be made without departing from the scope of the present invention.
The present invention provides a method, system and program storage device for providing request trace data in a user mode device interface. A trace utility for a user device interface is provided. The trace facility generates a device open packet having request trace data therein for forwarding to a main user application trace facility in response to receipt of a device interface request from a client application.
The computer system 100 and the allocation of system resources to the computer system 100 are controlled by operating system 138. For the purpose of the present discussion, it is assumed that operating system 138 is resident within primary memory 132, although those skilled in the art will appreciate that certain infrequently utilized segments of operating system 138 may be swapped out to secondary memory 134 by memory manager 136. Operating system 138 includes kernel 140, which comprises the lowest layer of operating system 138 that interacts most directly with the computer system 100. Kernel 140 dispatches kernel threads to processors 130 for execution, provides services to device drivers interfacing with hardware within computer system 100, and implements system services, memory management, network access, and the file system utilized by computer system 100. In addition to kernel 140, primary memory 132 also stores frequently utilized segments of application software 142. As is well known to those skilled in the art, application software 142 communicates with operating system 138 through an Application Programming Interface (API).
Computer system 100 also includes bus interface 144 through which multiple nodes can interface to system resources available within computer system 100. As will be appreciated by those skilled in the art, computer system 100 may also include additional hardware coupled to system bus 146 that is not necessary for an understanding of the present invention and is accordingly omitted for simplicity.
Processes that run in kernel-mode 220 can directly access system data and hardware, and are not restricted like processes running in user-mode 210. Performance-sensitive drivers and services run in kernel mode 220 to interact with hardware more efficiently. All components for processes running in kernel-mode 220 are fully protected from applications running in user mode 210. Processes that run in user mode 210 are effectively isolated from processes running in kernel-mode 220 and other processes running in user-mode 210.
In
The kernel operates in its own protected address space and includes its own registers 222 and kernel stack 224. The kernel maintains the integrity of its own data structures and that of other processes. The kernel stack 224 includes information used by the kernel. Kernel memory 226 is generally shared by all processes, but is only accessible in kernel mode 220. Context switches from one task to another happen on the kernel stack 214 of the current process.
As shown in
The user mode device interface 430 provides Request Trace Data (RTD) as part of the special “Device Open” data packet 442 sent to the main application 420 when a device interface request 440 is made. A Device Open data packet 442 sent in the device interface request 440 to the main user application 420 opens a device. A Device Open data packet 442 can be issued by any utility program 410 that wishes to open a connection and to reserve a device. The main application 420 then incorporates the RTD in its existing traces already in place in a built-in trace buffer. Accordingly, the process can be viewed as the main user application 420 is making a trace on behalf of a utility program in one of the internal trace buffers on the server side 470 of the socket interface 432.
Each request 442 is matched with the proper program on the server side 420. Since the RTD is sent to main application 420 by a utility program 410 when a device interface request 440 is made, the request 332 is automatically synchronized with all the activity on the server side 470 to handle this request. This helps the debug activity tremendously compared to trying to align a utility log file with trace data from the server side 470 and the effort to match-up between significantly different time stamp mechanisms provided by the main user application 420. Since the runtime tracing by the main user application 420 is performed in memory space, there is no burden on the memory of the file systems in terms of wearing out memory life cycle or usage of memory space. The performance of making such traces by the main user application 420 is much better than providing file input/output with text strings by the utility program 410.
In
The Request Trace Data 616 may be expanded to include other traces by a utility program as long as it is information available at the time when a device interface request is made. However, the Request Trace Data 616 is typically not intended as a general purpose trace facility for the utility program (socket client) to use. The trace point is only limited to when a Device Open packet is sent to the server side.
For the purposes of this description, a computer-usable or computer readable medium 868 can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The medium 868 may be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid-state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) and DVD.
A system suitable for storing and/or executing program code will include at least one processor 896 coupled directly or indirectly to memory elements 892 through a system bus 820. The memory elements 892 can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices 840 (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly to the system or through intervening I/O controllers.
Network adapters 850 may also be coupled to the system to enable the system to become coupled to other data processing systems 852, remote printers 854 or storage devices 856 through intervening private or public networks 860. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
Accordingly, the computer program 890 comprise instructions which, when read and executed by the system 800 of
The foregoing description of the embodiment of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not with this detailed description, but rather by the claims appended hereto.