The present invention relates to memory usage information, and more specifically, to a storage profiler for a computer operating system.
In today's environment there many tools on the market that monitor application memory usage. Storage utilization is a quantitative measure of how well the available data storage space in an enterprise is used. Many of the tools monitor real-time storage usage or are concerned with end-to-end performance metrics such as CPU utilization. Other tools can track the utilization of external memory. As the number of utilized applications increase and the amount of data to be stored increases, storage utilization must be efficiently managed given a set of limited resources. The information gathered regarding storage usage can be used by programmers during a design process to optimize the operation of a program. Understanding storage usage within an application is important for defect detection, performance evaluation, and application efficiency.
According to an embodiment of the present invention, computer-implemented methods, systems, and computer program products for storage profiler for a computer operating system.
An embodiment includes a computer-implemented method for operating a storage profiler for a computer operating system. The method includes analyzing statements of an application to identify instructions that are associated with obtaining storage and statements that alter storage values in the obtained storage upon entry to every compile unit in the application, and overlaying storage statement hooks on the identified instructions and the identified statements. The method also includes responsive to overlaying the storage statement hooks, updating a storage data structure based on the storage statement hooks, displaying the storage usage data as a grid map based on the storage data structure, the grid map comprising blocks associated with a storage location for system memory, and selecting a data block of the grid map for the storage usage data.
Another embodiment includes a computer program product for operating a storage profiler for a computer operating system, the computer program product having a computer readable storage medium having stored thereon first program instructions executable by a processor to cause the processor to analyze statements of an application to identify instructions that are associated with obtaining storage and statements that alter storage values in the obtained storage upon entry to every compile unit in the application. The instructions are further executable to cause the processor to overlay storage statement hooks on the identified instructions and the identified statements, and responsive to overlaying the storage statement hooks, update a storage data structure based on the storage statement hooks. The instructions are also executable to cause the process to display the storage usage data as a grid map based on the storage data structure, the grid map comprising blocks associated with a storage location for system memory; and select a data block of the grid map for the storage usage data.
A different embodiment includes system for a storage profiler for a computer operating system, the system includes a system memory, a storage medium, the storage medium being coupled to a processor, the processor configured to analyze statements of an application to identify instructions that are associated with obtaining storage and statements that alter storage values in the obtained storage upon entry to every compile unit in the application. The processor is also configured to overlay storage statement hooks on the identified instructions and the identified statements and responsive to overlaying the storage statement hooks, update a storage data structure based on the storage statement hooks. The processor is configured to display the storage usage data as a grid map based on the storage data structure, the grid map comprising blocks associated with a storage location for system memory, and select a data block of the grid map for the storage usage data.
The subject matter which is regarded as the invention is particularly pointed out and distinctly claimed in the claims at the conclusion of the specification. The foregoing and other features and advantages of the invention are apparent from the following detailed description taken in conjunction with the accompanying drawings in which:
In accordance with exemplary embodiments of the disclosure, methods, systems and computer program products for storage profiler for a computer operating system, such as z/OS™.
The technique provided herein detects storage inefficiencies where storage is obtained and not used. For example, the scenario may exist where large macros are included in an application where storage is obtained for the large macros, but only a small fraction of the obtained storage is actually used.
In addition, this technique allows for locating the source of errors using program slicing at the storage address level. Program slicing at the storage address level effectively shows program inefficiencies in storage usage. Also, the described technique identifies the source of storage overlays in an application. A comprehensive view of application storage for a computer operating system is provided which includes information of the obtained and freed storage as well as showing usage of the specific storage blocks of the system memory.
Monitoring variable value changes as an application executes is a useful debugging mechanism, but requires the programmer to set break points to watch the variable changes within an application. This requires the programmers to know in advance which CUs alter a particular storage in order to set breakpoints to monitor that storage. Often a storage alteration trap to capture a dump must be set; this requires privileged system access and the knowledge of the specific address or register and offset, and a time-consuming dump analysis to determine the culprit in cases of storage corruption.
Data associated with the memory allocation and utilization of the system memory is collected and displayed in a graphical heat map where storage usage can be visualized. A list of all compile units that have accessed a particular block of storage can be listed, the variable names used by the individual CUs, and the length and value of storage accessed can be graphically displayed. The disclosure herein provides a technique to gather storage usage data and provides a way to visualize the storage usage in a computer operating system application program.
Referring to
In exemplary embodiments, the processing system 100 includes a graphics processing unit 130. Graphics processing unit 130 is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display. In general, graphics processing unit 130 is very efficient at manipulating computer graphics and image processing, and has a highly parallel structure that makes it more effective than general-purpose CPUs for algorithms where processing of large blocks of data is done in parallel.
Thus, as configured in
In an embodiment, an application is launched under the control of a capable application such as a debugger that specifies a new preference indicating storage instrumentation. During processing the code of a selected application will be analyzed by a processor and storage instrumentation processing will overlay hooks on instructions associated with obtaining storage and will also overlay hooks on instructions associated with all statements that alter storage values in the obtained storage upon entry to every compile unit (CU) in the application.
Referring now to
Block 204 provides overlaying statements hooks on the identified instructions and the identified statements. In an embodiment, storage instrumentation processing will overlay hooks on instructions associated with obtaining storage and overlay hooks on instructions associated with all statements that alter storage values in the obtained storage. These hooks are referred to as storage statement hooks.
Block 206 provides responsive to overlaying the storage statement hooks, updating a storage data structure. In one or more embodiments, storage statement hooks are provided for instructions and statements that obtain storage, alter storage, and/or release storage.
In another embodiment, for each storage statement hook on instructions that obtain storage, a node is added to a new storage data structure. In a different embodiment, for each storage statement hook on instructions that alter storage, the node associated with the location of the variable is found in an existing storage data structure. Information including the CU-name, variable name, the address, the length, the value and the statement number within the CU of the variable are stored in the node of the storage data structure. In a different embodiment, for each storage statement hook on instructions that release storage, the storage data structure node associated with the block is searched. Once found the data within the node is translated to a formatted script that is consumable by a user interface (UI). The script data is cumulatively saved to a repository and processed by a processor and UI for displaying the collected information.
Block 208 provides displaying storage usage data as a grid map based on the storage data structure, the grid map comprises blocks associated with a storage location. In one or more embodiments, a graphical heat map is used to convey storage usage information at the address level. In one or more embodiments, upon completion of the execution of the application and the information is collected for each storage data structure and nodes, and the storage usage information is translated into a grid map.
Block 210 provides selecting a block of the grid map for the storage use data. In one or more embodiments, a user can select a block on the grid map to obtain additional information. As will be shown in
Now referring to
In another embodiment, grid map 300 is a heat map which provides a visual representation of the obtained and freed storage used by an application. For each memory block, as the number of compile units of an application that uses data stored in a system memory location represented by a storage block increases, the associated block becomes darker. For example, as provided by the legend, a darker block has been accessed a greater number of times when compared to the other memory blocks. The heat map provides a comprehensive view showing the usage of specific storage blocks for the application during the execution of the application.
Now referring to
Now referring to
The technique described herein provides a granular analysis of each storage location. This technique allows programmers and debuggers to identify inefficiencies in storage processing of an application. Using the gathered information programmers can optimize the programs by altering the code to ensure that programs only reserve as much memory as the program will use.
The present invention may be a system, a method, and/or a computer program product. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention.
The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.