Information Technology Reference
In-Depth Information
.
/* critical section code */
.
.
mutex_unlock(&list_mutex);
system state). There are some drawbacks to this
approach, however, including:
The solution is not portable because it
depends on Solaris features that are not
available on other operating systems.
TNF_PROBE_1(critical_end, «critical section end»,
«mutex release»,
tnf_opaque, list_lock, &list_mutex)
It requires a considerable amount of devel-
opment effort because thread libraries must
be modified.
These probes can be selectively activated dy-
namically at run time. Events are recorded each
time a probe is executed. Each probe automatically
records thread-specific information, such as the
thread identifier, but it may also record other data
related to the state of the application at the time
the event was triggered. Event records are written
to a binary file that is subsequently parsed and
analyzed by an offline process. The Solaris kernel
also contains a number of TNF probes that can
record kernel activity, such as system calls, I/O
operations, and thread state change. These probes
can be enabled/disabled using a command-line
utility known as prex (Murayama, 2001). Data
records from the probes are accumulated within a
contiguous portion of the kernel's virtual address
space and cannot be viewed directly. Another
utility that runs with administrator privileges can
be used to extract the data and write it to a user
file. This data can then be correlated with other
user-level data to provide a clear understanding
of the behavior of the application run.
The probe-based technique described above
provides a detailed view of the running state of
the application. Behavioral data details call counts,
timing information, and resource use (thread and
Applications must be separately built and
linked for profiling.
Tools that are used to collect the data like
TNF or kstat may require lengthy setup
and configuration.
microsoft windows performance
counters
Other operating systems have comparable
probe-based features that can be used to
get comparable data-defining application
behavior. For example, Microsoft Windows
provides performance counters (Microsoft,
2007a) that contain data associated to the
running system. Windows provides a con-
sole that can be used to select certain spe-
cific counters related to specific processes.
Once selected, the values of these counters
will be displayed on the console at regular
intervals. Table 5 shows example counters
that are available.
Windows stores the collected values in the
r e g i is t r y, w h i c h i is r e f r e is h e d p e r i o d i c a l l y. D e v e l o p -
ers typically retrieve the data from the registry
Table 5. Performance counters provided by the Windows Operating System
Category
Description
Sample Counters
Process
Provides data related to each process
% Processor Time, % User Time, IO activity, Page Faults etc.
Processor
Provides information about the overall machine
% Processor time, % User Time, %Idle Time etc.
Memory
Provide data related to the memory of the system
Available Bytes, #Page Faults/sec, #Page Reads/sec etc.
Threads
Provides data on the threads in the system
# of Context Switches/sec, Thread State, Thread Wait Reason etc.
Search WWH ::




Custom Search