Skip to content

Heap profiling doesn't respect -po

Summary

The user guide states that -po sets the stem for both heap and cost-centre profiling:

-po ⟨stem⟩
The -po ⟨stem⟩ option overrides the stem used to form the output file paths for the cost-centre profiler (see -p and -pj flags above) and heap profiler (see -h).
For instance, running a program with +RTS -h -p -pohello-world would produce a heap profile named hello-world.hp and a cost-centre profile named hello-world.prof.

Yet since 373c9cb3 this is only respected for the cost-centre profiler.

This should be an easy fix so I'll make an MR soon.

Steps to reproduce

Run a program with the RTS flags +RTS -hc -postem and note that the .hp file produced will match the name of the application not stem.

Expected behavior

-po should be respected when heap profiling

Environment

  • GHC version used: 8.10.7
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information