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:
parent
6a21b3cdf4
commit
a061d97027
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333517
@ -50,6 +50,7 @@ ID=$(( $ID + 1 ))
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print mode/path details
|
* Print mode/path details
|
||||||
@ -57,6 +58,7 @@ exec 9<<EOF
|
|||||||
printf("%04o %s", this->mode, this->path);
|
printf("%04o %s", this->mode, this->path);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print errno details
|
* Print errno details
|
||||||
@ -29,6 +30,7 @@ exec 9<<EOF
|
|||||||
printf("%s: %s (%i)", probefunc, strerror[errno], errno);
|
printf("%s: %s (%i)", probefunc, strerror[errno], errno);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -85,6 +85,7 @@ ID=$(( $ID + 1 ))
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print disk I/O details
|
* Print disk I/O details
|
||||||
@ -100,6 +101,7 @@ exec 9<<EOF
|
|||||||
this->bio_length == 1 ? "" : "s");
|
this->bio_length == 1 ? "" : "s");
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -76,6 +76,7 @@ EVENT_TAG=$( cat <&9 )
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print network I/O details
|
* Print network I/O details
|
||||||
@ -89,6 +90,7 @@ exec 9<<EOF
|
|||||||
this->length == 1 ? "" : "s");
|
this->length == 1 ? "" : "s");
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -32,6 +32,7 @@ ID=$(( $ID + 1 ))
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print signal/pid details
|
* Print signal/pid details
|
||||||
@ -39,6 +40,7 @@ exec 9<<EOF
|
|||||||
printf("signal %i to pid %d", this->sig, this->pid);
|
printf("signal %i to pid %d", this->sig, this->pid);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -38,6 +38,7 @@ ID=$(( $ID + 1 ))
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Dump nanosleep(2) arguments
|
* Dump nanosleep(2) arguments
|
||||||
@ -46,6 +47,7 @@ exec 9<<EOF
|
|||||||
this->requested_sec, this->requested_nsec / 100000);
|
this->requested_sec, this->requested_nsec / 100000);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -42,6 +42,7 @@ ID=$(( $ID + 1 ))
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print path details
|
* Print path details
|
||||||
@ -49,6 +50,7 @@ exec 9<<EOF
|
|||||||
printf("%s", this->path);
|
printf("%s", this->path);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -149,6 +149,7 @@ ID=$(( $ID + 10 ))
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print details
|
* Print details
|
||||||
@ -156,6 +157,7 @@ exec 9<<EOF
|
|||||||
printf("%s %s", probealias[probename], this->details);
|
printf("%s %s", probealias[probename], this->details);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -55,6 +55,7 @@ ID=$(( $ID + 1 ))
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print read/write details
|
* Print read/write details
|
||||||
@ -66,6 +67,7 @@ exec 9<<EOF
|
|||||||
this->nbytes == 1 ? "" : "s");
|
this->nbytes == 1 ? "" : "s");
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -94,6 +94,7 @@ ID=$(( $ID + 6 ))
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print scheduling details
|
* Print scheduling details
|
||||||
@ -101,6 +102,7 @@ exec 9<<EOF
|
|||||||
printf("%s %s", probename, this->details);
|
printf("%s %s", probename, this->details);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -197,6 +197,7 @@ ID=$(( $ID + 5 ))
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print socket details
|
* Print socket details
|
||||||
@ -209,6 +210,7 @@ exec 9<<EOF
|
|||||||
this->details);
|
this->details);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -212,6 +212,7 @@ EVENT_TAG=$( cat <&9 )
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print details
|
* Print details
|
||||||
@ -223,6 +224,7 @@ exec 9<<EOF
|
|||||||
this->details);
|
this->details);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -90,6 +90,7 @@ EVENT_TAG=$( cat <&9 )
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print network I/O details
|
* Print network I/O details
|
||||||
@ -102,6 +103,7 @@ exec 9<<EOF
|
|||||||
this->length == 1 ? "" : "s");
|
this->length == 1 ? "" : "s");
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -181,6 +181,7 @@ EVENT_TEST="this->fi_mount != 0"
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print full path
|
* Print full path
|
||||||
@ -188,6 +189,7 @@ exec 9<<EOF
|
|||||||
printf("%s", this->path);
|
printf("%s", this->path);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -173,6 +173,7 @@ EVENT_TEST="this->fi_mount != 0"
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print full path
|
* Print full path
|
||||||
@ -180,6 +181,7 @@ exec 9<<EOF
|
|||||||
printf("%s", this->path);
|
printf("%s", this->path);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -287,6 +287,7 @@ EVENT_TEST="this->ffi_mount != 0 && this->tfi_mount != 0"
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print 'from' and 'to' full paths
|
* Print 'from' and 'to' full paths
|
||||||
@ -294,6 +295,7 @@ exec 9<<EOF
|
|||||||
printf("%s -> %s", this->fpath, this->tpath);
|
printf("%s -> %s", this->fpath, this->tpath);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
@ -182,6 +182,7 @@ EVENT_TEST="this->fi_mount != 0"
|
|||||||
|
|
||||||
############################################################ EVENT DETAILS
|
############################################################ EVENT DETAILS
|
||||||
|
|
||||||
|
if [ ! "$CUSTOM_DETAILS" ]; then
|
||||||
exec 9<<EOF
|
exec 9<<EOF
|
||||||
/*
|
/*
|
||||||
* Print full path and target
|
* Print full path and target
|
||||||
@ -189,6 +190,7 @@ exec 9<<EOF
|
|||||||
printf("%s -> %s", this->path, this->target);
|
printf("%s -> %s", this->path, this->target);
|
||||||
EOF
|
EOF
|
||||||
EVENT_DETAILS=$( cat <&9 )
|
EVENT_DETAILS=$( cat <&9 )
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# END
|
# END
|
||||||
|
Loading…
Reference in New Issue
Block a user