diff options
-rw-r--r-- | rts/RtsFlags.c | 17 |
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; |