1 # -*- tab-width: 4 -*- ;; Emacs
2 # vi: set filetype=sh tabstop=8 shiftwidth=8 noexpandtab :: Vi/ViM
3 ############################################################ IDENT(1)
5 # $Title: dwatch(8) module for nanosleep(2) [or similar] entry $
6 # $Copyright: 2014-2018 Devin Teske. All rights reserved. $
9 ############################################################ DESCRIPTION
11 # Print arguments being passed to nanosleep(2) [or similar]
13 ############################################################ PROBE
15 : ${PROBE:=syscall::$PROFILE:entry}
17 ############################################################ ACTIONS
20 this struct timespec * rqtp;
21 this time_t requested_sec;
22 this long requested_nsec;
24 $PROBE /* probe ID $ID */
29 * const struct timespec *
31 this->rqtp = (struct timespec *)copyin(arg0, sizeof(struct timespec));
32 this->requested_sec = (time_t)this->rqtp->tv_sec;
33 this->requested_nsec = (long)this->rqtp->tv_nsec;
39 ############################################################ EVENT DETAILS
41 if [ ! "$CUSTOM_DETAILS" ]; then
44 * Dump nanosleep(2) arguments
46 printf("%d.%d seconds",
47 this->requested_sec, this->requested_nsec / 100000);
49 EVENT_DETAILS=$( cat <&9 )
52 ################################################################################
54 ################################################################################