1# -*- tab-width: 4 -*- ;; Emacs
2# vi: set filetype=sh tabstop=8 shiftwidth=8 noexpandtab :: Vi/ViM
3############################################################ IDENT(1)
4#
5# $Title: dwatch(8) module for kill(2) [or similar] entry $
6# $Copyright: 2014-2018 Devin Teske. All rights reserved. $
7# $FreeBSD$
8#
9############################################################ DESCRIPTION
10#
11# Print arguments being passed to kill(2) [or similar]
12#
13############################################################ PROBE
14
15: ${PROBE:=syscall::$PROFILE:entry}
16
17############################################################ ACTIONS
18
19exec 9<<EOF
20this int	sig;
21this pid_t	pid;
22
23$PROBE /* probe ID $ID */
24{${TRACE:+
25	printf("<$ID>");}
26	this->pid = (pid_t)arg0;
27	this->sig = (int)arg1;
28}
29EOF
30ACTIONS=$( cat <&9 )
31ID=$(( $ID + 1 ))
32
33############################################################ EVENT DETAILS
34
35if [ ! "$CUSTOM_DETAILS" ]; then
36exec 9<<EOF
37	/*
38	 * Print signal/pid details
39	 */
40	printf("signal %i to pid %d", this->sig, this->pid);
41EOF
42EVENT_DETAILS=$( cat <&9 )
43fi
44
45################################################################################
46# END
47################################################################################
48