Allow using the heap profiler in the inferior
This commit is contained in:
parent
ebeb4212ff
commit
e7ada1bada
1 changed files with 25 additions and 0 deletions
|
|
@ -1714,6 +1714,31 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
|
|||
|
||||
(inferior-eval '(when (defined? '%graft?) (%graft? #f)) inf)
|
||||
|
||||
;; Load the heap-profiler
|
||||
(for-each
|
||||
(lambda (exp)
|
||||
(inferior-eval exp inf))
|
||||
(call-with-input-file
|
||||
(%search-load-path "guix-data-service/heap-profiler.scm")
|
||||
(lambda (port)
|
||||
(let loop ((result '()))
|
||||
(let ((exp (read port)))
|
||||
(if (eof-object? exp)
|
||||
(reverse! result)
|
||||
(loop (cons (if (eq? (car exp) 'define-module)
|
||||
`(use-modules
|
||||
,@(let loop ((lst (cddr exp))
|
||||
(result '()))
|
||||
(match lst
|
||||
('() result)
|
||||
(('#:use-module mod rest ...)
|
||||
(loop rest
|
||||
(cons mod result)))
|
||||
(rest
|
||||
(loop (cdr lst) result)))))
|
||||
exp)
|
||||
result))))))))
|
||||
|
||||
;; TODO Have Guix make this easier
|
||||
((@@ (guix inferior) ensure-store-bridge!) inf)
|
||||
(non-blocking-port ((@@ (guix inferior) inferior-bridge-socket) inf))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue