summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/ior_profiling.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/ior_profiling.go b/internal/ior_profiling.go
index 8ca3922..ddae088 100644
--- a/internal/ior_profiling.go
+++ b/internal/ior_profiling.go
@@ -100,7 +100,11 @@ func (p *profilingControl) stop(logln func(...any)) {
logln("Stopping profiling and writing profile files")
pprof.StopCPUProfile()
runtime.GC()
- _ = pprof.WriteHeapProfile(p.memProfile)
+ // Log any failure writing the heap profile (e.g. full disk, permission
+ // denied) so it is not silently swallowed.
+ if err := pprof.WriteHeapProfile(p.memProfile); err != nil {
+ logln("ERROR: failed to write heap profile:", err)
+ }
p.stopExecTrace()
_ = p.cpuProfile.Close()
_ = p.memProfile.Close()