From db2a667655506c43dd3c8260d29031bde55f1bee Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 28 Feb 2017 09:31:06 -0500 Subject: rts: Allow profile output path to be specified on RTS command line This introduces a RTS option, -po, which allows the user to override the stem used to form the output file names of the heap profile and cost center summary. It's a bit unclear to me whether this is really the interface we want. Alternatively we could just allow the user to specify the `.hp` and `.prof` file names separately. This would arguably be a bit more straightforward and would allow the user to name JSON output with an appropriate `.json` suffix if they so desired. However, this would come at the cost of taking more of the option space, which is a somewhat precious commodity. Test Plan: Validate, try using `-po` RTS option Reviewers: simonmar, austin, erikd Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3182 --- docs/users_guide/profiling.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/users_guide/profiling.rst b/docs/users_guide/profiling.rst index 764ee92c8d..832464e8b0 100644 --- a/docs/users_guide/profiling.rst +++ b/docs/users_guide/profiling.rst @@ -402,7 +402,8 @@ enclosed between ``+RTS ... -RTS`` as usual): single: time profile The :rts-flag:`-p` option produces a standard *time profile* report. It is - written into the file :file:`program.prof`. + written into the file :file:`.prof`; the stem is taken to be the program + name by default, but can be overridden by the :rts-flag:`-po` flag. The :rts-flag:`-P` option produces a more detailed report containing the actual time and allocation data as well. (Not used much.) @@ -415,6 +416,16 @@ enclosed between ``+RTS ... -RTS`` as usual): The :rts-flag:`-pj` option produces a time/allocation profile report in JSON format written into the file :file:`.prof`. +.. rts-flag:: -po ⟨stem⟩ + + The :rts-flag:`-po` option overrides the stem used to form the output file + paths for the cost-center profiler (see :rts-flag:`-p` and :rts-flag:`-pj` + flags above) and heap profiler (see :rts-flag:`-h`). + + For instance, running a program with ``+RTS -h -p -pohello-world`` would + produce a heap profile named :file:`hello-world.hp` and a cost-center + profile named :file:`hello-world.prof`. + .. rts-flag:: -V Sets the interval that the RTS clock ticks at, which is also the -- cgit v1.2.1