OS Module 1
OS Module 1
Debugging is the activity of finding and fixing errors or bugs in a system (In both hardware and
software).
Performance problems are considered as BUGS. So, debugging will also include:
Performance Tuning, which seeks to improve by removing Bottlenecks in the processing taking place
within a system.
FAILURE ANALYSIS:
If a process fails, most operating systems write the error information to a log file to alert system
operators or users that the problem occurred.
The operating system can also take a capture of the memory, also referred to as the "core dump" of the
process.
This core image is stored in a file for later analysis.
Running programs and core dumps can be probed by a tool designed to allow a programmer to explore the
code and memory a process.
A kernel failure is called as a CRASH. So if any process failure, then the information is stored in log file and
the memory state is saved to CRASH DUMP.
Operating system debugging frequently uses different tools and techniques than process debugging due to the
very different nature of these two tasks.
Consider that a kernel failure in the file-system code would make it risky for the kernel to try to save its state
to a file on the file system before rebooting.
A common technique is to save the kernel's memory state to a section of disk set aside for this purpose that
contains no file system.
If the kernel detects an unrecoverable error, it writes the entire contents of memory, or at least the kernel-
owned parts of the system memory, to the disk area.
When the system reboots, a process runs to gather the data from that area and write it to a crash dump file
within a file system for analysis.
PERFORMANCE TUNING:
For this purpose, code must be added to display the measures of system behavior which is done with the help of
TRACE LISTINGS of system behavior.
Where,
Trace Listing is all interesting events logged with their time and important parameters and are written to a
file.
Then, an Analysis program can process the log file to determine system performance and to identify
bottlenecks and inefficiencies.
Traces also can help people to find errors in operating-system behavior.
KERNIGHAN’S LAW:
"Debugging is twice as hard as writing the code in the first place. Therefore if you write the code as cleverly as
possible, you are, by definition, not smart enough to debug it."
Interactive Tools must be involved to monitor state of various components of the system to look for bottlenecks.
Other tools display the state of disk I/0, memory allocation, and network traffic.
The Solaris 10 DTrace dynamic tracing facility is a leading example of kernel-enabled performance analysis
Tools.