dwatch(1): Allow `-E code' to override profile EVENT_DETAILS

This allows quick changes to the formatted output of a profile.

Sponsored by:	Smule, Inc.
This commit is contained in:
Devin Teske 2018-05-12 06:01:41 +00:00
parent 6a21b3cdf4
commit a061d97027
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333517
17 changed files with 34 additions and 0 deletions

View File

@ -50,6 +50,7 @@ ID=$(( $ID + 1 ))
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print mode/path details
@ -57,6 +58,7 @@ exec 9<<EOF
printf("%04o %s", this->mode, this->path);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -22,6 +22,7 @@
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print errno details
@ -29,6 +30,7 @@ exec 9<<EOF
printf("%s: %s (%i)", probefunc, strerror[errno], errno);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -85,6 +85,7 @@ ID=$(( $ID + 1 ))
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print disk I/O details
@ -100,6 +101,7 @@ exec 9<<EOF
this->bio_length == 1 ? "" : "s");
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -76,6 +76,7 @@ EVENT_TAG=$( cat <&9 )
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print network I/O details
@ -89,6 +90,7 @@ exec 9<<EOF
this->length == 1 ? "" : "s");
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -32,6 +32,7 @@ ID=$(( $ID + 1 ))
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print signal/pid details
@ -39,6 +40,7 @@ exec 9<<EOF
printf("signal %i to pid %d", this->sig, this->pid);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -38,6 +38,7 @@ ID=$(( $ID + 1 ))
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Dump nanosleep(2) arguments
@ -46,6 +47,7 @@ exec 9<<EOF
this->requested_sec, this->requested_nsec / 100000);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -42,6 +42,7 @@ ID=$(( $ID + 1 ))
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print path details
@ -49,6 +50,7 @@ exec 9<<EOF
printf("%s", this->path);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -149,6 +149,7 @@ ID=$(( $ID + 10 ))
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print details
@ -156,6 +157,7 @@ exec 9<<EOF
printf("%s %s", probealias[probename], this->details);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -55,6 +55,7 @@ ID=$(( $ID + 1 ))
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print read/write details
@ -66,6 +67,7 @@ exec 9<<EOF
this->nbytes == 1 ? "" : "s");
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -94,6 +94,7 @@ ID=$(( $ID + 6 ))
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print scheduling details
@ -101,6 +102,7 @@ exec 9<<EOF
printf("%s %s", probename, this->details);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -197,6 +197,7 @@ ID=$(( $ID + 5 ))
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print socket details
@ -209,6 +210,7 @@ exec 9<<EOF
this->details);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -212,6 +212,7 @@ EVENT_TAG=$( cat <&9 )
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print details
@ -223,6 +224,7 @@ exec 9<<EOF
this->details);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -90,6 +90,7 @@ EVENT_TAG=$( cat <&9 )
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print network I/O details
@ -102,6 +103,7 @@ exec 9<<EOF
this->length == 1 ? "" : "s");
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -181,6 +181,7 @@ EVENT_TEST="this->fi_mount != 0"
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print full path
@ -188,6 +189,7 @@ exec 9<<EOF
printf("%s", this->path);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -173,6 +173,7 @@ EVENT_TEST="this->fi_mount != 0"
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print full path
@ -180,6 +181,7 @@ exec 9<<EOF
printf("%s", this->path);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -287,6 +287,7 @@ EVENT_TEST="this->ffi_mount != 0 && this->tfi_mount != 0"
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print 'from' and 'to' full paths
@ -294,6 +295,7 @@ exec 9<<EOF
printf("%s -> %s", this->fpath, this->tpath);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END

View File

@ -182,6 +182,7 @@ EVENT_TEST="this->fi_mount != 0"
############################################################ EVENT DETAILS
if [ ! "$CUSTOM_DETAILS" ]; then
exec 9<<EOF
/*
* Print full path and target
@ -189,6 +190,7 @@ exec 9<<EOF
printf("%s -> %s", this->path, this->target);
EOF
EVENT_DETAILS=$( cat <&9 )
fi
################################################################################
# END