Skip to content

Commit 85f2ceb

Browse files
committed
Create a definition for a probe specifier and a probe definition.
1 parent e3e0377 commit 85f2ceb

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

specification/chap-opendtrace-dlang.tex

+28-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ \section{Language grammar}
5555
\alt `0x' <HexDigit>
5656
\end{grammar}
5757

58+
% XXX: Is this sufficient for a <Identifier>
5859
\begin{grammar}
5960
<Identifier> ::= <Word> \{ ( <DecDigitWithZero> | <Word> ) \} ;
6061

@@ -102,7 +103,6 @@ \section{Language grammar}
102103
tracing the kernel, but also allows trivial translation to other ABIs. We
103104
specify \texttt{StructOrUnionSpec} as follows:
104105

105-
% FIXME: SturctOrUnionSpec should include things like typedef and so on
106106
\begin{grammar}
107107
<StructOrUnionSpec> ::= <Modifier> ( `struct' | `union' ) [ <Identifier> ] \newline
108108
`{' <StructDeclList> `}' [ <VarList> ] `;'
@@ -122,6 +122,7 @@ \section{Language grammar}
122122
modifiers that may occur before a \texttt{struct} or \texttt{enum} definition.
123123
It is defined as follows:
124124

125+
% XXX: Verify that this is correct
125126
\begin{grammar}
126127
<Modifier> ::= `const'
127128
\alt `volatile'
@@ -140,6 +141,32 @@ \section{Language grammar}
140141
treat misuse of a modifier as an error. Using these modifiers when not
141142
applicable is considered undefined behaviour. \newline
142143

144+
\noindent
145+
Since D is a domain-specific language for tracing and provides probes in the
146+
kenrel, we define the following way of specifying probes:
147+
148+
% TODO: Make this render a bit nicer.
149+
% XXX: Is this correct?
150+
\begin{grammar}
151+
<ProbeSpecifier> ::= <Identifier>
152+
\alt [ <Identifier> ] `:' [ <Identifier> ]
153+
\alt [ <Identifier> ] `:' [ <Identifier> ] `:' [ <Identifier> ]
154+
\alt [ <Identifier> ] `:' [ <Identifier> ] `:'
155+
[ <Identifier> ] `:' [ <Identifier> ]
156+
\end{grammar}
157+
158+
\noindent
159+
This provides us with a way to specify the \texttt{provider}, \texttt{module},
160+
\texttt{function} and \texttt{name} of a DTrace probe in D.
161+
162+
% TODO: Define <Predicate> and <Statements>
163+
\begin{grammar}
164+
<ProbeDefinition> ::= <ProbeSpecifier> [ <Predicate> ] `{' { <Statement> } `}'
165+
\end{grammar}
166+
167+
% TODO: Define all different types of expressions that we can have, assignment
168+
% operators, conditionals, ...
169+
143170
\section{Safety}
144171
\label{sec:safety}
145172

0 commit comments

Comments
 (0)