xref: /netbsd-src/external/cddl/dtracetoolkit/dist/Docs/Examples/rb_funccalls_example.txt (revision c29d51755812ace2e87aeefdb06cb2b4dac7087a)
1This is a list of examples of the usage of rb_funccalls.d.
2
3It reports method calls from all Ruby programs on the system that are
4running with Ruby provider support.
5
6Here we run it while the program Code/Ruby/func_abc.rb is executing.
7
8# rb_funccalls.d
9Tracing... Hit Ctrl-C to end.
10^C
11 FILE                             CLASS            METHOD              CALLS
12 func_abc.rb                      Object           func_a                  1
13 func_abc.rb                      Object           func_b                  1
14 func_abc.rb                      Object           func_c                  1
15 func_abc.rb                      IO               write                   3
16 func_abc.rb                      Module           method_added            3
17 func_abc.rb                      Object           print                   3
18 func_abc.rb                      Object           sleep                   3
19
20We can see that during that one Ruby program, Our 3 user-defined methods,
21func_a, func_b and func_c are called once each.  Amongst other calls we can
22see that a method from class IO - write, was called three times; probably by
23the print method.  If you look at the example program Code/Ruby/func_abc.rb,
24you can see that 'print' is used three times, but IO::write is never directly
25called.
26