Small bug I found when using the statprof module when using the
statprof procedure with a flat display. The summary lines at the end
are not written to the port provided as an argument and are instead
written to (current-output-port). A patch is attached, which just
makes the format statements use port instead of #t.


Freja Nordsiek
From 17c74a4ce55685252fe7fea0cdbbc7d0a3347095 Mon Sep 17 00:00:00 2001
From: Freja Nordsiek <fnord...@gmail.com>
Date: Sun, 19 Mar 2017 16:15:24 +0100
Subject: [PATCH] Fixed bug: statprof flat display wasn't writing summary lines
 to port

* module/statprof.scm (statprof-display/flat): fixed bug where summary lines
  were written to (current-output-port) instead of the provided port.
---
 module/statprof.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/module/statprof.scm b/module/statprof.scm
index fe605e0..59a2f12 100644
--- a/module/statprof.scm
+++ b/module/statprof.scm
@@ -652,8 +652,8 @@ optional @var{port} argument is passed, uses the current output port."
       (for-each display-stats-line sorted-stats)
 
       (display "---\n" port)
-      (format #t "Sample count: ~A\n" (statprof-sample-count state))
-      (format #t "Total time: ~A seconds (~A seconds in GC)\n"
+      (format port "Sample count: ~A\n" (statprof-sample-count state))
+      (format port "Total time: ~A seconds (~A seconds in GC)\n"
               (statprof-accumulated-time state)
               (/ (gc-time-taken state)
                  1.0 internal-time-units-per-second))))))
-- 
2.9.3

Reply via email to