xref: /netbsd-src/external/cddl/dtracetoolkit/dist/Docs/Examples/js_flow_example.txt (revision c29d51755812ace2e87aeefdb06cb2b4dac7087a)
1*c29d5175SchristosThe following are examples of js_flow.d.
2*c29d5175Schristos
3*c29d5175SchristosThis is a simple script to trace the flow of JavaScript functions.
4*c29d5175SchristosHere it traces the example program, Code/JavaScript/func_clock.html
5*c29d5175Schristos
6*c29d5175Schristos# js_flow.d
7*c29d5175Schristos  C TIME(us)         FILE                   -- FUNC
8*c29d5175Schristos  0 3650471830941    func_clock.html        -> start
9*c29d5175Schristos  0 3650471831005    func_clock.html          -> getElementById
10*c29d5175Schristos  0 3650471831058    func_clock.html          <- getElementById
11*c29d5175Schristos  0 3650471831890    func_clock.html          -> func_a
12*c29d5175Schristos  0 3650471831906    func_clock.html            -> getElementById
13*c29d5175Schristos  0 3650471831929    func_clock.html            <- getElementById
14*c29d5175Schristos  0 3650471850084    func_clock.html            -> func_b
15*c29d5175Schristos  0 3650471850111    func_clock.html              -> getElementById
16*c29d5175Schristos  0 3650471850146    func_clock.html              <- getElementById
17*c29d5175Schristos  0 3650471886534    func_clock.html              -> func_c
18*c29d5175Schristos  0 3650471886573    func_clock.html                -> getElementById
19*c29d5175Schristos  0 3650471886624    func_clock.html                <- getElementById
20*c29d5175Schristos  0 3650471942212    func_clock.html              <- func_c
21*c29d5175Schristos  0 3650471942231    func_clock.html            <- func_b
22*c29d5175Schristos  0 3650471942242    func_clock.html          <- func_a
23*c29d5175Schristos  0 3650471942300    func_clock.html          -> setTimeout
24*c29d5175Schristos  0 3650471942392    func_clock.html          <- setTimeout
25*c29d5175Schristos  0 3650471942404    func_clock.html        <- start
26*c29d5175Schristos^C
27*c29d5175Schristos
28*c29d5175SchristosThe fourth column is indented by 2 spaces to show when a new function begins.
29*c29d5175SchristosThis shows which function is calling which - the output above shows that
30*c29d5175Schristosfunc_a called func_b, which in turn called func_c.
31*c29d5175Schristos
32*c29d5175SchristosThe TIME(us) column shows time from boot in microseconds.
33*c29d5175Schristos
34*c29d5175SchristosThe FILE column shows the file that was being executed.
35*c29d5175Schristos
36*c29d5175SchristosIf the output looks strange, check the CPU "C" column - if it changes,
37*c29d5175Schristosthen the output is probably shuffled. See Notes/ALLsnoop_notes.txt for
38*c29d5175Schristosdetails and suggested workarounds.
39*c29d5175Schristos
40*c29d5175SchristosSee Notes/ALLflow_notes.txt for important notes about reading flow outputs.
41*c29d5175Schristos
42