Commit 18d66feb authored by niteria's avatar niteria Committed by Ben Gamari

[RTS] Make -po work

db2a6676 added `-po` option, but
the part that parses it was missing.

Test Plan:
On a simple file:
```
./inplace/bin/ghc-stage2 A.hs -prof -main-is A; ./A +RTS -P -potest
```
produced test.prof file and didn't produce A.prof file.

```
./A +RTS -P
```
produced A.prof file

Reviewers: simonmar, bgamari, austin, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3946

(cherry picked from commit b6b56dd1)
parent a2883ef3
......@@ -183,11 +183,12 @@ void initRtsFlagsDefaults(void)
RtsFlags.DebugFlags.compact = false;
#if defined(PROFILING)
RtsFlags.CcFlags.doCostCentres = 0;
RtsFlags.CcFlags.doCostCentres = COST_CENTRES_NONE;
RtsFlags.CcFlags.outputFileNameStem = NULL;
#endif /* PROFILING */
RtsFlags.ProfFlags.doHeapProfile = false;
RtsFlags.ProfFlags. heapProfileInterval = USToTime(100000); // 100ms
RtsFlags.ProfFlags.heapProfileInterval = USToTime(100000); // 100ms
#ifdef PROFILING
RtsFlags.ProfFlags.includeTSOs = false;
......@@ -1072,6 +1073,14 @@ error = true;
case 'j':
RtsFlags.CcFlags.doCostCentres = COST_CENTRES_JSON;
break;
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;
case '\0':
if (rts_argv[arg][1] == 'P') {
RtsFlags.CcFlags.doCostCentres = COST_CENTRES_VERBOSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment