1 **************************************************************************
2 * Notes for all scripts that print a function or method flow.
4 * $Id: ALLflow_notes.txt 44 2007-09-17 07:47:20Z brendan $
6 * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
7 **************************************************************************
12 Output that has some meaningful indent, such as function flow indented by
16 C TIME(us) FILE -- SUB
17 0 2963130861619 func_abc.pl -> func_a
18 0 2963131870998 func_abc.pl -> func_b
19 0 2963132871121 func_abc.pl -> func_c
20 0 2963133881150 func_abc.pl <- func_c
21 0 2963133881166 func_abc.pl <- func_b
22 0 2963133881174 func_abc.pl <- func_a
26 * The output looks shuffled?
31 C TIME(us) FILE -- SUB
32 0 2963130861619 func_abc.pl -> func_a
33 0 2963131870998 func_abc.pl -> func_b
34 0 2963132871121 func_abc.pl -> func_c
35 0 2963133881166 func_abc.pl <- func_b
36 0 2963133881174 func_abc.pl <- func_a
37 1 2963133881150 func_abc.pl <- func_c
40 Yes, this is shuffled. DTrace has been designed with a number of important
41 goals in mind - including minimising the enabled performance overhead. To do
42 this, per-CPU kernel buffers have been used to collect output, which are
43 (currently) dumped in sequence by /usr/sbin/dtrace whenever it wakes
44 up ("switchrate" tunable). So, on multi-CPU servers, there is always the
45 possibility that any DTrace script can print out-of-order data.
47 To deal with this behaviour, the flow scripts may,
49 - print a "C" CPU column. If this changes from one line to the next then
50 the output is probably shuffled around that point. This is why the "C"
51 column appears in these flow scripts.
52 - print a "TIME(us)" column. You can eyeball this for shuffles, or just
53 post sort the dtrace output.
55 Now have a closer look at the pl_flow.d output above. The change in C
56 indicates that a shuffle may have happened, and the out-of-order TIME(us)
57 shows that it did happen.
59 It is possible that DTrace will be enhanced to always sort output before
60 printing, and this behaviour is no longer an issue.
62 See "The output seems shuffled?" in Notes/ALLsnoop_notes.txt for more
63 notes on this behaviour.