aboutsummaryrefslogtreecommitdiff
path: root/guix/ui.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2017-06-16 14:23:51 +0200
committerLudovic Courtès <ludo@gnu.org>2017-06-16 17:08:22 +0200
commitf4453df9a5742ef47cad79254b33bfaa1ff15d24 (patch)
treee4f598aa498511524059fc01bdcf1ad3fb2d8d62 /guix/ui.scm
parentd27cc3bfaafe6b5b0831e88afb1c46311d382a0b (diff)
downloadgnu-guix-f4453df9a5742ef47cad79254b33bfaa1ff15d24.tar
gnu-guix-f4453df9a5742ef47cad79254b33bfaa1ff15d24.tar.gz
store: Add an RPC counter.
* guix/store.scm (%rpc-calls): New variable. (show-rpc-profile, record-operation): New procedures. (operation): Add call to 'record-operation'. * guix/ui.scm (run-guix-command): Wrap COMMAND-MAIN in 'dynamic-wind'. Run EXIT-HOOK.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 56fcc00300..889c9d0228 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1318,7 +1318,14 @@ found."
(parameterize ((program-name command))
;; Disable canonicalization so we don't don't stat unreasonably.
(with-fluids ((%file-port-name-canonicalization #f))
- (apply command-main args)))))
+ (dynamic-wind
+ (const #f)
+ (lambda ()
+ (apply command-main args))
+ (lambda ()
+ ;; Abuse 'exit-hook' (which is normally meant to be used by the
+ ;; REPL) to run things like profiling hooks upon completion.
+ (run-hook exit-hook)))))))
(define (run-guix . args)
"Run the 'guix' command defined by command line ARGS.