diff options
author | Bartosz Nitka <niteria@gmail.com> | 2017-09-14 02:50:05 -0700 |
---|---|---|
committer | Bartosz Nitka <niteria@gmail.com> | 2017-09-14 06:07:45 -0700 |
commit | b6b56dd1b6adc9051593955eecaef85c9d6e96b8 (patch) | |
tree | 7ce98d5b9cc70cfd1ed9d8ceb69cf9e9d7fac66d /rts/RtsFlags.c | |
parent | 9e46167fc54b09bd59bc1e5f82dea19c3f4c3121 (diff) | |
download | haskell-b6b56dd1b6adc9051593955eecaef85c9d6e96b8.tar.gz |
[RTS] Make -po work
db2a667655506c43dd3c8260d29031bde55f1bee 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
Diffstat (limited to 'rts/RtsFlags.c')
-rw-r--r-- | rts/RtsFlags.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index ec21ef1050..4194aa0eec 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -185,11 +185,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 #if defined(PROFILING) RtsFlags.ProfFlags.includeTSOs = false; @@ -1143,6 +1144,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; |