Skip to content

Commit ff4e164

Browse files
authored
Merge pull request #22 from gcjenkinson/master
Minor updates typos, formatting and errors.
2 parents a89b72b + 79f8247 commit ff4e164

6 files changed

+37
-38
lines changed

specification/chap-intro.tex

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
OpenDTrace is a dynamic tracing facility integrated into the Solaris,
2-
FreeBSD, and macOS operating systems -- with ports also available for
2+
FreeBSD, and macOS operating systems\textemdash with ports also available for
33
Linux and Windows. Dynamic tracing allows system administrators and
44
software developers to develop short scripts (in the D programming
55
language) that instruct OpenDTrace to instrument aspects of system
@@ -8,7 +8,7 @@
88
available for the D programming language, command-line tools, and
99
OpenDTrace-based investigation and operation, the internal formats to
1010
OpenDTrace are generally documented via the source code. This report
11-
acts as a de facto specification for those formats, including the
11+
acts as a \textit{de facto} specification for those formats, including the
1212
DTrace Intermediate Format (DIF), which is a bytecode that D scripts
1313
are compiled into for safe execution within the kernel, and the DTrace
1414
Object Format (DOF), which bundles together complete scripts along
@@ -20,15 +20,15 @@ \section{Background}
2020
The original DTrace code was designed and developed by Sun
2121
Microsystems to solve a particular problem, being able to instrument
2222
systems that were currently deployed, without requiring the
23-
recompilation of any code\cite{DTrace2004}. The DTrace system was
23+
recompilation of any code \cite{DTrace2004}. The DTrace system was
2424
written in a portable style typical of code from the Sun Microsystems
2525
Kernel Development group in the early 2000s. Shortly after the
2626
release of the original DTrace system a port was made, by John Birrel,
2727
to the FreeBSD Operating System. A port was also made by Apple to
2828
their macOS at about the same time. DTrace gained popularity as a
2929
dynamic tracing system throughout the first decade of the 21st Century
3030
and its usage is well
31-
documented\cite{mckusick2014design}\cite{Microsystems2008a}\cite{Gregg:2011:DDT:1971960}.
31+
documented \cite{mckusick2014design}\cite{Microsystems2008a}\cite{Gregg:2011:DDT:1971960}.
3232

3333
The OpenDTrace system is meant to capture information about systems at
3434
run time, without the need to stop the program or kernel being
@@ -47,14 +47,14 @@ \section{Background}
4747
of module X?'', is a typical query that might be made of a debugger.
4848
The answer to this question is gathered by setting a break point at
4949
line 100, where the program will stop, and printing the value of the
50-
varialbe \emph{A}. Debuggers are most often used in a \emph{stop and
50+
variable \emph{A}. Debuggers are most often used in a \emph{stop and
5151
inquire} mode, while a tracing system, such as OpenDTrace, aims to
52-
keep overheads low enogh that we can capture and analyze information
52+
keep overheads low enough that we can capture and analyze information
5353
at run time with very little perturbation to the overall system. The
5454
tracing system \emph{only} captures data at run time and \emph{never}
5555
stops the running system, which has the side effect of being quite
5656
useful for critical systems such as the operating system kernel and
57-
its components, such as device drivers, locking primitves and
57+
its components, such as device drivers, locking primitives and
5858
scheduler.
5959

6060
From the perspective of the user the OpenDTrace model is one of

specification/chap-opendtrace-ctf.tex

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ \section{On-Disk Format}
1515
CTF data is stored in its own ELF section within an object file or
1616
executable. It is meant to be stored in a format that is both compact
1717
and which is properly aligned so that it can be accessed using the
18-
mmap(2) system call.
18+
\texttt{mmap} (2) system call.
1919

2020
\begin{figure}[h]
2121
\centering
@@ -71,7 +71,7 @@ \section{On-Disk Format}
7171
\verb|CTF_K_UNKNOWN| & unknown type (used for padding) \\
7272
\verb|CTF_K_INTEGER| & variant data is \verb|CTF_INT_DATA()| (see below)\\
7373
\verb|CTF_K_FLOAT| & variant data is \verb|CTF_FP_DATA()| (see below)\\
74-
\verb|CTF_K_POINTER| & \verb|ctt_type| is referenced type\\
74+
\verb|CTF_K_POINTER| & \verb|ctf_type| is referenced type\\
7575
\verb|CTF_K_ARRAY| & variant data is single \verb|ctf_array_t|\\
7676
\verb|CTF_K_FUNCTION| & \verb|ctt_type| is return type\\
7777
& variant data is list of argument types\\
@@ -80,17 +80,17 @@ \section{On-Disk Format}
8080
\verb|CTF_K_UNION| & variant data is list of \verb|ctf_member_t|'s\\
8181
\verb|CTF_K_ENUM| & variant data is list of \verb|ctf_enum_t|'s\\
8282
\verb|CTF_K_FORWARD| & no additional data; \verb|ctt_name| is tag\\
83-
\verb|CTF_K_TYPEDEF| & \verb|ctt_type| is referenced type\\
84-
\verb|CTF_K_VOLATILE| & \verb|ctt_type| is base type\\
85-
\verb|CTF_K_CONST| & \verb|ctt_type| is base type\\
86-
\verb|CTF_K_RESTRICT| & \verb|ctt_type| is base type\\
83+
\verb|CTF_K_TYPEDEF| & \verb|ctf_type| is referenced type\\
84+
\verb|CTF_K_VOLATILE| & \verb|ctf_type| is base type\\
85+
\verb|CTF_K_CONST| & \verb|ctf_type| is base type\\
86+
\verb|CTF_K_RESTRICT| & \verb|ctf_type| is base type\\
8787
\hline
8888
\end{tabular}
8989
\caption{Kinds of CTF Base Types}
9090
\label{tbl:ctf-kinds}
9191
\end{table}
9292

93-
Table\ref{tbl:ctf-kinds} lists the kinds of base data types that are
93+
Table~\ref{tbl:ctf-kinds} lists the kinds of base data types that are
9494
encoded by CTF. Complex data types, such as structures, are also
9595
contained in the \verb|types| section, and are encoded as a structure
9696
with a name that references the string table.
@@ -175,7 +175,7 @@ \section{On-Disk Format}
175175

176176
The \verb|flags| field indicates whether the integer is signed,
177177
contains character data, is a boolean or is to be displayed
178-
with a varags style of formatting.
178+
with a vargs style of formatting.
179179

180180
Floating point numbers have the exact same fields to describe them
181181
but a larger number of possible flags, to match the larger

specification/chap-opendtrace-dlang.tex

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ \section{Safety}
1616
\label{sec:safety}
1717

1818
The D language will look familiar to anyone who has programmed in C or
19-
its close linguistice relatives, but in order to provide certain
19+
its close linguistic relatives, but in order to provide certain
2020
safety guarantees there are features of C like languages that are
2121
missing from D. The most obviously missing feature is the lack of any
2222
sort of looping mechanism. Once they are compiled into byte code D
@@ -27,8 +27,8 @@ \section{Safety}
2727
occurring.
2828

2929
By default, OpenDTrace runs in a mode where memory can be read but not
30-
written by D language scripts. A command line option to the dtrace(1)
31-
program, -w, puts OpenDTrace into destructive mode, where both reads
30+
written by D language scripts. A command line option to the \texttt{dtrace} (1)
31+
program, \texttt{-w}, puts OpenDTrace into destructive mode, where both reads
3232
and writes are possible. Although destructive mode is not a feaure of
3333
the D language itself, it is an important part of the system's overall
3434
commitment to safety.
@@ -125,10 +125,10 @@ \subsection{Global variables}
125125
\noindent
126126
Because DIF performs all of its operations on a virtual machine's
127127
registers as opposed to variables in memory, the ++ operator is not
128-
atomic. Compiling the syscall:::entry clause from
128+
atomic. Compiling the \texttt{syscall:::entry} clause from
129129
Figure~\ref{fig:global-var-usage} generates the DIF shown in
130130
Figure~\ref{fig:dif-asm}. This DIF section is safe, as long as the
131-
num\_syscalls variable is not visible from any other thread. If it is
131+
\texttt{num\_syscalls} variable is not visible from any other thread. If it is
132132
visible and accessible from another thread, it suffers from a race
133133
condition which results in wrong information being given to the
134134
user. The race condition is shown in Figure~\ref{fig:race}. \newline
@@ -203,7 +203,7 @@ \section{Aggregations}
203203

204204
The ability to aggregate data during data collection, and to then
205205
process the data via several types of statistical analysis, is one of
206-
the key features of OpenDTrace. The data for an aggretation is
206+
the key features of OpenDTrace. The data for an aggregation is
207207
collected, like all other trace data, by the kernel, while the data
208208
processing is carried out in user space by the \emph{libdtrace}
209209
library functions.
@@ -228,7 +228,7 @@ \section{Aggregations}
228228
\end{table}
229229

230230
There are nine (9) aggregation functions, which are listed in
231-
Table~\ref{}.
231+
Table~\ref{tab:agg-func}.
232232

233233
\section{Subroutines}
234234
\label{sec:subroutines}

specification/chap-opendtrace-intermediate-format.tex

+8-8
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ \subsection{Comparison and Test Instructions}
6767
DIF has three instructions, \instruction{cmp}, \instruction{scmp} and
6868
\instruction{tst} which can set various result flags, shown in
6969
Table~\ref{tbl:cmp-vars}. The result flags are are later used by the
70-
branch instructions to determine how to . The result flags are never
71-
returned directly to the calling DIF program but are only used
72-
internally by the interpretation routine.
70+
branch instructions to determine whether or not the branch is taken.
71+
The result flags are never returned directly to the calling DIF program but are
72+
only used internally by the interpretation routine.
7373

7474
\textbf{XXXRW: Something about instructions}
7575

@@ -95,9 +95,9 @@ \subsection{Subroutine Calls}
9595
through use of the \instruction{PUSHTR} and \instruction{PUSHTV}
9696
instructions. The return values of the subroutines are provided
9797
through the \registerop{rd} register. The subroutine identifier is
98-
placed in the \registerop{idx} field of the W-Format described in
99-
Subsection~\ref{subsec:w-format}. Any subroutine that is provided to
100-
DTrace \emph{must} go via these mechanisms.
98+
placed in the \registerop{idx} field of the wide-immediate format (W-Format)
99+
described in Subsection~\ref{subsec:w-format}. Any subroutine that is provided
100+
to DTrace \emph{must} go via these mechanisms.
101101

102102
\begin{quote}
103103
Notice that we don't bother validating the proper number of
@@ -155,8 +155,8 @@ \subsection{Global Variables}
155155
to simple names within the D script. Space for global variables is statically
156156
allocated on each invocation of a script. Additionally, global variables are
157157
identified using the modified register format as described in
158-
Subsection~\ref{subsec:r-format} the case of arrays and the wide-immediate
159-
format which is described in Subsection~\ref{subsec:w-format} in the case
158+
Subsection~\ref{subsec:r-format} the case of arrays and the W-Format
159+
which is described in Subsection~\ref{subsec:w-format} in the case
160160
of scalar variables inside of the \function{dtrace_dif_variable} function.
161161

162162
\subsubsection{Dynamic Variables}

specification/chap-opendtrace-object-format.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ \subsection{Stable Storage Format}
5353
sections associated with this DIFO.
5454

5555
This loose coupling of the file structure (header and sections) to the
56-
structure of the DTrace program itself (enebled code block
56+
structure of the DTrace program itself (enabling control block
5757
descriptions, action descriptions, and DIFOs) permits activities such
5858
as relocation processing to occur in a single pass without having to
5959
understand D program structure.

specification/chap-opendtrace-operation.tex

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,27 @@
1818
The kernel module is also the intermediary between the DTrace user
1919
interface and the providers. When compiling user scripts, the kernel
2020
module provides the D compiler with probe arguments and types. Once
21-
compiled, scripts are pushed into the kernel as Enabling Code Blocks
21+
compiled, scripts are pushed into the kernel as Enabling Control Blocks
2222
(ECBs) to be executed when probes fire. After each ECB is executed,
2323
the data is handed back to user space where the \texttt{dtrace}
24-
command line tool, or other programs linked against the OpenDtrace
24+
command line tool, or other programs linked against the OpenDTrace
2525
libraries can manipulate or display the data to end users.
2626

2727
Providers in OpenDTrace encapsulate the probe points that are used to
2828
instrument code and provide data to the end user. A provider defines
2929
both a set of probe points as well as the standard by which the system
3030
interacts with that set of probe points. For example the Function
31-
Boundary Tracepoint (fbt) provider defines \texttt{return} trace
31+
Boundary Tracepoint (\texttt{fbt}) provider defines \texttt{return} trace
3232
points in which only arguments zero ($0$) and one ($1$) are valid and
3333
which always contain the return value and return address
3434
respectively, whereas no other provider has such a definition.
3535

3636
OpenDTrace has a base set of providers that are shipped as part of the
37-
system, see Appendix~\ref{chap:opendtrace-providers}, but developers are free
38-
to
37+
system, see Appendix~\ref{chap:opendtrace-providers}, but developers are free to
3938
create their own, to expose more or different information from their
4039
code. Providers can be developed either for the kernel, in which case
4140
they are defined as kernel modules, or for user space, as part of the
42-
User Defined Static Tracing (USDT) system.
41+
Userland Statically Defined Tracing (USDT) system.
4342

4443
A provider is simply a collection of probe points. Probe points are
4544
functions that are run when certain points in the code are
@@ -105,7 +104,7 @@ \section{Probe Life Cycle}
105104
If the script did not supply any type information, the compilation
106105
will complete and any mismatch will result in a runtime error.
107106

108-
The result of the D script compilation is a set of Enabling Code Blocks
107+
The result of the D script compilation is a set of Enabling Control Blocks
109108
(ECB)s. An ECB is created for each enabling, or probe point, as well
110109
as for each action statement in a D language clause.
111110
The ECBs are provided to the kernel module (3c) which stores them,

0 commit comments

Comments
 (0)