Better hints when RTS options not available (Trac #9579)
authorJavran Cheng <Javran.c@gmail.com>
Fri, 17 Apr 2015 00:52:00 +0000 (10:52 +1000)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Fri, 17 Apr 2015 02:06:54 +0000 (12:06 +1000)
commit51af102e5c6c56e0987432aa5a21fe10e24090e9
tree5e8a94af428f03b981d51e67c050b816f8e5b239
parent3b90d8c8cfb4f56cec3eb5e1ede12c22a9e28d79
Better hints when RTS options not available (Trac #9579)

This patch provides user with a better hint when most RTS options
are not available (not compiled with `-rtsopts`).

A new field "rtsOptsEnabled" is added into RtsFlags.MiscFlags to
tell the availablity of RTS options.

Some concerns:
* Unlike other flag fields in "libraries/base/GHC/RTS/Flags.hsc",
  "RtsOptsEnabled" is defined in "includes/RtsAPI.h" and lacks
  constant macros. Therefore In "GHC.RTS", "RtsOptsEnabled" simply
  derives Enum instance and reads as of type "CInt".

* There are other ways to change RTS options (e.g. `-with-rtsopts`),
  but it might be too verbose to mention.

Test Plan: validate

Reviewers: austin, hvr, thomie, simonmar

Reviewed By: thomie

Subscribers: thomie, rwbarton

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

GHC Trac Issues: #9579
13 files changed:
rts/ProfHeap.c
rts/hooks/OutOfHeap.c
rts/hooks/StackOverflow.c
testsuite/tests/rts/T9579/Makefile [new file with mode: 0644]
testsuite/tests/rts/T9579/OutOfHeap.hs [new file with mode: 0644]
testsuite/tests/rts/T9579/StackOverflow.hs [new file with mode: 0644]
testsuite/tests/rts/T9579/T9579_outofheap_rtsall.stderr [new file with mode: 0644]
testsuite/tests/rts/T9579/T9579_outofheap_rtsnone.stderr [new file with mode: 0644]
testsuite/tests/rts/T9579/T9579_outofheap_rtssome.stderr [new file with mode: 0644]
testsuite/tests/rts/T9579/T9579_stackoverflow_rtsall.stderr [new file with mode: 0644]
testsuite/tests/rts/T9579/T9579_stackoverflow_rtsnone.stderr [new file with mode: 0644]
testsuite/tests/rts/T9579/T9579_stackoverflow_rtssome.stderr [new file with mode: 0644]
testsuite/tests/rts/T9579/all.T [new file with mode: 0644]