xref: /freebsd/cddl/usr.sbin/dwatch/examples/profile_template (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1*5bf5ca77SDevin Teske# -*- tab-width: 4 -*- ;; Emacs
2*5bf5ca77SDevin Teske# vi: set filetype=sh tabstop=8 shiftwidth=8 noexpandtab :: Vi/ViM
3*5bf5ca77SDevin Teske############################################################ IDENT(1)
4*5bf5ca77SDevin Teske#
5*5bf5ca77SDevin Teske# $Title: dwatch(8) profile for XXX entry $
6*5bf5ca77SDevin Teske# $Copyright: 2014-2018 Devin Teske. All rights reserved. $
7*5bf5ca77SDevin Teske#
8*5bf5ca77SDevin Teske############################################################ DESCRIPTION
9*5bf5ca77SDevin Teske#
10*5bf5ca77SDevin Teske# XXX
11*5bf5ca77SDevin Teske#
12*5bf5ca77SDevin Teske############################################################ PRAGMAS
13*5bf5ca77SDevin Teske
14*5bf5ca77SDevin Teske# Optional: You can override the default pragmas (shown below)
15*5bf5ca77SDevin Teske
16*5bf5ca77SDevin Teske#DTRACE_PRAGMA="
17*5bf5ca77SDevin Teske#	option quiet
18*5bf5ca77SDevin Teske#	option dynvarsize=16m
19*5bf5ca77SDevin Teske#	switchrate=10hz
20*5bf5ca77SDevin Teske#" # END-QUOTE
21*5bf5ca77SDevin Teske
22*5bf5ca77SDevin Teske############################################################ PROBE
23*5bf5ca77SDevin Teske
24*5bf5ca77SDevin Teske# Optional: dwatch(8) initializes this to the expanded probe arguments
25*5bf5ca77SDevin Teske
26*5bf5ca77SDevin Teske#: ${PROBE:="XXX"}
27*5bf5ca77SDevin Teske
28*5bf5ca77SDevin Teske############################################################ ACTIONS
29*5bf5ca77SDevin Teske
30*5bf5ca77SDevin Teske# Optional actions to be performed before hitting the final print action
31*5bf5ca77SDevin Teske
32*5bf5ca77SDevin Teske#exec 9<<EOF
33*5bf5ca77SDevin Teske#EOF
34*5bf5ca77SDevin Teske#ACTIONS=$( cat <&9 )
35*5bf5ca77SDevin Teske#ID=
36*5bf5ca77SDevin Teske
37*5bf5ca77SDevin Teske############################################################ EVENT ACTION
38*5bf5ca77SDevin Teske
39*5bf5ca77SDevin Teske# The default EVENT value is simply `entry'. This is paired with $PROBE.
40*5bf5ca77SDevin Teske
41*5bf5ca77SDevin Teske#EVENT=
42*5bf5ca77SDevin Teske
43*5bf5ca77SDevin Teske# Optional predicate which must be true before the event action will run
44*5bf5ca77SDevin Teske
45*5bf5ca77SDevin Teske#EVENT_TEST=
46*5bf5ca77SDevin Teske
47*5bf5ca77SDevin Teske############################################################ EVENT TAG
48*5bf5ca77SDevin Teske
49*5bf5ca77SDevin Teske# The EVENT_TAG is run inside the print action after the timestamp has been
50*5bf5ca77SDevin Teske# printed. By default, `UID.GID CMD[PID]: ' of the process is printed.
51*5bf5ca77SDevin Teske
52*5bf5ca77SDevin Teske#exec 9<<EOF
53*5bf5ca77SDevin Teske#EOF
54*5bf5ca77SDevin Teske#EVENT_TAG=$( cat <&9 )
55*5bf5ca77SDevin Teske
56*5bf5ca77SDevin Teske############################################################ EVENT DETAILS
57*5bf5ca77SDevin Teske
58*5bf5ca77SDevin Teske# The DETAILS are run after the EVENT_TAG and by default, the program name and
59*5bf5ca77SDevin Teske# arguments of the process hitting the EVENT action are shown. This can be
60*5bf5ca77SDevin Teske# customized to call-specific information because the `-v' flag of dwatch(8)
61*5bf5ca77SDevin Teske# can provide detailed process information for the EVENT action on lines below
62*5bf5ca77SDevin Teske# the DETAILS.
63*5bf5ca77SDevin Teske#
64*5bf5ca77SDevin Teske# NB: Should produce a single-line and not print a trailing newline.
65*5bf5ca77SDevin Teske
66*5bf5ca77SDevin Teske#exec 9<<EOF
67*5bf5ca77SDevin Teske#	printf("XXX");
68*5bf5ca77SDevin Teske#EOF
69*5bf5ca77SDevin Teske#DETAILS=$( cat <&9 )
70*5bf5ca77SDevin Teske
71*5bf5ca77SDevin Teske################################################################################
72*5bf5ca77SDevin Teske# END
73*5bf5ca77SDevin Teske################################################################################
74