summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-12-14 13:33:16 -0600
committerVictor Lowther <victor.lowther@gmail.com>2008-12-15 06:13:40 -0600
commit3ee39985a78ee89bae1f4c7e7865398c12ca1558 (patch)
tree37f3f639e86e2ecd8c5ccc2b675ac43925639f64 /pm
parent16531c217d0f2492d431b7f5db6c2e7b012ab648 (diff)
Profile run_hooks as well as each individual hook
Diffstat (limited to 'pm')
-rw-r--r--pm/pm-functions.in8
1 files changed, 7 insertions, 1 deletions
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index a492029..870b896 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -207,7 +207,7 @@ else
fi
# Run all applicable hooks, logging success and failure as we go.
-run_hooks() {
+_run_hooks() {
# $1 = type of hook to find.
# $2 = paramaters to pass to hooks.
# $3 = if present and equal to "reverse", run hooks backwards.
@@ -249,6 +249,12 @@ run_hooks() {
inhibited && return 1 || return 0
}
+if profiling; then
+ run_hooks() { profile "$1 $2:" _run_hooks "$@"; }
+else
+ run_hooks() { _run_hooks "$@"; }
+fi
+
# Try to reinitalize the logfile. Fail unless certian criteria are met.
init_logfile()
{