[erlang-questions] Questions about seq_trace
Michael Turner
michael.eugene.turner@REDACTED
Sat Jun 4 18:11:42 CEST 2011
seq_trace looks useful, but I'm a little confused by the documentation.
"The trace token contains a component which is called serial. It consists
of two integers Previous and Current. The purpose is to uniquely identify
each traced event within a trace sequence and to order the messages
chronologically and in the different branches if any."
The term "branch" is left undefined. It's not really clear how Previous and
Current uniquely identify events. Do you need both, to uniquely identify
events? Previous *what*? Current *what*?
Dangling reference:
"A trace token contains a label, and a set of flags. Both the label and
the flags are set in 1 and 2 above."
There's no "1 and 2 above". There are two bulleted lines just after "The
current token of a process is set in two ways, either ...." Are those the
referents of "1" and "2"?
Ambiguous:
"Let the serial of the trace token be tprev and tcurr.
curr_cnt := curr_cnt + 1
tprev := prev_cnt
tcurr := curr_cnt
The trace token with tprev and tcurr is then passed along with the
message."
I take it the "Let" means something like "define" and not "assign". Does
this mean that prev_cnt doesn't get updated by a Send?
If these are counts, one a Previous count, the other a Current count, what
exactly is it that's being counted? Current seems to be the number of traces
sent to the tracer process from the process in question. But this seems
contradicted later.
"The curr_cnt of a process is incremented each time the process is
involved in a sequential trace."
What does it mean for a process to be "involved in a sequential trace"? Is
that when a message gets sent to the tracer process?
Ambiguous and/or contradictory: in "When a message is received and contains
a nonempty trace token":
"The process trace token is set to the trace token from the message.
Let the serial of the trace token be tprev and tcurr.
if (curr_cnt < tcurr )
curr_cnt := tcurr
prev_cnt := tcurr"
Does this mean that the process trace token is set to the trace token from
the message, *except* for a Serial, {prev_cnt, curr_cnt}?
I'm really having trouble following this. Earlier, before "What is
Sequential Tracing", there's this explanation:
"Serial is a tuple {PreviousSerial, ThisSerial}, where the first integer
PreviousSerial denotes the serial counter passed in the last received
message which carried a trace token."
"The serial counter"? But there are *two* serial counters being passed in
each Serial, right?
"If the process is the first one in a new sequential trace,
PreviousSerial is set to the value of the process internal "trace clock".
The second integer ThisSerial is the serial counter that a process sets on
outgoing messages and it is based on the process internal "trace clock"
which is incremented by one before it is attached to the trace token in the
message."
But this just introduces a new undefined term, "trace clock". Is that "trace
clock" the same as "curr_cnt"? Does "trace clock" mean something more like
"trace count"? Does the "sets" in "the serial counter that a process sets on
outgoing message" mean "initialize" or "puts"? Does "it is based on the
process internal clock" mean that it has the same value as that internal
clock, or is it derived from it, and if so, how?
I'm starting to play around with seq_trace, maybe it will become clearer in
the process.
-michael turner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110605/15bf42cb/attachment.htm>
More information about the erlang-questions
mailing list