Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src




Sure, try this one:

#pragma D option flowindent

fbt::syscall:entry
/execname == "sleep" && guard++ == 0/
{
        self->traceme = 1;
        printf("fd: %d", arg0);
}

fbt:::
/self->traceme/
{}

fbt::syscall:return
/self->traceme/
{
        self->traceme = 0;
        exit(0);
}

start the script running (e.g. dtrace -l flow.d), then do a sleep 1 in another shell. You should get something like:

CPU FUNCTION
  0  -> syscall                               fd: 3425484104
  0   | syscall:entry
  0    -> sys_mmap
  0      -> pax_aslr
  0      <- pax_aslr
  0      -> uvm_mmap
  0        -> uvm_map
  0          -> vm_map_lock_try
  0          <- vm_map_lock_try
  0          -> uvm_map_findspace
  0            -> uvm_map_lookup_entry
  0            <- uvm_map_lookup_entry
  0            -> uvm_map_space_avail
  0            <- uvm_map_space_avail
  0            -> uvm_map_space_avail
  0            <- uvm_map_space_avail
  0          <- uvm_map_findspace
  0          -> uvm_map_enter
  0            -> pool_cache_get_paddr
  0            <- pool_cache_get_paddr
  0            -> uvm_rb_insert
  0              -> rb_tree_insert_node
  0                -> uvm_map_compare_nodes
  0                <- uvm_map_compare_nodes
  0                -> uvm_map_compare_nodes
  0                <- uvm_map_compare_nodes
  0                -> uvm_map_compare_nodes
  0                <- uvm_map_compare_nodes
  0                -> uvm_map_compare_nodes
  0                <- uvm_map_compare_nodes
  0                -> rb_tree_reparent_nodes
  0                <- rb_tree_reparent_nodes
  0              <- rb_tree_insert_node
  0              -> uvm_rb_fixup
  0              <- uvm_rb_fixup
  0              -> vm_map_unlock
  0              <- uvm_map_enter
  0            <- uvm_map
  0          <- uvm_mmap
  0        <- sys_mmap
  0       | syscall:return
  0      <- syscall

Regards,
Darran.

On 13/03/2010, at 12:11 PM, haad wrote:

On Fri, Mar 12, 2010 at 10:53 PM, Darran Hunt <darran%netbsd.org@localhost> wrote:
Module Name:    src
Committed By:   darran
Date:           Fri Mar 12 21:53:16 UTC 2010

Modified Files:
       src/distrib/sets/lists/modules: mi
       src/external/cddl/osnet/dev/fbt: fbt.c
       src/external/cddl/osnet/dist/uts/common/dtrace: dtrace.c
       src/sys/modules/dtrace: Makefile
       src/sys/sys: module.h
Added Files:
       src/sys/modules/dtrace/fbt: Makefile

Log Message:
DTrace: Add the Function Boundary Trace (FBT) provider moduile.  This
module  instruments every function in the kernel with entry and exit
probes.  These probes are true zero-effect probes in that they don't
exist in the code until they are enabled.  The probes are enabled by
directly patching the function entry and exit points to make jumps into
the dtrace framework.
This gives us over 29,000 trace points in the kernel.



Nice do you have any example how this can be used :) ?

To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/dev/fbt/fbt.c
cvs rdiff -u -r1.8 -r1.9 \
   src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/dtrace/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/dtrace/fbt/Makefile
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/module.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.





--


Regards.

Adam



Home | Main Index | Thread Index | Old Index