Changeset View
Changeset View
Standalone View
Standalone View
cddl/usr.sbin/dwatch/libexec/fchmod
- This file was added.
Property | Old Value | New Value |
---|---|---|
svn:keywords | null | FreeBSD=%H \ No newline at end of property |
# -*- tab-width: 4 -*- ;; Emacs | |||||
# vi: set filetype=sh tabstop=8 shiftwidth=8 noexpandtab :: Vi/ViM | |||||
############################################################ IDENT(1) | |||||
# | |||||
# $Title: dwatch(8) module for fchmod(2) entry $ | |||||
# $Copyright: 2014-2017 Devin Teske. All rights reserved. $ | |||||
# $FreeBSD$ | |||||
# | |||||
############################################################ DESCRIPTION | |||||
# | |||||
# Print arguments being passed to fchmod(2) | |||||
# | |||||
############################################################ PROBE | |||||
# This is optional, if you don't set or it is NULL, dwatch(8) will try to | |||||
# dynamically determine the probe via the module's filename. For example, if | |||||
# the module file is named `foo' then dwatch(8) will try `dtrace -ln foo:entry' | |||||
# to determine an appropriate probe for watching `foo'. | |||||
PROBE=syscall::fchmod | |||||
############################################################ ACTIONS | |||||
# Optional actions to be performed before hitting the final print action | |||||
#exec 9<<EOF | |||||
#EOF | |||||
#ACTIONS=$( cat <&9 ) | |||||
#ID= | |||||
############################################################ PRINT ACTION | |||||
# The default value is simply `entry'. This is paired with $PROBE (which can be | |||||
# auto-probed when unset or NULL) and can be customized to include clauses for | |||||
# the final print action which must be true before the print action will run. | |||||
#PRINT= | |||||
############################################################ EVENT TAG | |||||
# The EVENT_TAG is run inside the print action after the timestamp has been | |||||
# printed. By default, `UID.GID CMD[PID]: ' of the process is printed. | |||||
#exec 9<<EOF | |||||
#EOF | |||||
#EVENT_TAG=$( cat <&9 ) | |||||
############################################################ DETAILS | |||||
# The DETAILS are run after the EVENT_TAG and by default, the program name and | |||||
# arguments of the process hitting the PRINT action are shown. This can be | |||||
# customized to call-specific information because the `-v' flag of dwatch(8) | |||||
# can provide detailed process information for the PRINT action on lines below | |||||
# the DETAILS. | |||||
# | |||||
# NB: Should produce a single-line and not print a trailing newline. | |||||
exec 9<<EOF | |||||
printf("fchmod(fd %i, mode %04o)", (int)arg0, (mode_t)arg1); | |||||
EOF | |||||
DETAILS=$( cat <&9 ) | |||||
################################################################################ | |||||
# END | |||||
################################################################################ |