SBG Study Advance OS Unit 2
SBG Study Advance OS Unit 2
DTrace:
DTrace (DTrace.exe) is a command-line tool that displays system information and events.
DTrace is an open-source tracing platform ported to windows. It provides dynamic
instrumentation of both user/kernel functions.
systrace:
systrace is the primary tool for analyzing Android device performance. However, it's really a
wrapper around other tools. It's the host-side wrapper around atrace, the device-side executable
that controls userspace tracing and sets up ftrace, and the primary tracing mechanism in the
Linux kernel. systrace uses atrace to enable tracing, then reads the ftrace buffer and wraps it all
in a self-contained HTML viewer.
systrace helps you analyze how the execution of your application fits into the larger Android
environment, letting you see system and applications process execution on a common timeline.
The tool allows you to generate highly detailed, interactive reports from devices running Android
4.1 or higher
Kprobes:
Probes is a debugging mechanism for the Linux kernel which can also be used for monitoring
events inside a production system. You can use it to weed out performance bottlenecks, log
specific events, trace problems etc.
Kprobes enables you to dynamically break into any kernel routine and collect debugging and
performance information non-disruptively. A kprobe can be inserted on virtually any instruction
in the kernel. A return probe fires when a specified function returns.
Solaris provides Read-Write lock to protect the data are frequently accessed by long section of
code usually in read-only manner.
It uses turnstiles to order the list of threads waiting to acquire either an adaptive mutex or
read-writer lock. Turnstile is a queue structure containing threads blocked on a lock. They are
per lock holding thread, not per object. Turnstiles are organized according to priority-
inheritance which gives the running thread the highest of the priorities of the threads in its
turnstiles to prevent priority inversion.
Locking mechanisms are used by kernel is also used by user-level threads, so that the locks are
available both inside and outside of the kernel. The difference is only that priority-inheritance in
only used in kernel, user-level thread does not provide this functionality.
If a user-level task requests I/O, the associated LWP and kernel-level threads will also be
blocked.
Advantages:
Pre-emptive Kernels:
A computer system operates in two modes: kernel mode and user mode. Kernel mode is a
more privileged mode than the user mode. In kernel mode, the programs can directly access
the memory and hardware resources while in user mode, the program cannot directly access
memory and hardware resources.
Pre-emptive Kernel is a kernel that allows interrupting a program in the middle of the
executing. In other words, the kernel is capable of stopping the execution of the currently
running process and allowing some other process to execute. As pre-emptive kernel does not
allow the processor to run a process for a long time continuously, this type of kernel is more
secure. e.g., Windows XP, 2000, Solaris and IRIX.
Advantage:
A pre-emptive kernel is more suitable for real-time programming, as it will allow a real-time
process to pre-empt a process currently running in the kernel. Furthermore, a pre-emptive
kernel may be more responsive, since there is less risk that a kernel-mode process will run for
an arbitrarily long period before relinquishing the processor to waiting processes.