[commit: ghc] master: Fix +RTS -h when compiling without -prof (c33e7c2)

git at git.haskell.org git at git.haskell.org
Fri Jan 8 14:04:42 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c33e7c2b1a62f340432c752fb37ca1374e3e982a/ghc

>---------------------------------------------------------------

commit c33e7c2b1a62f340432c752fb37ca1374e3e982a
Author: Simon Marlow <smarlow at fb.com>
Date:   Thu Jan 7 06:23:14 2016 -0800

    Fix +RTS -h when compiling without -prof
    
    Summary:
    Was broken by ce1f1607ed7f8fedd2f63c8610cafefd59baaf32.  I've added a
    test so that hopefully it won't break again.
    
    Test Plan: validate & new test case
    
    Reviewers: bgamari, austin, erikd
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1746
    
    GHC Trac Issues: #11304


>---------------------------------------------------------------

c33e7c2b1a62f340432c752fb37ca1374e3e982a
 rts/ProfHeap.c                                                |  6 +-----
 testsuite/config/ghc                                          |  5 +++--
 testsuite/tests/profiling/should_run/all.T                    | 11 +++++++++--
 .../should_run/{heapprof001.stdout => heapprof002.stdout}     |  0
 4 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index 43bd7b4..e7f6417 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -311,15 +311,11 @@ nextEra( void )
 FILE *hp_file;
 static char *hp_filename;
 
-void initProfiling (void)
-{
-}
-
 void freeProfiling (void)
 {
 }
 
-void initProfiling2 (void)
+void initProfiling (void)
 {
     char *prog;
 
diff --git a/testsuite/config/ghc b/testsuite/config/ghc
index dc00adb..77dfa98 100644
--- a/testsuite/config/ghc
+++ b/testsuite/config/ghc
@@ -23,7 +23,7 @@ config.compile_ways       = ['normal', 'hpc']
 config.run_ways           = ['normal', 'hpc']
 
 # ways that are not enabled by default, but can always be invoked explicitly
-config.other_ways         = ['prof',
+config.other_ways         = ['prof', 'prof_h',
                              'prof_hc_hb','prof_hb',
                              'prof_hd','prof_hy','prof_hr',
                              'threaded1_ls', 'threaded2_hT',
@@ -99,6 +99,7 @@ config.way_flags = lambda name : {
     'threaded2'    : ['-O', '-threaded', '-eventlog'],
     'threaded2_hT' : ['-O', '-threaded'],
     'hpc'          : ['-O', '-fhpc', '-hpcdir', '.hpc.' + name ],
+    'prof_h'       : [],
     'prof_hc_hb'   : ['-O', '-prof', '-static', '-auto-all'],
     'prof_hb'      : ['-O', '-prof', '-static', '-auto-all'],
     'prof_hd'      : ['-O', '-prof', '-static', '-auto-all'],
@@ -130,6 +131,7 @@ config.way_rts_flags = {
     'threaded2'    : ['-N2 -ls'],
     'threaded2_hT' : ['-N2', '-hT'],
     'hpc'          : [],
+    'prof_h'       : ['-h'], # works without -prof
     'prof_hc_hb'   : ['-hc -hbvoid'],
     'prof_hb'      : ['-hb'],
     'prof_hd'      : ['-hd'],
@@ -216,4 +218,3 @@ def get_compiler_info():
         config.ghci_way_flags   = "-static"
         config.ghc_th_way       = "normal"
         config.ghc_plugin_way   = "normal"
-
diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T
index 4e4bd09..840b251 100644
--- a/testsuite/tests/profiling/should_run/all.T
+++ b/testsuite/tests/profiling/should_run/all.T
@@ -4,11 +4,18 @@ extra_prof_ways = ['prof', 'prof_hc_hb', 'prof_hb', 'prof_hd', 'prof_hy', 'prof_
 
 test('heapprof001',
      [only_ways(prof_ways),
-      extra_ways(extra_prof_ways),
-      req_profiling,
+      when(have_profiling(), extra_ways(extra_prof_ways)),
       extra_run_opts('7')],
      compile_and_run, [''])
 
+test('heapprof002',
+     [ pre_cmd('cp heapprof001.hs heapprof002.hs')
+     , extra_clean(['heapprof002.hs'])
+     , extra_ways(['prof_h'])
+     , extra_run_opts('7')
+     ],
+     compile_and_run, [''])
+
 test('T2592',
      [only_ways(['profasm']), req_profiling,
       extra_run_opts('+RTS -M1m -RTS'), exit_code(251)],
diff --git a/testsuite/tests/profiling/should_run/heapprof001.stdout b/testsuite/tests/profiling/should_run/heapprof002.stdout
similarity index 100%
copy from testsuite/tests/profiling/should_run/heapprof001.stdout
copy to testsuite/tests/profiling/should_run/heapprof002.stdout



More information about the ghc-commits mailing list