summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorTeo Camarasu <teofilcamarasu@gmail.com>2022-05-18 20:08:40 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-24 10:49:13 -0400
commite2cd1d43b711ada11eb330545e2d0bff3e21b4fc (patch)
tree1491ae9496217adcb5b75502a779ab0aa71bc0b4 /rts
parent4b45fd72beda36addc11b5200f2d7c13ac6df43e (diff)
downloadhaskell-e2cd1d43b711ada11eb330545e2d0bff3e21b4fc.tar.gz
Allow passing -po outside profiling way
Resolves #21455
Diffstat (limited to 'rts')
-rw-r--r--rts/RtsFlags.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index f92147acd1..6146cfb989 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -402,6 +402,7 @@ usage_text[] = {
" -h Heap residency profile (output file <program>.hp)",
" -hT Produce a heap profile grouped by closure type",
" -hi Produce a heap profile grouped by info table address",
+" -po<file> Override profiling output file name prefix (program name by default)",
#endif /* PROFILING */
" -i<sec> Time between heap profile samples (seconds, default: 0.1)",
@@ -1379,6 +1380,21 @@ error = true;
case 'P': /* detailed cost centre profiling (time/alloc) */
case 'p': /* cost centre profiling (time/alloc) */
OPTION_SAFE;
+#if !defined(PROFILING)
+ switch (rts_argv[arg][2]) {
+ case 'o':
+ if (rts_argv[arg][3] == '\0') {
+ errorBelch("flag -po expects an argument");
+ error = true;
+ break;
+ }
+ RtsFlags.CcFlags.outputFileNameStem = rts_argv[arg]+3;
+ break;
+ default:
+ PROFILING_BUILD_ONLY();
+
+ } break;
+#else
PROFILING_BUILD_ONLY(
switch (rts_argv[arg][2]) {
case 'a':
@@ -1413,6 +1429,7 @@ error = true;
goto check_rest;
}
) break;
+#endif /* PROFILING */
case 'R':
OPTION_SAFE;